from plenum.cli.command import Command sendNymCmd = Command( id="send NYM", title="Adds given identifier to sovrin", usage="send NYM dest=<target identifier> role=<role> [verkey=<ver-key>]", examples=[ "send NYM dest=BiCMHDqC5EjheFHumZX9nuAoVEp8xyuBgiRi5JcY5whi role=SPONSOR", "send NYM dest=33A18XMqWqTzDpLHXLR5nT verkey=~Fem61Q5SnYhGVVHByQNxHj" ]) sendGetNymCmd = Command(id="send GET_NYM", title="Get NYM from sovrin", usage="send GET_NYM dest=<target identifier>", examples="send GET_NYM dest=33A18XMqWqTzDpLHXLR5nT") sendAttribCmd = Command( id="send ATTRIB", title="Adds attributes to existing identifier", usage= "send ATTRIB dest=<target identifier> [raw={<json-data>}] [hash=<hashed-data>] [enc: <encrypted-data>]", examples= 'send ATTRIB dest=33A18XMqWqTzDpLHXLR5nT raw={"endpoint": "127.0.0.1:5555"}' ) sendNodeCmd = Command( id="send NODE", title="Adds a node to the pool", usage="send NODE dest=<target node identifier> data={<json-data>}", note= "Only Steward (must be already added on sovrin) can execute this command to add new node to the pool",
from plenum.cli.command import Command from sovrin_common.roles import Roles from sovrin_common.transactions import SovrinTransactions nymName = SovrinTransactions.NYM.name getNymName = SovrinTransactions.GET_NYM.name attribName = SovrinTransactions.ATTRIB.name nodeName = SovrinTransactions.NODE.name schemaName = SovrinTransactions.SCHEMA.name poolUpgradeName = SovrinTransactions.POOL_UPGRADE.name claimDefName = SovrinTransactions.CLAIM_DEF.name sendNymCmd = Command( id="send {nym}".format(nym=nymName), title="Adds given identifier to sovrin", usage="send {nym} dest=<target identifier> role=<role> [verkey=<ver-key>]".format(nym=nymName), examples=[ "send {nym} dest=BiCMHDqC5EjheFHumZX9nuAoVEp8xyuBgiRi5JcY5whi role={role}".format(nym=nymName, role=Roles.TRUST_ANCHOR.name), "send {nym} dest=33A18XMqWqTzDpLHXLR5nT verkey=~Fem61Q5SnYhGVVHByQNxHj".format(nym=nymName)]) sendGetNymCmd = Command( id="send {getNym}".format(getNym=getNymName), title="Get NYM from sovrin", usage="send {getNym} dest=<target identifier>".format(getNym=getNymName), examples="send {getNym} dest=33A18XMqWqTzDpLHXLR5nT".format(getNym=getNymName)) sendAttribCmd = Command( id="send {attrib}".format(attrib=attribName), title="Adds attributes to existing identifier", usage="send {attrib} dest=<target identifier> [raw={{<json-data>}}] [hash=<hashed-data>] [enc: <encrypted-data>]".format( attrib=attribName),