Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test network did #261

Merged
merged 7 commits into from
Jul 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions plenum/common/test_network_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from plenum.common.keygen_utils import initLocalKeys
from plenum.common.constants import STEWARD, CLIENT_STACK_SUFFIX, TRUSTEE
from plenum.common.util import hexToFriendly
from plenum.common.signer_did import DidSigner
from stp_core.common.util import adict


Expand Down Expand Up @@ -71,11 +72,11 @@ def bootstrapTestNodesCore(cls, config, envName, appendToLedgers,
domainLedger = cls.init_domain_ledger(appendToLedgers, baseDir, config,
envName, domainTxnFieldOrder)

trustee_txn = Member.nym_txn(trustee_def.nym, trustee_def.name, role=TRUSTEE)
trustee_txn = Member.nym_txn(trustee_def.nym, trustee_def.name, verkey=trustee_def.verkey, role=TRUSTEE)
domainLedger.add(trustee_txn)

for sd in steward_defs:
nym_txn = Member.nym_txn(sd.nym, sd.name, role=STEWARD,
nym_txn = Member.nym_txn(sd.nym, sd.name, verkey=sd.verkey, role=STEWARD,
creator=trustee_def.nym)
domainLedger.add(nym_txn)

Expand Down Expand Up @@ -108,7 +109,7 @@ def bootstrapTestNodesCore(cls, config, envName, appendToLedgers,
poolLedger.add(node_txn)

for cd in client_defs:
txn = Member.nym_txn(cd.nym, cd.name, creator=trustee_def.nym)
txn = Member.nym_txn(cd.nym, cd.name, verkey=cd.verkey, creator=trustee_def.nym)
domainLedger.add(txn)

poolLedger.stop()
Expand Down Expand Up @@ -258,9 +259,10 @@ def gen_defs(cls, ips, nodeCount, starting_port):
for i in range(1, nodeCount + 1):
d = adict()
d.name = "Steward" + str(i)
s_sigseed = cls.getSigningSeed(d.name)
s_verkey = Signer(s_sigseed).verhex
d.nym = cls.getNymFromVerkey(s_verkey)
d.sigseed = cls.getSigningSeed(d.name)
s_signer = DidSigner(seed=d.sigseed)
d.nym = s_signer.identifier
d.verkey = s_signer.verkey
steward_defs.append(d)

name = "Node" + str(i)
Expand All @@ -281,8 +283,9 @@ def gen_client_def(cls, idx):
d = adict()
d.name = "Client" + str(idx)
d.sigseed = cls.getSigningSeed(d.name)
d.verkey = Signer(d.sigseed).verhex
d.nym = cls.getNymFromVerkey(d.verkey)
c_signer = DidSigner(seed=d.sigseed)
d.nym = c_signer.identifier
d.verkey = c_signer.verkey
return d

@classmethod
Expand All @@ -294,8 +297,9 @@ def gen_trustee_def(cls, idx):
d = adict()
d.name = 'Trustee' + str(idx)
d.sigseed = cls.getSigningSeed(d.name)
d.verkey = Signer(d.sigseed).verhex
d.nym = cls.getNymFromVerkey(d.verkey)
t_signer = DidSigner(seed=d.sigseed)
d.nym = t_signer.identifier
d.verkey = t_signer.verkey
return d


Expand Down