Skip to content

Clean up RPC help messages #1865

@gavinandresen

Description

@gavinandresen

The first line of RPC help messages follow the syntax:

method [optionalparam] [optionalparam]

That doesn't work nicely now that we have parameters that are JSON objects or arrays.

I propose that the syntax be changed to:

method requiredparam requiredparam ( optionalparam optionalparam )

... that string-type parameters by reported in double-quotes, number-type parameters left as-is, Arrays be reported as [foo,...] and Objects as {"foo":bar}

... and that default values be specified in the description, not using the (confusing) foo=3 syntax.

Examples of help using old and new schemes:

verifymessage <bitcoinaddress> <signature> <message>
verifymessage "bitcoinaddress" "signature" "message"

getreceivedbyaddress <bitcoinaddress> [minconf=1]
getreceivedbyaddress "bitcoinaddress" ( minconf )

sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]
sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )

listunspent [minconf=1] [maxconf=9999999]  ["address",...]
listunspent ( minconf maxconf  ["address",...] )

signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] [sighashtype="ALL"]
signrawtransaction "hex string" ( [{"txid":txid,"vout":n,"scriptPubKey":hex},...] ["privatekey1",...] "sighashtype" )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions