rpcserverhelp.go 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933
  1. // Copyright (c) 2015-2017 The btcsuite developers
  2. // Copyright (c) 2015-2017 The Decred developers
  3. // Copyright (c) 2019 Caleb James DeLisle
  4. // Use of this source code is governed by an ISC
  5. // license that can be found in the LICENSE file.
  6. package main
  7. import (
  8. "sort"
  9. "strings"
  10. "sync"
  11. "github.com/pkt-cash/pktd/btcutil/er"
  12. "github.com/pkt-cash/pktd/btcjson"
  13. )
  14. // helpDescsEnUS defines the English descriptions used for the help strings.
  15. var helpDescsEnUS = map[string]string{
  16. // CheckPcAnnCmd help.
  17. "checkpcann--synopsis": "Validate a single PacketCrypt announcement",
  18. "checkpcann-parenthash": "The hash of the most recent block when this announcement was mined, if nil then pktd will use the current chain",
  19. "checkpcann-pcversion": "The version of PacketCrypt to consider for this announcement",
  20. "checkpcann-annhex": "The announcement body as hex",
  21. "checkpcannresult-workhash": "The result hash from validating the announcement, this is used to assess difficulty",
  22. // DebugLevelCmd help.
  23. "debuglevel--synopsis": "Dynamically changes the debug logging level.\n" +
  24. "The levelspec can either a debug level or of the form:\n" +
  25. "<subsystem>=<level>,<subsystem2>=<level2>,...\n" +
  26. "The valid debug levels are trace, debug, info, warn, error, and critical.\n" +
  27. "The valid subsystems are AMGR, ADXR, PKDB, BMGR, BTCD, CHAN, DISC, PEER, RPCS, SCRP, SRVR, and TXMP.\n" +
  28. "Finally the keyword 'show' will return a list of the available subsystems.",
  29. "debuglevel-levelspec": "The debug level(s) to use or the keyword 'show'",
  30. "debuglevel--condition0": "levelspec!=show",
  31. "debuglevel--condition1": "levelspec=show",
  32. "debuglevel--result0": "The string 'Done.'",
  33. "debuglevel--result1": "The list of subsystems",
  34. // AddNodeCmd help.
  35. "addnode--synopsis": "Attempts to add or remove a persistent peer.",
  36. "addnode-addr": "IP address and port of the peer to operate on",
  37. "addnode-subcmd": "'add' to add a persistent peer, 'remove' to remove a persistent peer, or 'onetry' to try a single connection to a peer",
  38. // NodeCmd help.
  39. "node--synopsis": "Attempts to add or remove a peer.",
  40. "node-subcmd": "'disconnect' to remove all matching non-persistent peers, 'remove' to remove a persistent peer, or 'connect' to connect to a peer",
  41. "node-target": "Either the IP address and port of the peer to operate on, or a valid peer ID.",
  42. "node-connectsubcmd": "'perm' to make the connected peer a permanent one, 'temp' to try a single connect to a peer",
  43. // TransactionInput help.
  44. "transactioninput-txid": "The hash of the input transaction",
  45. "transactioninput-vout": "The specific output of the input transaction to redeem",
  46. // CreateRawTransactionCmd help.
  47. "createrawtransaction--synopsis": "Returns a new transaction spending the provided inputs and sending to the provided addresses.\n" +
  48. "The transaction inputs are not signed in the created transaction.\n" +
  49. "The signrawtransaction RPC command provided by wallet must be used to sign the resulting transaction.",
  50. "createrawtransaction-inputs": "The inputs to the transaction",
  51. "createrawtransaction-amounts": "JSON object with the destination addresses as keys and amounts as values",
  52. "createrawtransaction-amounts--key": "address",
  53. "createrawtransaction-amounts--value": "n.nnn",
  54. "createrawtransaction-amounts--desc": "The destination address as the key and the amount in BTC as the value",
  55. "createrawtransaction-locktime": "Locktime value; a non-zero value will also locktime-activate the inputs",
  56. "createrawtransaction--result0": "Hex-encoded bytes of the serialized transaction",
  57. // ScriptSig help.
  58. "scriptsig-asm": "Disassembly of the script",
  59. "scriptsig-hex": "Hex-encoded bytes of the script",
  60. // PrevOut help.
  61. "prevout-scriptPubKey": "The decoded script and addresses which were paid to",
  62. "prevout-value": "previous output value",
  63. "prevout-svalue": "previous output value in atomic units, string containing base 10 number",
  64. "prevout-address": "The address which this transaction is spending from",
  65. // VinPrevOut help.
  66. "vinprevout-coinbase": "The hex-encoded bytes of the signature script (coinbase txns only)",
  67. "vinprevout-txid": "The hash of the origin transaction (non-coinbase txns only)",
  68. "vinprevout-vout": "The index of the output being redeemed from the origin transaction (non-coinbase txns only)",
  69. "vinprevout-scriptSig": "The signature script used to redeem the origin transaction as a JSON object (non-coinbase txns only)",
  70. "vinprevout-txinwitness": "The witness stack of the passed input, encoded as a JSON string array",
  71. "vinprevout-prevOut": "Data from the origin transaction output with index vout.",
  72. "vinprevout-sequence": "The script sequence number",
  73. // Vin help.
  74. "vin-coinbase": "The hex-encoded bytes of the signature script (coinbase txns only)",
  75. "vin-txid": "The hash of the origin transaction (non-coinbase txns only)",
  76. "vin-vout": "The index of the output being redeemed from the origin transaction (non-coinbase txns only)",
  77. "vin-scriptSig": "The signature script used to redeem the origin transaction as a JSON object (non-coinbase txns only)",
  78. "vin-txinwitness": "The witness used to redeem the input encoded as a string array of its items",
  79. "vin-sequence": "The script sequence number",
  80. "vote-for": "The network steward which this payment is voting for",
  81. "vote-against": "The network steward address which this payment is voting against",
  82. // Vout help.
  83. "vout-value": "The amount in coins",
  84. "vout-svalue": "previous output value in atomic units, string containing base 10 number",
  85. "vout-n": "The index of this transaction output",
  86. "vout-address": "The address paid to",
  87. "vout-vote": "A vote on network steward, if any exists",
  88. "vout-scriptPubKey": "The public key script used to pay coins as a JSON object",
  89. // TxRawDecodeResult help.
  90. "txrawdecoderesult-txid": "The hash of the transaction",
  91. "txrawdecoderesult-version": "The transaction version",
  92. "txrawdecoderesult-locktime": "The transaction lock time",
  93. "txrawdecoderesult-vin": "The transaction inputs as JSON objects",
  94. "txrawdecoderesult-vout": "The transaction outputs as JSON objects",
  95. "txrawdecoderesult-vsize": "The virtual size of the transaction, offering a discount for segwit data",
  96. "txrawdecoderesult-size": "The full size of the transaction, including segwit data",
  97. "txrawdecoderesult-sfee": "Number of atomic units of fees, base 10 string",
  98. // DecodeRawTransactionCmd help.
  99. "decoderawtransaction--synopsis": "Returns a JSON object representing the provided serialized, hex-encoded transaction.",
  100. "decoderawtransaction-hextx": "Serialized, hex-encoded transaction",
  101. "decoderawtransaction-vinextra": "Include extra information about inputs to transaction, uses the blockchain to check amounts and addresses which were paid to.",
  102. // DecodeScriptResult help.
  103. "decodescriptresult-asm": "Disassembly of the script",
  104. "decodescriptresult-reqSigs": "The number of required signatures",
  105. "decodescriptresult-type": "The type of the script (e.g. 'pubkeyhash')",
  106. "decodescriptresult-addresses": "The bitcoin addresses associated with this script",
  107. "decodescriptresult-p2sh": "The script hash for use in pay-to-script-hash transactions (only present if the provided redeem script is not already a pay-to-script-hash script)",
  108. "decodescriptresult-vote": "An optional vote structure which shows whether the script contains a vote for and/or against a network steward",
  109. // DecodeScriptCmd help.
  110. "decodescript--synopsis": "Returns a JSON object with information about the provided hex-encoded script.",
  111. "decodescript-hexscript": "Hex-encoded script",
  112. // EstimateFeeCmd help.
  113. "estimatefee--synopsis": "Estimate the fee per kilobyte in satoshis " +
  114. "required for a transaction to be mined before a certain number of " +
  115. "blocks have been generated.",
  116. "estimatefee-numblocks": "The maximum number of blocks which can be " +
  117. "generated before the transaction is mined.",
  118. "estimatefee--result0": "Estimated fee per kilobyte in satoshis for a block to " +
  119. "be mined in the next NumBlocks blocks.",
  120. "estimatesmartfee--synopsis": "Better estimatefee, currently implemented using estimatefee",
  121. "estimatesmartfee-estimatemode": "ECONOMICAL or CONSERVATIVE to decide how to estimate fee rate",
  122. "estimatesmartfee-conftarget": "Target number of blocks until transaction confirms",
  123. "estimatesmartfeeresult-feerate": "Fee in coins per kilobyte",
  124. "estimatesmartfeeresult-errors": "Array of string errors which may have occurred while processing",
  125. "estimatesmartfeeresult-blocks": "Exists for API compatibility, always zero",
  126. "getnetworkinfo--synopsis": "Get info about the crypto network",
  127. "getnetworkinforesult-version": "App version",
  128. "getnetworkinforesult-subversion": "App user-agent string",
  129. "getnetworkinforesult-protocolversion": "Protocol version",
  130. "getnetworkinforesult-localservices": "Service flag bits as hex string",
  131. "getnetworkinforesult-localservicesnames": "Service flags stringified",
  132. "getnetworkinforesult-localrelay": "True if this node is willing to relay transactions",
  133. "getnetworkinforesult-timeoffset": "How much we have adjusted our clock to agree with the network",
  134. "getnetworkinforesult-connections": "Number of peer connections",
  135. "getnetworkinforesult-networkactive": "True if we are listening for incoming connections",
  136. "getnetworkinforesult-networks": "TODO Always empty for now",
  137. "getnetworkinforesult-relayfee": "Lowest transaction fee that is allowed for relaying",
  138. "getnetworkinforesult-incrementalfee": "Minimum fee increment for BIP 125 replacement",
  139. "getnetworkinforesult-localaddresses": "TODO Always empty for now",
  140. "getnetworkinfonetworks-reachable": "If the network is externally reachable",
  141. "getnetworkinfonetworks-limited": "True if this is the only allowed network",
  142. "getnetworkinfonetworks-name": "IPv4 / IPv6",
  143. // GenerateCmd help
  144. "generate--synopsis": "Generates a set number of blocks (simnet or regtest only) and returns a JSON\n" +
  145. " array of their hashes.",
  146. "generate-numblocks": "Number of blocks to generate",
  147. "generate--result0": "The hashes, in order, of blocks generated by the call",
  148. // GetAddedNodeInfoResultAddr help.
  149. "getaddednodeinforesultaddr-address": "The ip address for this DNS entry",
  150. "getaddednodeinforesultaddr-connected": "The connection 'direction' (inbound/outbound/false)",
  151. // GetAddedNodeInfoResult help.
  152. "getaddednodeinforesult-addednode": "The ip address or domain of the added peer",
  153. "getaddednodeinforesult-connected": "Whether or not the peer is currently connected",
  154. "getaddednodeinforesult-addresses": "DNS lookup and connection information about the peer",
  155. // GetAddedNodeInfo help.
  156. "getaddednodeinfo--synopsis": "Returns information about manually added (persistent) peers.",
  157. "getaddednodeinfo-dns": "Specifies whether the returned data is a JSON object including DNS and connection information, or just a list of added peers",
  158. "getaddednodeinfo-node": "Only return information about this specific peer instead of all added peers",
  159. "getaddednodeinfo--condition0": "dns=false",
  160. "getaddednodeinfo--condition1": "dns=true",
  161. "getaddednodeinfo--result0": "List of added peers",
  162. // GetBestBlockResult help.
  163. "getbestblockresult-hash": "Hex-encoded bytes of the best block hash",
  164. "getbestblockresult-height": "Height of the best block",
  165. // GetBestBlockCmd help.
  166. "getbestblock--synopsis": "Get block height and hash of best block in the main chain.",
  167. "getbestblock--result0": "Get block height and hash of best block in the main chain.",
  168. // GetBestBlockHashCmd help.
  169. "getbestblockhash--synopsis": "Returns the hash of the of the best (most recent) block in the longest block chain.",
  170. "getbestblockhash--result0": "The hex-encoded block hash",
  171. // GetBlockCmd help.
  172. "getblock--synopsis": "Returns information about a block given its hash.",
  173. "getblock-hash": "The hash of the block",
  174. "getblock-verbose": "Specifies the block is returned as a JSON object instead of hex-encoded string",
  175. "getblock-verbosetx": "Specifies that each transaction is returned as a JSON object and only applies if the verbose flag is true (pktd extension)",
  176. "getblock--condition0": "verbose=false",
  177. "getblock--condition1": "verbose=true",
  178. "getblock-verbosepcp": "If true then the hex content of the PacketCrypt proof will also be included",
  179. "getblock--result0": "Hex-encoded bytes of the serialized block",
  180. // GetBlockChainInfoCmd help.
  181. "getblockchaininfo--synopsis": "Returns information about the current blockchain state and the status of any active soft-fork deployments.",
  182. // GetBlockChainInfoResult help.
  183. "getblockchaininforesult-chain": "The name of the chain the daemon is on (testnet, mainnet, etc)",
  184. "getblockchaininforesult-blocks": "The number of blocks in the best known chain",
  185. "getblockchaininforesult-headers": "The number of headers that we've gathered for in the best known chain",
  186. "getblockchaininforesult-bestblockhash": "The block hash for the latest block in the main chain",
  187. "getblockchaininforesult-initialblockdownload": "Are we syncing the chain",
  188. "getblockchaininforesult-difficulty": "The current chain difficulty",
  189. "getblockchaininforesult-mediantime": "The median time from the PoV of the best block in the chain",
  190. "getblockchaininforesult-verificationprogress": "An estimate for how much of the best chain we've verified",
  191. "getblockchaininforesult-pruned": "A bool that indicates if the node is pruned or not",
  192. "getblockchaininforesult-pruneheight": "The lowest block retained in the current pruned chain",
  193. "getblockchaininforesult-chainwork": "The total cumulative work in the best chain",
  194. "getblockchaininforesult-softforks": "The status of the super-majority soft-forks",
  195. "getblockchaininforesult-bip9_softforks": "JSON object describing active BIP0009 deployments",
  196. "getblockchaininforesult-bip9_softforks--key": "bip9_softforks",
  197. "getblockchaininforesult-bip9_softforks--value": "An object describing a particular BIP009 deployment",
  198. "getblockchaininforesult-bip9_softforks--desc": "The status of any defined BIP0009 soft-fork deployments",
  199. // SoftForkDescription help.
  200. "softforkdescription-reject": "The current activation status of the softfork",
  201. "softforkdescription-version": "The block version that signals enforcement of this softfork",
  202. "softforkdescription-id": "The string identifier for the soft fork",
  203. "-status": "A bool which indicates if the soft fork is active",
  204. // TxRawResult help.
  205. "txrawresult-hex": "Hex-encoded transaction",
  206. "txrawresult-txid": "The hash of the transaction",
  207. "txrawresult-version": "The transaction version",
  208. "txrawresult-locktime": "The transaction lock time",
  209. "txrawresult-vin": "The transaction inputs as JSON objects",
  210. "txrawresult-vout": "The transaction outputs as JSON objects",
  211. "txrawresult-blockhash": "Hash of the block the transaction is part of",
  212. "txrawresult-confirmations": "Number of confirmations of the block",
  213. "txrawresult-time": "Transaction time in seconds since 1 Jan 1970 GMT",
  214. "txrawresult-blocktime": "Block time in seconds since the 1 Jan 1970 GMT",
  215. "txrawresult-size": "The size of the transaction in bytes",
  216. "txrawresult-vsize": "The virtual size of the transaction in bytes",
  217. "txrawresult-hash": "The wtxid of the transaction",
  218. // SearchRawTransactionsResult help.
  219. "searchrawtransactionsresult-hex": "Hex-encoded transaction",
  220. "searchrawtransactionsresult-txid": "The hash of the transaction",
  221. "searchrawtransactionsresult-hash": "The wxtid of the transaction",
  222. "searchrawtransactionsresult-version": "The transaction version",
  223. "searchrawtransactionsresult-locktime": "The transaction lock time",
  224. "searchrawtransactionsresult-vin": "The transaction inputs as JSON objects",
  225. "searchrawtransactionsresult-vout": "The transaction outputs as JSON objects",
  226. "searchrawtransactionsresult-blockhash": "Hash of the block the transaction is part of",
  227. "searchrawtransactionsresult-confirmations": "Number of confirmations of the block",
  228. "searchrawtransactionsresult-time": "Transaction time in seconds since 1 Jan 1970 GMT",
  229. "searchrawtransactionsresult-blocktime": "Block time in seconds since the 1 Jan 1970 GMT",
  230. "searchrawtransactionsresult-size": "The size of the transaction in bytes",
  231. "searchrawtransactionsresult-vsize": "The virtual size of the transaction in bytes",
  232. // GetBlockVerboseResult help.
  233. "getblockverboseresult-hash": "The hash of the block (same as provided)",
  234. "getblockverboseresult-confirmations": "The number of confirmations",
  235. "getblockverboseresult-size": "The size of the block",
  236. "getblockverboseresult-height": "The height of the block in the block chain",
  237. "getblockverboseresult-version": "The block version",
  238. "getblockverboseresult-versionHex": "The block version in hexadecimal",
  239. "getblockverboseresult-merkleroot": "Root hash of the merkle tree",
  240. "getblockverboseresult-tx": "The transaction hashes (only when verbosetx=false)",
  241. "getblockverboseresult-rawtx": "The transactions as JSON objects (only when verbosetx=true)",
  242. "getblockverboseresult-time": "The block time in seconds since 1 Jan 1970 GMT",
  243. "getblockverboseresult-nonce": "The block nonce",
  244. "getblockverboseresult-bits": "The bits which represent the block difficulty",
  245. "getblockverboseresult-difficulty": "The proof-of-work difficulty as a multiple of the minimum difficulty",
  246. "getblockverboseresult-previousblockhash": "The hash of the previous block",
  247. "getblockverboseresult-nextblockhash": "The hash of the next block (only if there is one)",
  248. "getblockverboseresult-strippedsize": "The size of the block without witness data",
  249. "getblockverboseresult-weight": "The weight of the block",
  250. "getblockverboseresult-packetcryptproof": "The hex content of the PacketCrypt proof for this block",
  251. "getblockverboseresult-packetcryptblkdifficulty": "The estimated number of encryptions needed by the block miner",
  252. "getblockverboseresult-packetcryptanndifficulty": "The estimated number of encryptions needed for each announcement",
  253. "getblockverboseresult-packetcryptannbits": "The bits which represent minimum announcement difficulty",
  254. "getblockverboseresult-packetcryptanncount": "The number of announcements which the winning miner was using",
  255. "getblockverboseresult-packetcryptversion": "The version of the PacketCrypt proof",
  256. "getblockverboseresult-packetcryptblkbits": "The bits which represent effective block difficulty (what the block miner must meet)",
  257. "getblockverboseresult-sblockreward": "The amount of atomic units of coins in this block height block reward",
  258. "getblockverboseresult-networksteward": "The address of the current network steward, if using the PKT chain or one which has one",
  259. "getblockverboseresult-blocksuntilretarget": "The number of blocks until the next difficulty retarget",
  260. "getblockverboseresult-retargetestimate": "A number which multiplied by the current difficulty gives the extimated next difficulty",
  261. // GetBlockCountCmd help.
  262. "getblockcount--synopsis": "Returns the number of blocks in the longest block chain.",
  263. "getblockcount--result0": "The current block count",
  264. // GetBlockHashCmd help.
  265. "getblockhash--synopsis": "Returns hash of the block in best block chain at the given height.",
  266. "getblockhash-index": "The block height",
  267. "getblockhash--result0": "The block hash",
  268. // GetBlockHeaderCmd help.
  269. "getblockheader--synopsis": "Returns information about a block header given its hash.",
  270. "getblockheader-hash": "The hash of the block",
  271. "getblockheader-verbose": "Specifies the block header is returned as a JSON object instead of hex-encoded string",
  272. "getblockheader--condition0": "verbose=false",
  273. "getblockheader--condition1": "verbose=true",
  274. "getblockheader--result0": "The block header hash",
  275. // GetBlockHeaderVerboseResult help.
  276. "getblockheaderverboseresult-hash": "The hash of the block (same as provided)",
  277. "getblockheaderverboseresult-confirmations": "The number of confirmations",
  278. "getblockheaderverboseresult-height": "The height of the block in the block chain",
  279. "getblockheaderverboseresult-version": "The block version",
  280. "getblockheaderverboseresult-versionHex": "The block version in hexadecimal",
  281. "getblockheaderverboseresult-merkleroot": "Root hash of the merkle tree",
  282. "getblockheaderverboseresult-time": "The block time in seconds since 1 Jan 1970 GMT",
  283. "getblockheaderverboseresult-nonce": "The block nonce",
  284. "getblockheaderverboseresult-bits": "The bits which represent the block difficulty",
  285. "getblockheaderverboseresult-difficulty": "The proof-of-work difficulty as a multiple of the minimum difficulty",
  286. "getblockheaderverboseresult-previousblockhash": "The hash of the previous block",
  287. "getblockheaderverboseresult-nextblockhash": "The hash of the next block (only if there is one)",
  288. // TemplateRequest help.
  289. "templaterequest-mode": "This is 'template', 'proposal', or omitted",
  290. "templaterequest-capabilities": "List of capabilities",
  291. "templaterequest-longpollid": "The long poll ID of a job to monitor for expiration; required and valid only for long poll requests ",
  292. "templaterequest-sigoplimit": "Number of signature operations allowed in blocks (this parameter is ignored)",
  293. "templaterequest-sizelimit": "Number of bytes allowed in blocks (this parameter is ignored)",
  294. "templaterequest-maxversion": "Highest supported block version number (this parameter is ignored)",
  295. "templaterequest-target": "The desired target for the block template (this parameter is ignored)",
  296. "templaterequest-data": "Hex-encoded block data (only for mode=proposal)",
  297. "templaterequest-workid": "The server provided workid if provided in block template (not applicable)",
  298. // GetBlockTemplateResultTx help.
  299. "getblocktemplateresulttx-data": "Hex-encoded transaction data (byte-for-byte)",
  300. "getblocktemplateresulttx-hash": "Hex-encoded transaction hash (little endian if treated as a 256-bit number)",
  301. "getblocktemplateresulttx-depends": "Other transactions before this one (by 1-based index in the 'transactions' list) that must be present in the final block if this one is",
  302. "getblocktemplateresulttx-fee": "Difference in value between transaction inputs and outputs (in Satoshi)",
  303. "getblocktemplateresulttx-sigops": "Total number of signature operations as counted for purposes of block limits",
  304. "getblocktemplateresulttx-weight": "The weight of the transaction",
  305. // GetBlockTemplateResultAux help.
  306. "getblocktemplateresultaux-flags": "Hex-encoded byte-for-byte data to include in the coinbase signature script",
  307. // GetBlockTemplateResult help.
  308. "getblocktemplateresult-bits": "Hex-encoded compressed difficulty",
  309. "getblocktemplateresult-curtime": "Current time as seen by the server (recommended for block time); must fall within mintime/maxtime rules",
  310. "getblocktemplateresult-height": "Height of the block to be solved",
  311. "getblocktemplateresult-previousblockhash": "Hex-encoded big-endian hash of the previous block",
  312. "getblocktemplateresult-sigoplimit": "Number of sigops allowed in blocks ",
  313. "getblocktemplateresult-sizelimit": "Number of bytes allowed in blocks",
  314. "getblocktemplateresult-transactions": "Array of transactions as JSON objects",
  315. "getblocktemplateresult-version": "The block version",
  316. "getblocktemplateresult-coinbaseaux": "Data that should be included in the coinbase signature script",
  317. "getblocktemplateresult-coinbasetxn": "Information about the coinbase transaction",
  318. "getblocktemplateresult-coinbasevalue": "Total amount available for the coinbase in Satoshi",
  319. "getblocktemplateresult-workid": "This value must be returned with result if provided (not provided)",
  320. "getblocktemplateresult-longpollid": "Identifier for long poll request which allows monitoring for expiration",
  321. "getblocktemplateresult-longpolluri": "An alternate URI to use for long poll requests if provided (not provided)",
  322. "getblocktemplateresult-submitold": "Not applicable",
  323. "getblocktemplateresult-target": "Hex-encoded big-endian number which valid results must be less than",
  324. "getblocktemplateresult-expires": "Maximum number of seconds (starting from when the server sent the response) this work is valid for",
  325. "getblocktemplateresult-maxtime": "Maximum allowed time",
  326. "getblocktemplateresult-mintime": "Minimum allowed time",
  327. "getblocktemplateresult-mutable": "List of mutations the server explicitly allows",
  328. "getblocktemplateresult-noncerange": "Two concatenated hex-encoded big-endian 32-bit integers which represent the valid ranges of nonces the miner may scan",
  329. "getblocktemplateresult-capabilities": "List of server capabilities including 'proposal' to indicate support for block proposals",
  330. "getblocktemplateresult-reject-reason": "Reason the proposal was invalid as-is (only applies to proposal responses)",
  331. "getblocktemplateresult-default_witness_commitment": "The witness commitment itself. Will be populated if the block has witness data",
  332. "getblocktemplateresult-weightlimit": "The current limit on the max allowed weight of a block",
  333. // GetBlockTemplateCmd help.
  334. "getblocktemplate--synopsis": "Returns a JSON object with information necessary to construct a block to mine or accepts a proposal to validate.\n" +
  335. "See BIP0022 and BIP0023 for the full specification.",
  336. "getblocktemplate-request": "Request object which controls the mode and several parameters",
  337. "getblocktemplate--condition0": "mode=template",
  338. "getblocktemplate--condition1": "mode=proposal, rejected",
  339. "getblocktemplate--condition2": "mode=proposal, accepted",
  340. "getblocktemplate--result1": "An error string which represents why the proposal was rejected or nothing if accepted",
  341. // GetCFilterCmd help.
  342. "getcfilter--synopsis": "Returns a block's committed filter given its hash.",
  343. "getcfilter-filtertype": "The type of filter to return (0=regular)",
  344. "getcfilter-hash": "The hash of the block",
  345. "getcfilter--result0": "The block's committed filter",
  346. // GetCFilterHeaderCmd help.
  347. "getcfilterheader--synopsis": "Returns a block's compact filter header given its hash.",
  348. "getcfilterheader-filtertype": "The type of filter header to return (0=regular)",
  349. "getcfilterheader-hash": "The hash of the block",
  350. "getcfilterheader--result0": "The block's gcs filter header",
  351. // GetConnectionCountCmd help.
  352. "getconnectioncount--synopsis": "Returns the number of active connections to other peers.",
  353. "getconnectioncount--result0": "The number of connections",
  354. // GetCurrentNetCmd help.
  355. "getcurrentnet--synopsis": "Get bitcoin network the server is running on.",
  356. "getcurrentnet--result0": "The network identifer",
  357. // GetDifficultyCmd help.
  358. "getdifficulty--synopsis": "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.",
  359. "getdifficulty--result0": "The difficulty",
  360. // GetGenerateCmd help.
  361. "getgenerate--synopsis": "Returns if the server is set to generate coins (mine) or not.",
  362. "getgenerate--result0": "True if mining, false if not",
  363. // GetHashesPerSecCmd help.
  364. "gethashespersec--synopsis": "Returns a recent hashes per second performance measurement while generating coins (mining).",
  365. "gethashespersec--result0": "The number of hashes per second",
  366. // InfoChainResult help.
  367. "infochainresult-version": "The version of the server",
  368. "infochainresult-protocolversion": "The latest supported protocol version",
  369. "infochainresult-blocks": "The number of blocks processed",
  370. "infochainresult-timeoffset": "The time offset",
  371. "infochainresult-connections": "The number of connected peers",
  372. "infochainresult-difficulty": "The current target difficulty",
  373. "infochainresult-testnet": "Whether or not server is using testnet",
  374. "infochainresult-relayfee": "The minimum relay fee for non-free transactions in BTC/KB",
  375. "infochainresult-errors": "Any current errors",
  376. // InfoWalletResult help.
  377. "infowalletresult-version": "The version of the server",
  378. "infowalletresult-protocolversion": "The latest supported protocol version",
  379. "infowalletresult-walletversion": "The version of the wallet server",
  380. "infowalletresult-balance": "The total bitcoin balance of the wallet",
  381. "infowalletresult-blocks": "The number of blocks processed",
  382. "infowalletresult-timeoffset": "The time offset",
  383. "infowalletresult-connections": "The number of connected peers",
  384. "infowalletresult-difficulty": "The current target difficulty",
  385. "infowalletresult-testnet": "Whether or not server is using testnet",
  386. "infowalletresult-keypoololdest": "Seconds since 1 Jan 1970 GMT of the oldest pre-generated key in the key pool",
  387. "infowalletresult-keypoolsize": "The number of new keys that are pre-generated",
  388. "infowalletresult-unlocked_until": "The timestamp in seconds since 1 Jan 1970 GMT that the wallet is unlocked for transfers, or 0 if the wallet is locked",
  389. "infowalletresult-paytxfee": "The transaction fee set in BTC/KB",
  390. "infowalletresult-relayfee": "The minimum relay fee for non-free transactions in BTC/KB",
  391. "infowalletresult-errors": "Any current errors",
  392. // GetHeadersCmd help.
  393. "getheaders--synopsis": "Returns block headers starting with the first known block hash from the request",
  394. "getheaders-blocklocators": "JSON array of hex-encoded hashes of blocks. Headers are returned starting from the first known hash in this list",
  395. "getheaders-hashstop": "Block hash to stop including block headers for; if not found, all headers to the latest known block are returned.",
  396. "getheaders--result0": "Serialized block headers of all located blocks, limited to some arbitrary maximum number of hashes (currently 2000, which matches the wire protocol headers message, but this is not guaranteed)",
  397. // GetInfoCmd help.
  398. "getinfo--synopsis": "Returns a JSON object containing various state info.",
  399. // GetMempoolInfoCmd help.
  400. "getmempoolinfo--synopsis": "Returns memory pool information",
  401. // GetMempoolInfoResult help.
  402. "getmempoolinforesult-bytes": "Size in bytes of the mempool",
  403. "getmempoolinforesult-size": "Number of transactions in the mempool",
  404. // GetMiningInfoResult help.
  405. "getmininginforesult-blocks": "Height of the latest best block",
  406. "getmininginforesult-currentblocksize": "Size of the latest best block",
  407. "getmininginforesult-currentblockweight": "Weight of the latest best block",
  408. "getmininginforesult-currentblocktx": "Number of transactions in the latest best block",
  409. "getmininginforesult-difficulty": "Current target difficulty",
  410. "getmininginforesult-errors": "Any current errors",
  411. "getmininginforesult-generate": "Whether or not server is set to generate coins",
  412. "getmininginforesult-genproclimit": "Number of processors to use for coin generation (-1 when disabled)",
  413. "getmininginforesult-hashespersec": "Recent hashes per second performance measurement while generating coins",
  414. "getmininginforesult-networkhashps": "Estimated network hashes per second for the most recent blocks",
  415. "getmininginforesult-pooledtx": "Number of transactions in the memory pool",
  416. "getmininginforesult-testnet": "Whether or not server is using testnet",
  417. // GetMiningInfoCmd help.
  418. "getmininginfo--synopsis": "Returns a JSON object containing mining-related information.",
  419. // GetMiningPayouts help.
  420. "getminingpayouts--synopsis": "Get the addresses who will be paid out to in a block template.",
  421. "getminingpayouts--result0--desc": "The list of addresses which will be paid out from block mining.",
  422. "getminingpayouts--result0--key": "Address to be paid.",
  423. "getminingpayouts--result0--value": "Percent that each address will be paid.",
  424. // ConfigureMiningPayouts help.
  425. "configureminingpayouts--synopsis": "Configure who to pay out to when making a block template.",
  426. "configureminingpayouts-payoutpercents": "Map of who to pay out to when making a block template.",
  427. "configureminingpayouts-payoutpercents--desc": "Which addresses should be paid when making a block template.",
  428. "configureminingpayouts-payoutpercents--key": "Which address to pay.",
  429. "configureminingpayouts-payoutpercents--value": "Percent that each address should be paid.",
  430. // GetNetworkSteward help.
  431. "getnetworksteward--synopsis": "Returns information about the network steward, if using a chain with one",
  432. "getnetworkstewardresult-totalpossible": "Total coins existing",
  433. "getnetworkstewardresult-votesagainst": "Total coins voting against the current network steward",
  434. "getnetworkstewardresult-script": "Payment script for current network steward",
  435. // GetNetworkHashPSCmd help.
  436. "getnetworkhashps--synopsis": "Returns the estimated network hashes per second for the block heights provided by the parameters.",
  437. "getnetworkhashps-blocks": "The number of blocks, or -1 for blocks since last difficulty change",
  438. "getnetworkhashps-height": "Perform estimate ending with this height or -1 for current best chain block height",
  439. "getnetworkhashps--result0": "Estimated hashes per second",
  440. // GetNetTotalsCmd help.
  441. "getnettotals--synopsis": "Returns a JSON object containing network traffic statistics.",
  442. // GetNetTotalsResult help.
  443. "getnettotalsresult-totalbytesrecv": "Total bytes received",
  444. "getnettotalsresult-totalbytessent": "Total bytes sent",
  445. "getnettotalsresult-timemillis": "Number of milliseconds since 1 Jan 1970 GMT",
  446. // GetPeerInfoResult help.
  447. "getpeerinforesult-id": "A unique node ID",
  448. "getpeerinforesult-addr": "The ip address and port of the peer",
  449. "getpeerinforesult-addrlocal": "Local address",
  450. "getpeerinforesult-services": "Services bitmask which represents the services supported by the peer",
  451. "getpeerinforesult-relaytxes": "Peer has requested transactions be relayed to it",
  452. "getpeerinforesult-lastsend": "Time the last message was received in seconds since 1 Jan 1970 GMT",
  453. "getpeerinforesult-lastrecv": "Time the last message was sent in seconds since 1 Jan 1970 GMT",
  454. "getpeerinforesult-bytessent": "Total bytes sent",
  455. "getpeerinforesult-bytesrecv": "Total bytes received",
  456. "getpeerinforesult-conntime": "Time the connection was made in seconds since 1 Jan 1970 GMT",
  457. "getpeerinforesult-timeoffset": "The time offset of the peer",
  458. "getpeerinforesult-pingtime": "Number of microseconds the last ping took",
  459. "getpeerinforesult-pingwait": "Number of microseconds a queued ping has been waiting for a response",
  460. "getpeerinforesult-version": "The protocol version of the peer",
  461. "getpeerinforesult-subver": "The user agent of the peer",
  462. "getpeerinforesult-inbound": "Whether or not the peer is an inbound connection",
  463. "getpeerinforesult-startingheight": "The latest block height the peer knew about when the connection was established",
  464. "getpeerinforesult-currentheight": "The current height of the peer",
  465. "getpeerinforesult-banscore": "The ban score",
  466. "getpeerinforesult-feefilter": "The requested minimum fee a transaction must have to be announced to the peer",
  467. "getpeerinforesult-syncnode": "Whether or not the peer is the sync peer",
  468. // GetPeerInfoCmd help.
  469. "getpeerinfo--synopsis": "Returns data about each connected network peer as an array of json objects.",
  470. // GetRawBlockTemplate help.
  471. "getrawblocktemplate--synopsis": "Return a block to be mined as a hex encoded binary string",
  472. "getrawblocktemplate--result0": "Hex encoded string of the block to be mined",
  473. // GetRawBlockTemplateResult help.
  474. "getrawblocktemplateresult-header": "Block header as hex",
  475. "getrawblocktemplateresult-coinbase": "Coinbase transaction as hex",
  476. "getrawblocktemplateresult-merklebranch": "Merkle branch for proving the coinbase, hex string",
  477. "getrawblocktemplateresult-transactions": "Hex string of all transactions other than the coinbase",
  478. "checkpcsharecmdstructure-merklebranch": "The merkle branch for proving the coinbase",
  479. "checkpcsharecmdstructure-coinbase": "The hex encoded coinbase transaction",
  480. "checkpcsharecmdstructure-hexblock": "The hex encoded block",
  481. "checkpcsharecmdstructure-height": "The height of the share to check",
  482. "checkpcsharecmdstructure-sharetarget": "Difficulty target for the share to validate against",
  483. "checkpcshare--result0": "OK or RESUBMIT_AS_BLOCK, or an error in case the packetcrypt share was not valid",
  484. "checkpcshare-request": "The share to validate",
  485. "checkpcshare--synopsis": "Check a PacketCrypt work share against a given share target",
  486. // GetRawMempoolVerboseResult help.
  487. "getrawmempoolverboseresult-size": "Transaction size in bytes",
  488. "getrawmempoolverboseresult-fee": "Transaction fee in bitcoins",
  489. "getrawmempoolverboseresult-time": "Local time transaction entered pool in seconds since 1 Jan 1970 GMT",
  490. "getrawmempoolverboseresult-height": "Block height when transaction entered the pool",
  491. "getrawmempoolverboseresult-startingpriority": "Priority when transaction entered the pool",
  492. "getrawmempoolverboseresult-currentpriority": "Current priority",
  493. "getrawmempoolverboseresult-depends": "Unconfirmed transactions used as inputs for this transaction",
  494. "getrawmempoolverboseresult-vsize": "The virtual size of a transaction",
  495. // GetRawMempoolCmd help.
  496. "getrawmempool--synopsis": "Returns information about all of the transactions currently in the memory pool.",
  497. "getrawmempool-verbose": "Returns JSON object when true or an array of transaction hashes when false",
  498. "getrawmempool--condition0": "verbose=false",
  499. "getrawmempool--condition1": "verbose=true",
  500. "getrawmempool--result0": "Array of transaction hashes",
  501. // GetRawTransactionCmd help.
  502. "getrawtransaction--synopsis": "Returns information about a transaction given its hash.",
  503. "getrawtransaction-txid": "The hash of the transaction",
  504. "getrawtransaction-verbose": "Specifies the transaction is returned as a JSON object instead of a hex-encoded string",
  505. "getrawtransaction--condition0": "verbose=false",
  506. "getrawtransaction--condition1": "verbose=true",
  507. "getrawtransaction--result0": "Hex-encoded bytes of the serialized transaction",
  508. // GetTxOutResult help.
  509. "gettxoutresult-bestblock": "The block hash that contains the transaction output",
  510. "gettxoutresult-confirmations": "The number of confirmations",
  511. "gettxoutresult-value": "The transaction amount in coins",
  512. "gettxoutresult-svalue": "The transaction amount in atomic units (base10 string)",
  513. "gettxoutresult-address": "The address which was paid to",
  514. "gettxoutresult-vote": "A vote on network steward, if any exists",
  515. "gettxoutresult-scriptPubKey": "The public key script used to pay coins as a JSON object",
  516. "gettxoutresult-version": "The transaction version",
  517. "gettxoutresult-coinbase": "Whether or not the transaction is a coinbase",
  518. // GetTxOutCmd help.
  519. "gettxout--synopsis": "Returns information about an unspent transaction output..",
  520. "gettxout-txid": "The hash of the transaction",
  521. "gettxout-vout": "The index of the output",
  522. "gettxout-includemempool": "Include the mempool when true",
  523. // HelpCmd help.
  524. "help--synopsis": "Returns a list of all commands or help for a specified command.",
  525. "help-command": "The command to retrieve help for",
  526. "help--condition0": "no command provided",
  527. "help--condition1": "command specified",
  528. "help--result0": "List of commands",
  529. "help--result1": "Help for specified command",
  530. // PingCmd help.
  531. "ping--synopsis": "Queues a ping to be sent to each connected peer.\n" +
  532. "Ping times are provided by getpeerinfo via the pingtime and pingwait fields.",
  533. // Echo help.
  534. "echo--synopsis": "Output the same as the input",
  535. "echo--result0": "The same as what you put in",
  536. "echo-a": "anything",
  537. "echo-b": "anything",
  538. "echo-c": "anything",
  539. "echo-d": "anything",
  540. "echo-e": "anything",
  541. "echo-f": "anything",
  542. "echo-g": "anything",
  543. // SearchRawTransactionsCmd help.
  544. "searchrawtransactions--synopsis": "Returns raw data for transactions involving the passed address.\n" +
  545. "Returned transactions are pulled from both the database, and transactions currently in the mempool.\n" +
  546. "Transactions pulled from the mempool will have the 'confirmations' field set to 0.\n" +
  547. "Usage of this RPC requires the optional --addrindex flag to be activated, otherwise all responses will simply return with an error stating the address index has not yet been built.\n" +
  548. "Similarly, until the address index has caught up with the current best height, all requests will return an error response in order to avoid serving stale data.",
  549. "searchrawtransactions-address": "The Bitcoin address to search for",
  550. "searchrawtransactions-verbose": "Specifies the transaction is returned as a JSON object instead of hex-encoded string",
  551. "searchrawtransactions--condition0": "verbose=0",
  552. "searchrawtransactions--condition1": "verbose=1",
  553. "searchrawtransactions-skip": "The number of leading transactions to leave out of the final response",
  554. "searchrawtransactions-count": "The maximum number of transactions to return",
  555. "searchrawtransactions-vinextra": "Specify that extra data from previous output will be returned in vin",
  556. "searchrawtransactions-reverse": "Specifies that the transactions should be returned in reverse chronological order",
  557. "searchrawtransactions-filteraddrs": "Address list. Only inputs or outputs with matching address will be returned",
  558. "searchrawtransactions--result0": "Hex-encoded serialized transaction",
  559. // SendRawTransactionCmd help.
  560. "sendrawtransaction--synopsis": "Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.",
  561. "sendrawtransaction-hextx": "Serialized, hex-encoded signed transaction",
  562. "sendrawtransaction-allowhighfees": "Whether or not to allow insanely high fees (pktd does not yet implement this parameter, so it has no effect)",
  563. "sendrawtransaction--result0": "The hash of the transaction",
  564. // SetGenerateCmd help.
  565. "setgenerate--synopsis": "Set the server to generate coins (mine) or not.",
  566. "setgenerate-generate": "Use true to enable generation, false to disable it",
  567. "setgenerate-genproclimit": "The number of processors (cores) to limit generation to or -1 for default",
  568. // StopCmd help.
  569. "stop--synopsis": "Shutdown pktd.",
  570. "stop--result0": "The string 'pktd stopping.'",
  571. // SubmitBlockOptions help.
  572. "submitblockoptions-workid": "This parameter is currently ignored",
  573. // SubmitBlockCmd help.
  574. "submitblock--synopsis": "Attempts to submit a new serialized, hex-encoded block to the network.",
  575. "submitblock-hexblock": "Serialized, hex-encoded block",
  576. "submitblock-options": "This parameter is currently ignored",
  577. "submitblock--condition0": "Block successfully submitted",
  578. "submitblock--condition1": "Block rejected",
  579. "submitblock--result1": "The reason the block was rejected",
  580. // ValidateAddressResult help.
  581. "validateaddresschainresult-isvalid": "Whether or not the address is valid",
  582. "validateaddresschainresult-address": "The bitcoin address (only when isvalid is true)",
  583. // ValidateAddressCmd help.
  584. "validateaddress--synopsis": "Verify an address is valid.",
  585. "validateaddress-address": "Bitcoin address to validate",
  586. // VerifyChainCmd help.
  587. "verifychain--synopsis": "Verifies the block chain database.\n" +
  588. "The actual checks performed by the checklevel parameter are implementation specific.\n" +
  589. "For pktd this is:\n" +
  590. "checklevel=0 - Look up each block and ensure it can be loaded from the database.\n" +
  591. "checklevel=1 - Perform basic context-free sanity checks on each block.",
  592. "verifychain-checklevel": "How thorough the block verification is",
  593. "verifychain-checkdepth": "The number of blocks to check",
  594. "verifychain--result0": "Whether or not the chain verified",
  595. // VerifyMessageCmd help.
  596. "verifymessage--synopsis": "Verify a signed message.",
  597. "verifymessage-address": "The bitcoin address to use for the signature",
  598. "verifymessage-signature": "The base-64 encoded signature provided by the signer",
  599. "verifymessage-message": "The signed message",
  600. "verifymessage--result0": "Whether or not the signature verified",
  601. // -------- Websocket-specific help --------
  602. // Session help.
  603. "session--synopsis": "Return details regarding a websocket client's current connection session.",
  604. "sessionresult-sessionid": "The unique session ID for a client's websocket connection.",
  605. // NotifyBlocksCmd help.
  606. "notifyblocks--synopsis": "Request notifications for whenever a block is connected or disconnected from the main (best) chain.",
  607. // StopNotifyBlocksCmd help.
  608. "stopnotifyblocks--synopsis": "Cancel registered notifications for whenever a block is connected or disconnected from the main (best) chain.",
  609. // NotifyNewTransactionsCmd help.
  610. "notifynewtransactions--synopsis": "Send either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool.",
  611. "notifynewtransactions-verbose": "Specifies which type of notification to receive. If verbose is true, then the caller receives txacceptedverbose, otherwise the caller receives txaccepted",
  612. // StopNotifyNewTransactionsCmd help.
  613. "stopnotifynewtransactions--synopsis": "Stop sending either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool.",
  614. // NotifyReceivedCmd help.
  615. "notifyreceived--synopsis": "Send a recvtx notification when a transaction added to mempool or appears in a newly-attached block contains a txout pkScript sending to any of the passed addresses.\n" +
  616. "Matching outpoints are automatically registered for redeemingtx notifications.",
  617. "notifyreceived-addresses": "List of address to receive notifications about",
  618. // StopNotifyReceivedCmd help.
  619. "stopnotifyreceived--synopsis": "Cancel registered receive notifications for each passed address.",
  620. "stopnotifyreceived-addresses": "List of address to cancel receive notifications for",
  621. // OutPoint help.
  622. "outpoint-hash": "The hex-encoded bytes of the outpoint hash",
  623. "outpoint-index": "The index of the outpoint",
  624. // NotifySpentCmd help.
  625. "notifyspent--synopsis": "Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this pktd instance) and when such a transaction first appears in a newly-attached block.",
  626. "notifyspent-outpoints": "List of transaction outpoints to monitor.",
  627. // StopNotifySpentCmd help.
  628. "stopnotifyspent--synopsis": "Cancel registered spending notifications for each passed outpoint.",
  629. "stopnotifyspent-outpoints": "List of transaction outpoints to stop monitoring.",
  630. // LoadTxFilterCmd help.
  631. "loadtxfilter--synopsis": "Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and rescanblocks.",
  632. "loadtxfilter-reload": "Load a new filter instead of adding data to an existing one",
  633. "loadtxfilter-addresses": "Array of addresses to add to the transaction filter",
  634. "loadtxfilter-outpoints": "Array of outpoints to add to the transaction filter",
  635. // Rescan help.
  636. "rescan--synopsis": "Rescan block chain for transactions to addresses.\n" +
  637. "When the endblock parameter is omitted, the rescan continues through the best block in the main chain.\n" +
  638. "Rescan results are sent as recvtx and redeemingtx notifications.\n" +
  639. "This call returns once the rescan completes.",
  640. "rescan-beginblock": "Hash of the first block to begin rescanning",
  641. "rescan-addresses": "List of addresses to include in the rescan",
  642. "rescan-outpoints": "List of transaction outpoints to include in the rescan",
  643. "rescan-endblock": "Hash of final block to rescan",
  644. // RescanBlocks help.
  645. "rescanblocks--synopsis": "Rescan blocks for transactions matching the loaded transaction filter.",
  646. "rescanblocks-blockhashes": "List of hashes to rescan. Each next block must be a child of the previous.",
  647. "rescanblocks--result0": "List of matching blocks.",
  648. // RescannedBlock help.
  649. "rescannedblock-hash": "Hash of the matching block.",
  650. "rescannedblock-transactions": "List of matching transactions, serialized and hex-encoded.",
  651. // Uptime help.
  652. "uptime--synopsis": "Returns the total uptime of the server.",
  653. "uptime--result0": "The number of seconds that the server has been running",
  654. // Version help.
  655. "version--synopsis": "Returns the JSON-RPC API version (semver)",
  656. "version--result0--desc": "Version objects keyed by the program or API name",
  657. "version--result0--key": "Program or API name",
  658. "version--result0--value": "Object containing the semantic version",
  659. // VersionResult help.
  660. "versionresult-versionstring": "The JSON-RPC API version (semver)",
  661. "versionresult-major": "The major component of the JSON-RPC API version",
  662. "versionresult-minor": "The minor component of the JSON-RPC API version",
  663. "versionresult-patch": "The patch component of the JSON-RPC API version",
  664. "versionresult-prerelease": "Prerelease info about the current build",
  665. "versionresult-buildmetadata": "Metadata about the current build",
  666. }
  667. // rpcResultTypes specifies the result types that each RPC command can return.
  668. // This information is used to generate the help. Each result type must be a
  669. // pointer to the type (or nil to indicate no return value).
  670. var rpcResultTypes = map[string][]interface{}{
  671. "addnode": nil,
  672. "configureminingpayouts": nil,
  673. "createrawtransaction": {(*string)(nil)},
  674. "checkpcann": {(*btcjson.CheckPcAnnResult)(nil)},
  675. "debuglevel": {(*string)(nil), (*string)(nil)},
  676. "decoderawtransaction": {(*btcjson.TxRawDecodeResult)(nil)},
  677. "decodescript": {(*btcjson.DecodeScriptResult)(nil)},
  678. "estimatefee": {(*float64)(nil)},
  679. "estimatesmartfee": {(*btcjson.EstimateSmartFeeResult)(nil)},
  680. "generate": {(*[]string)(nil)},
  681. "getaddednodeinfo": {(*[]string)(nil), (*[]btcjson.GetAddedNodeInfoResult)(nil)},
  682. "getbestblock": {(*btcjson.GetBestBlockResult)(nil)},
  683. "getbestblockhash": {(*string)(nil)},
  684. "getblock": {(*string)(nil), (*btcjson.GetBlockVerboseResult)(nil)},
  685. "getblockcount": {(*int64)(nil)},
  686. "getblockhash": {(*string)(nil)},
  687. "getblockheader": {(*string)(nil), (*btcjson.GetBlockHeaderVerboseResult)(nil)},
  688. "getblocktemplate": {(*btcjson.GetBlockTemplateResult)(nil), (*string)(nil), nil},
  689. "getblockchaininfo": {(*btcjson.GetBlockChainInfoResult)(nil)},
  690. "getcfilter": {(*string)(nil)},
  691. "getcfilterheader": {(*string)(nil)},
  692. "getconnectioncount": {(*int32)(nil)},
  693. "getcurrentnet": {(*uint32)(nil)},
  694. "getdifficulty": {(*float64)(nil)},
  695. "getgenerate": {(*bool)(nil)},
  696. "gethashespersec": {(*float64)(nil)},
  697. "getheaders": {(*[]string)(nil)},
  698. "getinfo": {(*btcjson.InfoChainResult)(nil)},
  699. "getmempoolinfo": {(*btcjson.GetMempoolInfoResult)(nil)},
  700. "getmininginfo": {(*btcjson.GetMiningInfoResult)(nil)},
  701. "getminingpayouts": {(*btcjson.GetMiningPayoutsResult)(nil)},
  702. "getnettotals": {(*btcjson.GetNetTotalsResult)(nil)},
  703. "getnetworkinfo": {(*btcjson.GetNetworkInfoResult)(nil)},
  704. "getnetworksteward": {(*btcjson.GetNetworkStewardResult)(nil)},
  705. "getnetworkhashps": {(*int64)(nil)},
  706. "getpeerinfo": {(*[]btcjson.GetPeerInfoResult)(nil)},
  707. "getrawblocktemplate": {(*string)(nil)},
  708. "checkpcshare": {(*string)(nil)},
  709. "getrawmempool": {(*[]string)(nil), (*btcjson.GetRawMempoolVerboseResult)(nil)},
  710. "getrawtransaction": {(*string)(nil), (*btcjson.TxRawResult)(nil)},
  711. "gettxout": {(*btcjson.GetTxOutResult)(nil)},
  712. "node": nil,
  713. "help": {(*string)(nil), (*string)(nil)},
  714. "ping": nil,
  715. "echo": {(*[]string)(nil)},
  716. "searchrawtransactions": {(*string)(nil), (*[]btcjson.TxRawResult)(nil)},
  717. "sendrawtransaction": {(*string)(nil)},
  718. "setgenerate": nil,
  719. "stop": {(*string)(nil)},
  720. "submitblock": {nil, (*string)(nil)},
  721. "uptime": {(*int64)(nil)},
  722. "validateaddress": {(*btcjson.ValidateAddressChainResult)(nil)},
  723. "verifychain": {(*bool)(nil)},
  724. "verifymessage": {(*bool)(nil)},
  725. "version": {(*map[string]btcjson.VersionResult)(nil)},
  726. // Websocket commands.
  727. "loadtxfilter": nil,
  728. "session": {(*btcjson.SessionResult)(nil)},
  729. "notifyblocks": nil,
  730. "stopnotifyblocks": nil,
  731. "notifynewtransactions": nil,
  732. "stopnotifynewtransactions": nil,
  733. "notifyreceived": nil,
  734. "stopnotifyreceived": nil,
  735. "notifyspent": nil,
  736. "stopnotifyspent": nil,
  737. "rescan": nil,
  738. "rescanblocks": {(*[]btcjson.RescannedBlock)(nil)},
  739. }
  740. // helpCacher provides a concurrent safe type that provides help and usage for
  741. // the RPC server commands and caches the results for future calls.
  742. type helpCacher struct {
  743. sync.Mutex
  744. usage string
  745. methodHelp map[string]string
  746. }
  747. // rpcMethodHelp returns an RPC help string for the provided method.
  748. //
  749. // This function is safe for concurrent access.
  750. func (c *helpCacher) rpcMethodHelp(method string) (string, er.R) {
  751. c.Lock()
  752. defer c.Unlock()
  753. // Return the cached method help if it exists.
  754. if help, exists := c.methodHelp[method]; exists {
  755. return help, nil
  756. }
  757. // Look up the result types for the method.
  758. resultTypes, ok := rpcResultTypes[method]
  759. if !ok {
  760. return "", er.New("no result types specified for method " +
  761. method)
  762. }
  763. // Generate, cache, and return the help.
  764. help, err := btcjson.GenerateHelp(method, helpDescsEnUS, resultTypes...)
  765. if err != nil {
  766. return "", err
  767. }
  768. c.methodHelp[method] = help
  769. return help, nil
  770. }
  771. // rpcUsage returns one-line usage for all support RPC commands.
  772. //
  773. // This function is safe for concurrent access.
  774. func (c *helpCacher) rpcUsage(includeWebsockets bool) (string, er.R) {
  775. c.Lock()
  776. defer c.Unlock()
  777. // Return the cached usage if it is available.
  778. if c.usage != "" {
  779. return c.usage, nil
  780. }
  781. // Generate a list of one-line usage for every command.
  782. usageTexts := make([]string, 0, len(rpcHandlers))
  783. for k := range rpcHandlers {
  784. usage, err := btcjson.MethodUsageText(k)
  785. if err != nil {
  786. return "", err
  787. }
  788. usageTexts = append(usageTexts, usage)
  789. }
  790. // Include websockets commands if requested.
  791. if includeWebsockets {
  792. for k := range wsHandlers {
  793. usage, err := btcjson.MethodUsageText(k)
  794. if err != nil {
  795. return "", err
  796. }
  797. usageTexts = append(usageTexts, usage)
  798. }
  799. }
  800. sort.Strings(usageTexts)
  801. c.usage = strings.Join(usageTexts, "\n")
  802. return c.usage, nil
  803. }
  804. // newHelpCacher returns a new instance of a help cacher which provides help and
  805. // usage for the RPC server commands and caches the results for future calls.
  806. func newHelpCacher() *helpCacher {
  807. return &helpCacher{
  808. methodHelp: make(map[string]string),
  809. }
  810. }