DPoS Command

Please note that this documentation is only valid for LBTC FULL NODE.

LBTC use DPOS as consensus algorithm. user can use an address to take part in forging. user can generate block if his received voting number is in the first 101. For better user experience, the forging address must register a name on the mainnet to identify himself.

register

register a name on a address

Usage: bitcoin-cli register [-h] delegateAddress delegateName

Info: register "delegateName" on address "delegateAddress". Make sure you must have the privatekey of this address

Options (named):

-h [--help] Get a description and instructions for this command.

Arguments (positional):

delegateAddress the address used to forging and the name will bind with it.
delegateName the name binded with the address.

Result:
txid the transaction id.

Examples:
bitcoin-cli register "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "test-delegate"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "register", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "test-delegate"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

listdelegates

user can use “listdelegates” command to get all the registered name in the mainnet. so user can find them and vote or cancelvote them.

Usage: bitcoin-cli listdelegates [-h]

Info: list all the registered name in the mainnet.

Options (named):

-h [--help] Get a description and instructions for this command.

Result:

[
{
"name" The delegate names.
"address" The delegate addresses.
}
]

Examples:
bitcoin-cli listdelegates
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listdelegates", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

vote

vote for delegates with an address,each voting will cost 0.01 lbtc. lbtc address can only vote for 51 delegates and can not vote for those already voted with this address.

Usage: bitcoin-cli vote fromAddr delegateName1 deleagetNamen

Info: use "fromAddr" balance to vote for delegates, one address can only vote to 51 delegates at most.

Options (named):

-h [--help] Get a description and instructions for this command.

Result:
"txid" transaction id.

Examples:
bitcoin-cli vote "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "delegater1"
bitcoin-cli vote "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "delegater2" "delegater3"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "vote", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "delegater1"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

getdelegatevotes

get the number of votes the delegate received.

Usage: bitcoin-cli getdelegatevotes delegateName

Info: get all the vote balance the deleagetName received

Options (named):

-h [--help] Get a description and instructions for this command.

Arguments (positional):

delegateName the delegate name.

listreceivedvotes

list the all the addresses which vote the delegate

Usage: bitcoin-cli listreceivedvotes delegateName

Info: get the address list who vote to the deleagetName

Options (named):

-h [--help] Get a description and instructions for this command.

Arguments (positional):

delegateName the delegate name.

Result:
[
"address" The addresses which vote the delegate
]

Examples:
bitcoin-cli listreceivedvotes "test-delegate-name"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedvotes", "params": ["test-delegate-name"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

listvoteddelegates

list all the delegates voted by this address

Usage: bitcoin-cli listvoteddelegates voteAddress

Info: get the deleaget list the voteAddress voted to

Options (named):

-h [--help] Get a description and instructions for this command.

Arguments (positional):

voteAddress the address used to vote.

Result:
[
{
"name" The voted delegate name.
"delegate" The voted delegate address.
}
]

Examples:
bitcoin-cli listvoteddelegates "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listvoteddelegates", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

cancelvote

cancelvote delegates which voted by an address. The address can only cancelvote those delegates which voted by this address.

Usage: bitcoin-cli cancelvote fromAddress delegateName1 deleagetNameN

Info: cancel all the vote of "fromAddress" to "delegateName1 deleagetNameN"

Options (named):

-h [--help] Get a description and instructions for this command.

Arguments (positional):

fromAddress the address whose vote will be canceled.
delegateNameN the delegate name that the address voted

Result:
txid The transaction id.

Examples:
bitcoin-cli cancelvote "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "delegater1"
bitcoin-cli cancelvote "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "delegater2" "delegater3"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "cancelvote", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "delegater1"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

startforging

start forging on the lbtc address which have been registered as delegate and receivce enough votes and rank in the top 101.

Usage: bitcoin-cli startforging  delegateAddress

Info: start forging on the lbtc address which have been registered as delegate and receivce enough votes and rank in the top 101.

Options (named):

-h [--help] Get a description and instructions for this command.

Arguments (positional):

delegateAddress The delegate address.

Result:
result Forging sucess return "true", other return "false".

Examples:
bitcoin-cli startforging "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "startforging", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

stopforging

stop forging on the forging lbtc address

Usage: bitcoin-cli stopforging

Info: stop forging

Options (named):

-h [--help] Get a description and instructions for this command.

Arguments (positional):

delegateAddress The delegate address.

Result:
"result" (bool) Forging sucess return "true", other return "false".

Examples:
bitcoin-cli stopforging
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "stopforging", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/