Consensus Transactions
Consensus Transactions
Command | Description |
---|---|
consensus [options] | create a consensus transaction and submit to the network |
approveConsensus [options] | approve a consensus transaction |
rejectConsensus [options] | reject a consensus transaction |
getConsensus [options] | show consensus transactions |
deleteConsensus [options] | delete a consensus transaction |
getConsensusRules [options] | list all the rules for approval of a consensus transaction |
setConsensusRules [options] | set a new rule for auto approval |
deleteConsensusRules [options] | delete a rule for auto approval |
A consensus transaction uses LedgerSwarm to achieve consensus on an arbitrary payload. The user submits a payload and any number of participants as either required, optional or observer and determines the threashholds for success. Each participant will receive the payload and will vote to either ACCEPT, REJECT or ABSTAIN from consensus.
The consensus transaction is similar to a normal ledgerswarm transaction but it is not routed to any settlement path, it is simply sent to the participants specified. This is because the payload can be anything including an encrypted or hashed message which the settlement domain cannot interpret as a settlement. Participants can, therefore, derive private transactions by encrypting transaction details.
ledgerswarm consensus
This following consensus transaction will send the payload to ANTBANK and BEEBANK and CENTRAL as an observer. It requires all participants to agree before it is finalised.
ledgerswarm getConsensus
ledgerswarm approveConsensus
ledgerswarm rejectConsensus
ledgerswarm getConsensusRules
Consensus rules automate the approval or rejection of consensus transactions. Rules are read in priority order (highest first) and each transaction in the manifest is submitted to the JEXL script in the Text
property. If, the JEXL script returns ACCEPT, the consensus transaction will be automatically approved. If it returns REJECT it will be automatically rejected. If it returns ABSTAIN, an ABSTAIN vote will be sent.
ledgerswarm setConsensusRules
ledgerswarm setConsensusRules -n autoReject -p 20 -t 'if ( correlationId !^ "REJECT" ) { return REJECT; }'
This will set up a rule to reject any consensus transaction where the correlationId starts with REJECT.
ledgerswarm deleteConsensusRules
This will delete the consensus rule with id 2.