Skip to content

Consensus

Consensus RPC interface

Query the consensus node function

1. consensus_changeWaitTime

  • Usage:

  Modify the waiting time of the leader (ms)

  • Params:

   1. wait time (ms)

  • Return:

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"consensus_changeWaitTime","params":[100000], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 consensus_changeWaitTime 10000 3
  • Response:
{"jsonrpc":"2.0","id":3,"result":None}

2. consensus_getMiners

  • Usage:

  Gets the current mining node

  • Params:

   null

  • Return:mining nodes’s pub key

  • Example:

shell:

curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"consensus_getMiners","params":[""], "id": 3}' -H "Content-Type:application/json"

cli:

drep-cli 127.0.0.1:10085 consensus_getMiners 3
  • Response:
{"jsonrpc":"2.0","id":3,"result":["0x02c682c9f503465a27d1941d1a25547b5ea879a7145056283599a33869982513df", "0x036a09f9012cb3f73c11ceb2aae4242265c2aa35ebec20dbc28a78712802f457db"]}