Skip to content

Commit

Permalink
chore: update stress test
Browse files Browse the repository at this point in the history
Signed-off-by: Firas Qutishat <firas.qutishat@securekey.com>
  • Loading branch information
fqutishat committed Nov 17, 2021
1 parent fc5e43a commit 135c7eb
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 60 deletions.
6 changes: 1 addition & 5 deletions test/bdd/bddtests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,14 @@ func TestMain(m *testing.M) {
status := godog.RunWithOptions("godogs", func(s *godog.Suite) {
s.BeforeSuite(func() {
if compose {
if err := os.Setenv("ORB_STRESS_DID_DOMAINS", "https://localhost:48326"); err != nil {
if err := os.Setenv("ORB_STRESS_DID_DOMAINS", "https://orb.domain1.com"); err != nil {
panic(err.Error())
}

if err := os.Setenv("ORB_STRESS_DID_NUMS", "5"); err != nil {
panic(err.Error())
}

if err := os.Setenv("ORB_STRESS_ANCHOR_ORIGIN", "https://orb.domain2.com"); err != nil {
panic(err.Error())
}

if err := os.Setenv("ORB_STRESS_CONCURRENT_REQ", "1"); err != nil {
panic(err.Error())
}
Expand Down
8 changes: 3 additions & 5 deletions test/bdd/features/orb-stress.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@
@all
@orb_stress
Feature: Using Orb stress test
Background: Setup
Given orb-cli is executed with args 'acceptlist add --url https://localhost:48326/services/orb/acceptlist --actor https://orb.domain2.com/services/orb --type follow --tls-cacerts fixtures/keys/tls/ec-cacert.pem --auth-token ADMIN_TOKEN'
And orb-cli is executed with args 'acceptlist add --url https://localhost:48426/services/orb/acceptlist --actor https://orb.domain1.com/services/orb --type invite-witness --tls-cacerts fixtures/keys/tls/ec-cacert.pem --auth-token ADMIN_TOKEN'

@orb_did_stress_test_setup
Scenario:
Given orb-cli is executed with args 'acceptlist add --url https://localhost:48326/services/orb/acceptlist --actor https://orb.domain2.com/services/orb --type follow --tls-cacerts fixtures/keys/tls/ec-cacert.pem --auth-token ADMIN_TOKEN'
And orb-cli is executed with args 'acceptlist add --url https://localhost:48426/services/orb/acceptlist --actor https://orb.domain1.com/services/orb --type invite-witness --tls-cacerts fixtures/keys/tls/ec-cacert.pem --auth-token ADMIN_TOKEN'
# domain2 server follows domain1 server
When user create "follower" activity with outbox-url "https://localhost:48426/services/orb/outbox" actor "https://orb.domain2.com/services/orb" to "https://orb.domain1.com/services/orb" action "Follow"
# domain1 invites domain2 to be a witness
When user create "witness" activity with outbox-url "https://localhost:48326/services/orb/outbox" actor "https://orb.domain1.com/services/orb" to "https://orb.domain2.com/services/orb" action "InviteWitness"

@orb_did_stress_test
Scenario:
When client sends request to "ORB_STRESS_DID_DOMAINS" to create and update "ORB_STRESS_DID_NUMS" DID documents with anchor origin "ORB_STRESS_ANCHOR_ORIGIN" using "ORB_STRESS_CONCURRENT_REQ" concurrent requests
When client sends request to "ORB_STRESS_DID_DOMAINS" to create and update "ORB_STRESS_DID_NUMS" DID documents using "ORB_STRESS_CONCURRENT_REQ" concurrent requests
6 changes: 3 additions & 3 deletions test/bdd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ require (
github.com/cucumber/messages-go/v10 v10.0.3
github.com/fsouza/go-dockerclient v1.6.5
github.com/google/uuid v1.3.0
github.com/hyperledger/aries-framework-go v0.1.7
github.com/hyperledger/aries-framework-go v0.1.8-0.20211115182008-a05b96ee7ab1
github.com/hyperledger/aries-framework-go-ext/component/storage/couchdb v0.0.0-20210909220549-ce3a2ee13e22
github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb v0.0.0-20211006214906-8ddae60cdd21
github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v0.0.0-20210908194819-812cc66d2834
github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v0.1.4-0.20211116215934-986cb5330d12
github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20210910143505-343c246c837c
github.com/hyperledger/aries-framework-go/spi v0.0.0-20210929194240-2d601d717a3e
github.com/igor-pavlenko/httpsignatures-go v0.0.21
Expand All @@ -24,7 +24,7 @@ require (
github.com/mr-tron/base58 v1.2.0
github.com/sirupsen/logrus v1.8.1
github.com/tidwall/gjson v1.7.4
github.com/trustbloc/orb v0.1.3-0.20210826224204-8f7cf7841ff2
github.com/trustbloc/orb v0.1.4-0.20211008191555-789f5f021da4
github.com/trustbloc/sidetree-core-go v0.7.1-0.20211012203148-2f1d13fca175
)

Expand Down
17 changes: 6 additions & 11 deletions test/bdd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,9 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:H
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/ThreeDotsLabs/watermill v1.0.2/go.mod h1:vZCPh7eN0P7r2qKau4SfmcUZ83+3JXWkRl4BiWUlqFw=
github.com/ThreeDotsLabs/watermill v1.1.0/go.mod h1:Qd1xNFxolCAHCzcMrm6RnjW0manbvN+DJVWc1MWRFlI=
github.com/ThreeDotsLabs/watermill v1.2.0-rc.4 h1:hX8toeERHfnrZFvCXdWRQCYgoNExQoi5vtf5+rbGaA8=
github.com/ThreeDotsLabs/watermill v1.2.0-rc.4/go.mod h1:sl2PSceOQJ8BreN60hCnU2WixFNOYJOQDY1J3hvyVCs=
github.com/ThreeDotsLabs/watermill v1.2.0-rc.6 h1:wYybtpC+LMQCC8j3/D1BQPobWh0rZ4ZX57i3+zy7t8I=
github.com/ThreeDotsLabs/watermill v1.2.0-rc.6/go.mod h1:QLZSaklpSZ/7yv288LL2DFOgCEi86VYEmQvzmaMlHoA=
github.com/ThreeDotsLabs/watermill-amqp v1.1.1/go.mod h1:Qbu3JDlr6vIOxHJjhfsSHsrdF/ToJLYoaYek8X5Wnto=
github.com/ThreeDotsLabs/watermill-amqp v1.1.3/go.mod h1:AnjfZlOKwWdDFQl23WCspiC1kewtqt5dognCKwvEk4M=
github.com/ThreeDotsLabs/watermill-amqp v1.1.4-0.20211104161030-4f337d77fb1f/go.mod h1:5RtpKNTriXCWQZ67YDg1G7qsphZoUue/EWOmQqTZi3Q=
github.com/ThreeDotsLabs/watermill-http v1.1.3/go.mod h1:mkQ9CC0pxTZerNwr281rBoOy355vYt/lePkmYSX/BRg=
github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw=
Expand Down Expand Up @@ -833,8 +828,8 @@ github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI=
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/go-plugin v1.0.0/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY=
github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY=
Expand Down Expand Up @@ -932,16 +927,17 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK
github.com/hyperledger/aries-framework-go v0.1.7-0.20210421203733-b5dfd703a8fc/go.mod h1:tBgxVOKcNero3QI21iNf3oxxHkgRMDOby937cqHEvW4=
github.com/hyperledger/aries-framework-go v0.1.7-0.20210603210127-e57b8c94e3cf/go.mod h1:h6L+YoXtw90OZrH2IequxukIGwzfSpz8pUueQ9T5KqI=
github.com/hyperledger/aries-framework-go v0.1.7-0.20210816113201-26c0665ef2b9/go.mod h1:VmoqKNXXyYN3R0ObcGA8ZBdbcmKZJFCakuZGDezi+GQ=
github.com/hyperledger/aries-framework-go v0.1.7 h1:ZauGEVaBI4GnUDJcmbiCxbG/MHabMXMlAQee1B4nw8E=
github.com/hyperledger/aries-framework-go v0.1.7/go.mod h1:uve8/q23AUnq4EM0vBkEr1lKZRC67q5RcaHXh0ZOt0Y=
github.com/hyperledger/aries-framework-go v0.1.8-0.20211115182008-a05b96ee7ab1 h1:2cOa+A+E2hmfxMN1os7303sorTFuyPnPPt6dZtgNri0=
github.com/hyperledger/aries-framework-go v0.1.8-0.20211115182008-a05b96ee7ab1/go.mod h1:uve8/q23AUnq4EM0vBkEr1lKZRC67q5RcaHXh0ZOt0Y=
github.com/hyperledger/aries-framework-go-ext/component/storage/couchdb v0.0.0-20210909220549-ce3a2ee13e22 h1:dzRPCOUIU/RKlGSGJsqpBh0uHOjMN4LC/c25fs7nnlE=
github.com/hyperledger/aries-framework-go-ext/component/storage/couchdb v0.0.0-20210909220549-ce3a2ee13e22/go.mod h1:FtlFhPHMyLORgrPpvWSmEQSNhLiwAQ4V6rqNPfuDj0o=
github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb v0.0.0-20210909220549-ce3a2ee13e22/go.mod h1:aiO9mXZBykIEwmgp9sSdpMuTw0P7b+ZFUltcIB9ZccY=
github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb v0.0.0-20211006214906-8ddae60cdd21 h1:vY3+V+AIR7jw4wbj5pTxLbW3ene12HTT3CtOka2RzlY=
github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb v0.0.0-20211006214906-8ddae60cdd21/go.mod h1:Y8lhkmpYhuCoE3jtdZsJRLNDCGOih+hdtdGkRliCn3U=
github.com/hyperledger/aries-framework-go-ext/component/storage/mysql v0.0.0-20210909220549-ce3a2ee13e22/go.mod h1:bShq2cEzJcCEFkYIlQATTVldlOfyYvmnVPAdUSfCDm4=
github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v0.0.0-20210908194819-812cc66d2834 h1:Ne5ic191b5yDDSF2Sxb1u1aeMEX8nybReGe3MqB+dk8=
github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v0.0.0-20210908194819-812cc66d2834/go.mod h1:zOxbrhczBoc0m4pGeobzLgkGSHwMAmTonAEKGNWAwto=
github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v0.1.4-0.20211116215934-986cb5330d12 h1:DjLPCCa4EUeQjpmFq9HGF6M96j4JfAOMcYEhfATuZAw=
github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v0.1.4-0.20211116215934-986cb5330d12/go.mod h1:dQ45PWSEdXLBxM/CqdbCN8MIdlkvBSI+GbTSvVoM1hY=
github.com/hyperledger/aries-framework-go-ext/component/vdr/sidetree v0.0.0-20210817192417-e46e251f4caf h1:2krgskEjvu22dtSem82Gd4HHmXSRj1ZSZu1/m/UnQn4=
github.com/hyperledger/aries-framework-go-ext/component/vdr/sidetree v0.0.0-20210817192417-e46e251f4caf/go.mod h1:RWOg+7MzAEtY0KHYesBUdBNr59cOqcx7jUg9RzIuop4=
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20210520055214-ae429bb89bf7/go.mod h1:7D+Y5J9cIsUrMGFAsIED+3bAPNjxp6ggXo0/kT5N6BI=
Expand Down Expand Up @@ -1117,7 +1113,6 @@ github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGN
github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc=
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
github.com/lithammer/shortuuid/v3 v3.0.4 h1:uj4xhotfY92Y1Oa6n6HUiFn87CdoEHYUlTy0+IgbLrs=
github.com/lithammer/shortuuid/v3 v3.0.4/go.mod h1:RviRjexKqIzx/7r1peoAITm6m7gnif/h+0zmolKJjzw=
github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8=
github.com/lithammer/shortuuid/v3 v3.0.7/go.mod h1:vMk8ke37EmiewwolSO1NLW8vP4ZaKlRuDIi8tWWmAts=
Expand Down Expand Up @@ -1557,6 +1552,7 @@ github.com/trustbloc/edge-core v0.1.7-0.20210816120552-ed93662ac716/go.mod h1:7j
github.com/trustbloc/edge-core v0.1.7 h1:DzFoB3TsBqRWI7GSkrtPQJi/su84GOFFVsDR6V3O60k=
github.com/trustbloc/edge-core v0.1.7/go.mod h1:nQnH3CcEHTRXsWZe/vgj+J0JxxjwFK9IvY3u0Sr/2XY=
github.com/trustbloc/sidetree-core-go v0.6.1-0.20210817155948-c3cb7a03f63b/go.mod h1:uv89fJcqz21OrBqZUyXTPp0BBmyi2xh+Eigy5T/dIsc=
github.com/trustbloc/sidetree-core-go v0.7.1-0.20211001153855-238da75965f8/go.mod h1:uv89fJcqz21OrBqZUyXTPp0BBmyi2xh+Eigy5T/dIsc=
github.com/trustbloc/sidetree-core-go v0.7.1-0.20211012203148-2f1d13fca175 h1:dSlhDtW3xUE8ayNd5HunbmPO8xR5cBkgUSf63Q5xYTg=
github.com/trustbloc/sidetree-core-go v0.7.1-0.20211012203148-2f1d13fca175/go.mod h1:uv89fJcqz21OrBqZUyXTPp0BBmyi2xh+Eigy5T/dIsc=
github.com/trustbloc/vct v0.1.3 h1:5QYeF96cGLxq2jBuPlhDPKydaKwMF1vYSn/bssQNBOE=
Expand Down Expand Up @@ -1882,7 +1878,6 @@ golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
58 changes: 22 additions & 36 deletions test/bdd/stress_steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"crypto/rand"
"crypto/tls"
"fmt"
mrand "math/rand"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -82,21 +81,16 @@ func NewStressSteps(ctx *BDDContext) *StressSteps {

// RegisterSteps registers agent steps.
func (e *StressSteps) RegisterSteps(s *godog.Suite) {
s.Step(`^client sends request to "([^"]*)" to create and update "([^"]*)" DID documents with anchor origin "([^"]*)" using "([^"]*)" concurrent requests$`,
s.Step(`^client sends request to "([^"]*)" to create and update "([^"]*)" DID documents using "([^"]*)" concurrent requests$`,
e.createConcurrentReq)
}

func (e *StressSteps) createConcurrentReq(domainsEnv, didNumsEnv, anchorOriginEnv, concurrencyEnv string) error {
func (e *StressSteps) createConcurrentReq(domainsEnv, didNumsEnv, concurrencyEnv string) error {
domains := os.Getenv(domainsEnv)
if domains == "" {
return fmt.Errorf("domains is empty")
}

anchorOrigin := os.Getenv(anchorOriginEnv)
if domains == "" {
return fmt.Errorf("anchorOrigin is empty")
}

didNumsStr := os.Getenv(didNumsEnv)
if didNumsStr == "" {
return fmt.Errorf("did nums is empty")
Expand Down Expand Up @@ -136,16 +130,18 @@ func (e *StressSteps) createConcurrentReq(domainsEnv, didNumsEnv, anchorOriginEn
nextRecoveryPublicKey: make(map[string]crypto.PublicKey),
}

vdrs := make([]*orb.VDR, 0)
orbOpts := make([]orb.Option, 0)

for _, url := range urls {
vdr, err := orb.New(kr, orb.WithTLSConfig(&tls.Config{InsecureSkipVerify: true}),
orb.WithDomain(url), orb.WithAuthToken("ADMIN_TOKEN"))
if err != nil {
return err
}
orbOpts = append(orbOpts, orb.WithDomain(url))
}

orbOpts = append(orbOpts, orb.WithTLSConfig(&tls.Config{InsecureSkipVerify: true}),
orb.WithAuthToken("ADMIN_TOKEN"))

vdrs = append(vdrs, vdr)
vdr, err := orb.New(kr, orbOpts...)
if err != nil {
return err
}

verMethodsCreate := make([]*ariesdid.VerificationMethod, 0)
Expand Down Expand Up @@ -186,11 +182,8 @@ func (e *StressSteps) createConcurrentReq(domainsEnv, didNumsEnv, anchorOriginEn
createStart := time.Now()

for i := 0; i < didNums; i++ {
randomVDR := vdrs[mrand.Intn(len(urls))]

createPool.Submit(&createDIDReq{
vdr: randomVDR,
anchorOrigin: anchorOrigin,
vdr: vdr,
steps: e,
verMethodsCreate: verMethodsCreate,
})
Expand Down Expand Up @@ -268,7 +261,6 @@ func (e *StressSteps) createConcurrentReq(domainsEnv, didNumsEnv, anchorOriginEn

updatePool.Submit(&updateDIDReq{
vdr: r.vdr,
anchorOrigin: anchorOrigin,
steps: e,
canonicalID: r.canonicalID,
kr: kr,
Expand Down Expand Up @@ -398,7 +390,7 @@ func (e *StressSteps) createVerificationMethod(keyType string, pubKey []byte, ki
}

func (e *StressSteps) createDID(verMethodsCreate []*ariesdid.VerificationMethod,
origin, svcEndpoint string, vdr *orb.VDR) (crypto.PrivateKey,
svcEndpoint string, vdr *orb.VDR) (crypto.PrivateKey,
crypto.PrivateKey, string, error) {

recoveryKey, recoveryKeyPrivateKey, err := ed25519.GenerateKey(rand.Reader)
Expand All @@ -422,16 +414,15 @@ func (e *StressSteps) createDID(verMethodsCreate []*ariesdid.VerificationMethod,

createdDocResolution, err := vdr.Create(didDoc,
vdrapi.WithOption(orb.RecoveryPublicKeyOpt, recoveryKey),
vdrapi.WithOption(orb.UpdatePublicKeyOpt, updateKey),
vdrapi.WithOption(orb.AnchorOriginOpt, origin))
vdrapi.WithOption(orb.UpdatePublicKeyOpt, updateKey))
if err != nil {
return nil, nil, "", err
}

return recoveryKeyPrivateKey, updateKeyPrivateKey, createdDocResolution.DIDDocument.ID, nil
}

func (e *StressSteps) updateDID(didID string, origin, svcEndpoint string, vdr *orb.VDR,
func (e *StressSteps) updateDID(didID string, svcEndpoint string, vdr *orb.VDR,
verMethodsCreate []*ariesdid.VerificationMethod, verMethodsUpdate []*ariesdid.VerificationMethod) error {
didDoc := &ariesdid.Doc{ID: didID}

Expand All @@ -447,10 +438,7 @@ func (e *StressSteps) updateDID(didID string, origin, svcEndpoint string, vdr *o
ariesdid.Authentication))
}

err := vdr.Update(didDoc,
vdrapi.WithOption(orb.AnchorOriginOpt, origin))

return err
return vdr.Update(didDoc)
}

func (e *StressSteps) getPublicKey(keyType string) (string, []byte, error) { //nolint:gocritic
Expand Down Expand Up @@ -478,19 +466,20 @@ type keyRetrieverMap struct {
recoverKey map[string]crypto.PrivateKey
}

func (k *keyRetrieverMap) GetNextRecoveryPublicKey(didID string) (crypto.PublicKey, error) {
func (k *keyRetrieverMap) GetNextRecoveryPublicKey(didID string, commitment string) (crypto.PublicKey, error) {
k.RLock()
defer k.RUnlock()
return k.nextRecoveryPublicKey[didID], nil
}

func (k *keyRetrieverMap) GetNextUpdatePublicKey(didID string) (crypto.PublicKey, error) {
func (k *keyRetrieverMap) GetNextUpdatePublicKey(didID string, commitment string) (crypto.PublicKey, error) {
k.RLock()
defer k.RUnlock()
return k.nextUpdatePublicKey[didID], nil
}

func (k *keyRetrieverMap) GetSigningKey(didID string, ot orb.OperationType) (crypto.PrivateKey, error) {
func (k *keyRetrieverMap) GetSigningKey(didID string, ot orb.OperationType,
commitment string) (crypto.PrivateKey, error) {
k.RLock()
defer k.RUnlock()
if ot == orb.Update {
Expand Down Expand Up @@ -521,7 +510,6 @@ func (k *keyRetrieverMap) WriteNextUpdatePublicKey(didID string, key crypto.Publ
type createDIDReq struct {
vdr *orb.VDR
steps *StressSteps
anchorOrigin string
verMethodsCreate []*ariesdid.VerificationMethod
}

Expand All @@ -539,7 +527,7 @@ func (r *createDIDReq) Invoke() (interface{}, error) {

for i := 1; i <= 10; i++ {
recoveryKeyPrivateKey, updateKeyPrivateKey, intermID, err = r.steps.createDID(r.verMethodsCreate,
r.anchorOrigin, uuid.New().URN(), r.vdr)
uuid.New().URN(), r.vdr)
if err == nil {
break
}
Expand All @@ -562,7 +550,6 @@ type updateDIDReq struct {
canonicalID string
kr *keyRetrieverMap
steps *StressSteps
anchorOrigin string
verMethodsCreate []*ariesdid.VerificationMethod
verMethodsUpdate []*ariesdid.VerificationMethod
}
Expand All @@ -584,8 +571,7 @@ func (r *updateDIDReq) Invoke() (interface{}, error) {
svcEndpoint := uuid.New().URN()

for i := 1; i <= 10; i++ {
err := r.steps.updateDID(r.canonicalID, r.anchorOrigin, svcEndpoint, r.vdr,
r.verMethodsCreate, r.verMethodsUpdate)
err := r.steps.updateDID(r.canonicalID, svcEndpoint, r.vdr, r.verMethodsCreate, r.verMethodsUpdate)
if err == nil {
break
}
Expand Down

0 comments on commit 135c7eb

Please sign in to comment.