@@ -85,7 +85,13 @@ Value getblockcount(const Array& params, bool fHelp)
85
85
if (fHelp || params.size () != 0 )
86
86
throw runtime_error (
87
87
" getblockcount\n "
88
- " Returns the number of blocks in the longest block chain." );
88
+ " \n Returns the number of blocks in the longest block chain.\n "
89
+ " \n Result:\n "
90
+ " n (numeric) The current block count\n "
91
+ " \n Examples:\n "
92
+ + HelpExampleCli (" getblockcount" , " " )
93
+ + HelpExampleRpc (" getblockcount" , " " )
94
+ );
89
95
90
96
return chainActive.Height ();
91
97
}
@@ -95,7 +101,13 @@ Value getbestblockhash(const Array& params, bool fHelp)
95
101
if (fHelp || params.size () != 0 )
96
102
throw runtime_error (
97
103
" getbestblockhash\n "
98
- " Returns the hash of the best (tip) block in the longest block chain." );
104
+ " \n Returns the hash of the best (tip) block in the longest block chain.\n "
105
+ " \n Result\n "
106
+ " \" hex\" (string) the block hash hex encoded\n "
107
+ " \n Examples\n "
108
+ + HelpExampleCli (" getbestblockhash" , " " )
109
+ + HelpExampleRpc (" getbestblockhash" , " " )
110
+ );
99
111
100
112
return chainActive.Tip ()->GetBlockHash ().GetHex ();
101
113
}
@@ -105,7 +117,13 @@ Value getdifficulty(const Array& params, bool fHelp)
105
117
if (fHelp || params.size () != 0 )
106
118
throw runtime_error (
107
119
" getdifficulty\n "
108
- " Returns the proof-of-work difficulty as a multiple of the minimum difficulty." );
120
+ " \n Returns the proof-of-work difficulty as a multiple of the minimum difficulty.\n "
121
+ " \n Result:\n "
122
+ " n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.\n "
123
+ " \n Examples:\n "
124
+ + HelpExampleCli (" getdifficulty" , " " )
125
+ + HelpExampleRpc (" getdifficulty" , " " )
126
+ );
109
127
110
128
return GetDifficulty ();
111
129
}
@@ -115,8 +133,16 @@ Value settxfee(const Array& params, bool fHelp)
115
133
{
116
134
if (fHelp || params.size () < 1 || params.size () > 1 )
117
135
throw runtime_error (
118
- " settxfee <amount btc/kb>\n "
119
- " <amount> is a real and is rounded to the nearest 0.00000001 btc per kb" );
136
+ " settxfee amount\n "
137
+ " \n Set the transaction fee. 'amount' is a real and is rounded to the nearest 0.00000001\n "
138
+ " \n Arguments:\n "
139
+ " 1. amount (numeric, required) The transaction fee in btc rounded to the nearest 0.00000001\n "
140
+ " \n Result\n "
141
+ " true|false (boolean) Returns true if successful\n "
142
+ " \n Examples:\n "
143
+ + HelpExampleCli (" settxfee" , " 0.00001" )
144
+ + HelpExampleRpc (" settxfee" , " 0.00001" )
145
+ );
120
146
121
147
// Amount
122
148
int64_t nAmount = 0 ;
@@ -132,7 +158,16 @@ Value getrawmempool(const Array& params, bool fHelp)
132
158
if (fHelp || params.size () != 0 )
133
159
throw runtime_error (
134
160
" getrawmempool\n "
135
- " Returns all transaction ids in memory pool." );
161
+ " \n Returns all transaction ids in memory pool as a json array of string transaction ids.\n "
162
+ " \n Result:\n "
163
+ " [ (json array of string)\n "
164
+ " \" transactionid\" (string) The transaction id\n "
165
+ " ,...\n "
166
+ " ]\n "
167
+ " \n Examples\n "
168
+ + HelpExampleCli (" getrawmempool" , " " )
169
+ + HelpExampleRpc (" getrawmempool" , " " )
170
+ );
136
171
137
172
vector<uint256> vtxid;
138
173
mempool.queryHashes (vtxid);
@@ -148,8 +183,16 @@ Value getblockhash(const Array& params, bool fHelp)
148
183
{
149
184
if (fHelp || params.size () != 1 )
150
185
throw runtime_error (
151
- " getblockhash <index>\n "
152
- " Returns hash of block in best-block-chain at <index>." );
186
+ " getblockhash index\n "
187
+ " \n Returns hash of block in best-block-chain at index provided.\n "
188
+ " \n Arguments:\n "
189
+ " 1. index (numeric, required) The block index\n "
190
+ " \n Result:\n "
191
+ " \" hash\" (string) The block hash\n "
192
+ " \n Examples:\n "
193
+ + HelpExampleCli (" getblockhash" , " 1000" )
194
+ + HelpExampleRpc (" getblockhash" , " 1000" )
195
+ );
153
196
154
197
int nHeight = params[0 ].get_int ();
155
198
if (nHeight < 0 || nHeight > chainActive.Height ())
@@ -163,9 +206,36 @@ Value getblock(const Array& params, bool fHelp)
163
206
{
164
207
if (fHelp || params.size () < 1 || params.size () > 2 )
165
208
throw runtime_error (
166
- " getblock <hash> [verbose=true]\n "
167
- " If verbose is false, returns a string that is serialized, hex-encoded data for block <hash>.\n "
168
- " If verbose is true, returns an Object with information about block <hash>."
209
+ " getblock \" hash\" ( verbose )\n "
210
+ " \n If verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'.\n "
211
+ " If verbose is true, returns an Object with information about block <hash>.\n "
212
+ " \n Arguments:\n "
213
+ " 1. \" hash\" (string, required) The block hash\n "
214
+ " 2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n "
215
+ " \n Result (for verbose = true):\n "
216
+ " {\n "
217
+ " \" hash\" : \" hash\" , (string) the block hash (same as provided)\n "
218
+ " \" confirmations\" : n, (numeric) The number of confirmations\n "
219
+ " \" size\" : n, (numeric) The block size\n "
220
+ " \" height\" : n, (numeric) The block height or index\n "
221
+ " \" version\" : n, (numeric) The block version\n "
222
+ " \" merkleroot\" : \" xxxx\" , (string) The merkle root\n "
223
+ " \" tx\" : [ (array of string) The transaction ids\n "
224
+ " \" transactionid\" (string) The transaction id\n "
225
+ " ,...\n "
226
+ " ],\n "
227
+ " \" time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n "
228
+ " \" nonce\" : n, (numeric) The nonce\n "
229
+ " \" bits\" : \" 1d00ffff\" , (string) The bits\n "
230
+ " \" difficulty\" : x.xxx, (numeric) The difficulty\n "
231
+ " \" previousblockhash\" : \" hash\" , (string) The hash of the previous block\n "
232
+ " \" nextblockhash\" : \" hash\" (string) The hash of the next block\n "
233
+ " }\n "
234
+ " \n Result (for verbose=false):\n "
235
+ " \" data\" (string) A string that is serialized, hex-encoded data for block 'hash'.\n "
236
+ " \n Examples:\n "
237
+ + HelpExampleCli (" getblock" , " \" 00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" " )
238
+ + HelpExampleRpc (" getblock" , " \" 00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\" " )
169
239
);
170
240
171
241
std::string strHash = params[0 ].get_str ();
@@ -198,7 +268,22 @@ Value gettxoutsetinfo(const Array& params, bool fHelp)
198
268
if (fHelp || params.size () != 0 )
199
269
throw runtime_error (
200
270
" gettxoutsetinfo\n "
201
- " Returns statistics about the unspent transaction output set." );
271
+ " \n Returns statistics about the unspent transaction output set.\n "
272
+ " Note this call may take some time.\n "
273
+ " \n Result:\n "
274
+ " {\n "
275
+ " \" height\" :n, (numeric) The current block height (index)\n "
276
+ " \" bestblock\" : \" hex\" , (string) the best block hash hex\n "
277
+ " \" transactions\" : n, (numeric) The number of transactions\n "
278
+ " \" txouts\" : n, (numeric) The number of output transactions\n "
279
+ " \" bytes_serialized\" : n, (numeric) The serialized size\n "
280
+ " \" hash_serialized\" : \" hash\" , (string) The serialized hash\n "
281
+ " \" total_amount\" : x.xxx (numeric) The total amount\n "
282
+ " }\n "
283
+ " \n Examples:\n "
284
+ + HelpExampleCli (" gettxoutsetinfo" , " " )
285
+ + HelpExampleRpc (" gettxoutsetinfo" , " " )
286
+ );
202
287
203
288
Object ret;
204
289
@@ -219,8 +304,39 @@ Value gettxout(const Array& params, bool fHelp)
219
304
{
220
305
if (fHelp || params.size () < 2 || params.size () > 3 )
221
306
throw runtime_error (
222
- " gettxout <txid> <n> [includemempool=true]\n "
223
- " Returns details about an unspent transaction output." );
307
+ " gettxout \" txid\" n ( includemempool )\n "
308
+ " \n Returns details about an unspent transaction output.\n "
309
+ " \n Arguments:\n "
310
+ " 1. \" txid\" (string, required) The transaction id\n "
311
+ " 2. n (numeric, required) vout value\n "
312
+ " 3. includemempool (boolean, optional) Whether to included the mem pool\n "
313
+ " \n Result:\n "
314
+ " {\n "
315
+ " \" bestblock\" : \" hash\" , (string) the block hash\n "
316
+ " \" confirmations\" : n, (numeric) The number of confirmations\n "
317
+ " \" value\" : x.xxx, (numeric) The transaction value in btc\n "
318
+ " \" scriptPubKey\" : { (json object)\n "
319
+ " \" asm\" : \" code\" , (string) \n "
320
+ " \" hex\" : \" hex\" , (string) \n "
321
+ " \" reqSigs\" : n, (numeric) Number of required signatures\n "
322
+ " \" type\" : \" pubkeyhash\" , (string) The type, eg pubkeyhash\n "
323
+ " \" addresses\" : [ (array of string) array of bitcoin addresses\n "
324
+ " \" bitcoinaddress\" (string) bitcoin address\n "
325
+ " ,...\n "
326
+ " ]\n "
327
+ " },\n "
328
+ " \" version\" : n, (numeric) The version\n "
329
+ " \" coinbase\" : true|false (boolean) Coinbase or not\n "
330
+ " }\n "
331
+
332
+ " \n Examples:\n "
333
+ " \n Get unspent transactions\n "
334
+ + HelpExampleCli (" listunspent" , " " ) +
335
+ " \n View the details\n "
336
+ + HelpExampleCli (" gettxout" , " \" txid\" 1" ) +
337
+ " \n As a json rpc call\n "
338
+ + HelpExampleRpc (" gettxout" , " \" txid\" , 1" )
339
+ );
224
340
225
341
Object ret;
226
342
@@ -266,8 +382,17 @@ Value verifychain(const Array& params, bool fHelp)
266
382
{
267
383
if (fHelp || params.size () > 2 )
268
384
throw runtime_error (
269
- " verifychain [check level] [num blocks]\n "
270
- " Verifies blockchain database." );
385
+ " verifychain ( checklevel numblocks )\n "
386
+ " \n Verifies blockchain database.\n "
387
+ " \n Arguments:\n "
388
+ " 1. checklevel (numeric, optional, default=3) The level\n "
389
+ " 2. numblocks (numeric, optional, 288) The number of blocks\n "
390
+ " \n Result:\n "
391
+ " true|false (boolean) Verified or not\n "
392
+ " \n Examples:\n "
393
+ + HelpExampleCli (" verifychain" , " " )
394
+ + HelpExampleRpc (" verifychain" , " " )
395
+ );
271
396
272
397
int nCheckLevel = GetArg (" -checklevel" , 3 );
273
398
int nCheckDepth = GetArg (" -checkblocks" , 288 );
0 commit comments