예제 #1
0
파일: cli.py 프로젝트: ashcherbakov/sovrin
 def newNode(self, nodeName: str):
     config = getConfig()
     createGenesisTxnFile(self.genesisTransactions,
                          self.basedirpath,
                          config.domainTransactionsFile,
                          getTxnOrderedFields(),
                          reset=False)
     nodesAdded = super().newNode(nodeName)
     return nodesAdded
예제 #2
0
 def getPrimaryStorage(self):
     """
     This is usually an implementation of Ledger
     """
     if self.config.primaryStorage is None:
         fields = getTxnOrderedFields()
         return Ledger(CompactMerkleTree(hashStore=self.hashStore),
                       dataDir=self.dataLocation,
                       serializer=CompactSerializer(fields=fields),
                       fileName=self.config.domainTransactionsFile)
     else:
         return initStorage(self.config.primaryStorage,
                            name=self.name + NODE_PRIMARY_STORAGE_SUFFIX,
                            dataDir=self.dataLocation,
                            config=self.config)
예제 #3
0
def domainTxnOrderedFields():
    return getTxnOrderedFields()
예제 #4
0
 def txnFieldOrdering(self):
     fields = getTxnOrderedFields()
     return updateFieldsWithSeqNo(fields)
예제 #5
0
attrDefs = IssuerModule.AttribDef('BYU', attrTypes)
attributes = attrDefs.attribs(**rawAttributes)

dataDir = '/tmp/data'
if os.path.exists(dataDir):
    shutil.rmtree(dataDir)
tdir = tempfile.TemporaryDirectory().name

stewardWallet = _newWallet()
sponsorWallet = _newWallet()
issuerWallet = _newWallet()
proverWallet = _newWallet()
verifierWallet = _newWallet()

createGenesisTxnFile(genesisTxns(stewardWallet), tdir,
                     config.domainTransactionsFile, getTxnOrderedFields())

nodes = TestNodeSet(nodeReg=genNodeReg(count=4),
                    tmpdir=tdir,
                    primaryDecider=None)


def whitelistClient(nodes, *clientNames):
    for node in nodes:
        for nm in clientNames:
            node.whitelistClient(nm)


looper = Looper(nodes, autoStart=True)
for node in nodes:
    node.startKeySharing()