/
helpdesc.go
2020 lines (1951 loc) · 87.6 KB
/
helpdesc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package rpc
import "github.com/copernet/copernicus/util"
func HelpExampleCli(methodname string, args ...string) string {
help := "> coperctl " + methodname
for _, arg := range args {
help += " " + arg
}
help += "\n"
return help
}
func HelpExampleRPC(methodname string, args ...string) string {
help := "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", " +
"\"id\":\"curltest\", \"method\": \"" + methodname + "\", \"params\": ["
for index, arg := range args {
if index == len(args)-1 {
help += arg
} else {
help += arg + ", "
}
}
help += "] }' -H 'content-type: text/plain;' http://127.0.0.1:18334/\n"
return help
}
// abc
var (
getexcessiveblockDesc = "getexcessiveblock\n" +
"\nReturn the excessive block size." +
"\nResult\n" +
" excessiveBlockSize (integer) block size in bytes\n" +
"\nExamples:\n" +
HelpExampleCli("getexcessiveblock") +
HelpExampleRPC("getexcessiveblock")
setexcessiveblockDesc = "setexcessiveblock blockSize\n" +
"\nSet the excessive block size. Excessive blocks will not be used " +
"in the active chain or relayed. This discourages the propagation " +
"of blocks that you consider excessively large." +
"\nResult\n" +
" blockSize (integer) excessive block size in bytes\n" +
"\nExamples:\n" +
HelpExampleCli("setexcessiveblock") +
HelpExampleRPC("setexcessiveblock")
)
//blockchain
var (
getblockchaininfoDesc = "getblockchaininfo\n" +
"Returns an object containing various state info regarding " +
"blockchain processing.\n" +
"\nResult:\n" +
"{\n" +
" \"chain\": \"xxxx\", (string) current network name as " +
"defined in BIP70 (main, test, regtest)\n" +
" \"blocks\": xxxxxx, (numeric) the current number of " +
"blocks processed in the server\n" +
" \"headers\": xxxxxx, (numeric) the current number of " +
"headers we have validated\n" +
" \"bestblockhash\": \"...\", (string) the hash of the currently " +
"best block\n" +
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n" +
" \"mediantime\": xxxxxx, (numeric) median time for the " +
"current best block\n" +
" \"verificationprogress\": xxxx, (numeric) estimate of " +
"verification progress [0..1]\n" +
" \"chainwork\": \"xxxx\" (string) total amount of work in " +
"active chain, in hexadecimal\n" +
" \"pruned\": xx, (boolean) if the blocks are subject " +
"to pruning\n" +
" \"pruneheight\": xxxxxx, (numeric) lowest-height complete " +
"block stored\n" +
" \"softforks\": [ (array) status of softforks in " +
"progress\n" +
" {\n" +
" \"id\": \"xxxx\", (string) name of softfork\n" +
" \"version\": xx, (numeric) block version\n" +
" \"reject\": { (object) progress toward " +
"rejecting pre-softfork blocks\n" +
" \"status\": xx, (boolean) true if threshold " +
"reached\n" +
" },\n" +
" }, ...\n" +
" ],\n" +
" \"bip9_softforks\": { (object) status of BIP9 " +
"softforks in progress\n" +
" \"xxxx\" : { (string) name of the softfork\n" +
" \"status\": \"xxxx\", (string) one of \"defined\", " +
"\"started\", \"locked_in\", \"active\", \"failed\"\n" +
" \"bit\": xx, (numeric) the bit (0-28) in the " +
"block version field used to signal this softfork (only for " +
"\"started\" status)\n" +
" \"startTime\": xx, (numeric) the minimum median " +
"time past of a block at which the bit gains its meaning\n" +
" \"timeout\": xx, (numeric) the median time past " +
"of a block at which the deployment is considered failed if not " +
"yet locked in\n" +
" \"since\": xx (numeric) height of the first " +
"block to which the status applies\n" +
" }\n" +
" }\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getblockchaininfo") +
HelpExampleRPC("getblockchaininfo")
getbestblockhashDesc = "getbestblockhash\n" +
"\nReturns the hash of the best (tip) block in the " +
"longest blockchain.\n" +
"\nResult:\n" +
"\"hex\" (string) the block hash hex encoded\n" +
"\nExamples:\n" +
HelpExampleCli("getbestblockhash") +
HelpExampleRPC("getbestblockhash")
getblockcountDesc = "getblockcount\n" +
"\nReturns the number of blocks in the longest blockchain.\n" +
"\nResult:\n" +
"n (numeric) The current block count\n" +
"\nExamples:\n" +
HelpExampleCli("getblockcount") +
HelpExampleRPC("getblockcount")
getblockDesc = "getblock \"blockhash\" ( verbose )\n" +
"\nIf verbose is false, returns a string that is serialized, " +
"hex-encoded data for block 'hash'.\n" +
"If verbose is true, returns an Object with information about " +
"block <hash>.\n" +
"\nArguments:\n" +
"1. \"blockhash\" (string, required) The block hash\n" +
"2. verbose (boolean, optional, default=true) true " +
"for a json object, false for the hex encoded data\n" +
"\nResult (for verbose = true):\n" +
"{\n" +
" \"hash\" : \"hash\", (string) the block hash (same as " +
"provided)\n" +
" \"confirmations\" : n, (numeric) The number of confirmations, " +
"or -1 if the block is not on the main chain\n" +
" \"size\" : n, (numeric) The block size\n" +
" \"height\" : n, (numeric) The block height or index\n" +
" \"version\" : n, (numeric) The block version\n" +
" \"versionHex\" : \"00000000\", (string) The block version " +
"formatted in hexadecimal\n" +
" \"merkleroot\" : \"xxxx\", (string) The merkle root\n" +
" \"tx\" : [ (array of string) The transaction ids\n" +
" \"transactionid\" (string) The transaction id\n" +
" ,...\n" +
" ],\n" +
" \"time\" : ttt, (numeric) The block time in seconds " +
"since epoch (Jan 1 1970 GMT)\n" +
" \"mediantime\" : ttt, (numeric) The median block time in " +
"seconds since epoch (Jan 1 1970 GMT)\n" +
" \"nonce\" : n, (numeric) The nonce\n" +
" \"bits\" : \"1d00ffff\", (string) The bits\n" +
" \"difficulty\" : x.xxx, (numeric) The difficulty\n" +
" \"chainwork\" : \"xxxx\", (string) Expected number of hashes " +
"required to produce the chain up to this block (in hex)\n" +
" \"previousblockhash\" : \"hash\", (string) The hash of the " +
"previous block\n" +
" \"nextblockhash\" : \"hash\" (string) The hash of the " +
"next block\n" +
"}\n" +
"\nResult (for verbose=false):\n" +
"\"data\" (string) A string that is serialized, " +
"hex-encoded data for block 'hash'.\n" +
"\nExamples:\n" +
HelpExampleCli("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"") +
HelpExampleRPC("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")
getblockhashDesc = "getblockhash height\n" +
"\nReturns hash of block in best-block-chain at height provided.\n" +
"\nArguments:\n" +
"1. height (numeric, required) The height index\n" +
"\nResult:\n" +
"\"hash\" (string) The block hash\n" +
"\nExamples:\n" +
HelpExampleCli("getblockhash", "1000") +
HelpExampleRPC("getblockhash", "1000")
getblockheader = "getblockheader \"hash\" ( verbose )\n" +
"\nIf verbose is false, returns a string that is serialized, " +
"hex-encoded data for blockheader 'hash'.\n" +
"If verbose is true, returns an Object with information about " +
"blockheader <hash>.\n" +
"\nArguments:\n" +
"1. \"hash\" (string, required) The block hash\n" +
"2. verbose (boolean, optional, default=true) true for a " +
"json object, false for the hex encoded data\n" +
"\nResult (for verbose = true):\n" +
"{\n" +
" \"hash\" : \"hash\", (string) the block hash (same as " +
"provided)\n" +
" \"confirmations\" : n, (numeric) The number of confirmations, " +
"or -1 if the block is not on the main chain\n" +
" \"height\" : n, (numeric) The block height or index\n" +
" \"version\" : n, (numeric) The block version\n" +
" \"versionHex\" : \"00000000\", (string) The block version " +
"formatted in hexadecimal\n" +
" \"merkleroot\" : \"xxxx\", (string) The merkle root\n" +
" \"time\" : ttt, (numeric) The block time in seconds " +
"since epoch (Jan 1 1970 GMT)\n" +
" \"mediantime\" : ttt, (numeric) The median block time in " +
"seconds since epoch (Jan 1 1970 GMT)\n" +
" \"nonce\" : n, (numeric) The nonce\n" +
" \"bits\" : \"1d00ffff\", (string) The bits\n" +
" \"difficulty\" : x.xxx, (numeric) The difficulty\n" +
" \"chainwork\" : \"0000...1f3\" (string) Expected number of " +
"hashes required to produce the current chain (in hex)\n" +
" \"previousblockhash\" : \"hash\", (string) The hash of the " +
"previous block\n" +
" \"nextblockhash\" : \"hash\", (string) The hash of the " +
"next block\n" +
"}\n" +
"\nResult (for verbose=false):\n" +
"\"data\" (string) A string that is serialized, " +
"hex-encoded data for block 'hash'.\n" +
"\nExamples:\n" +
HelpExampleCli("getblockheader", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"") +
HelpExampleRPC("getblockheader", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"")
getchaintipsDesc = "getchaintips\n" +
"Return information about all known tips in the block tree," +
" including the main chain as well as orphaned branches.\n" +
"\nResult:\n" +
"[\n" +
" {\n" +
" \"height\": xxxx, (numeric) height of the chain tip\n" +
" \"hash\": \"xxxx\", (string) block hash of the tip\n" +
" \"branchlen\": 0 (numeric) zero for main chain\n" +
" \"status\": \"active\" (string) \"active\" for the main " +
"chain\n" +
" },\n" +
" {\n" +
" \"height\": xxxx,\n" +
" \"hash\": \"xxxx\",\n" +
" \"branchlen\": 1 (numeric) length of branch " +
"connecting the tip to the main chain\n" +
" \"status\": \"xxxx\" (string) status of the chain " +
"(active, valid-fork, valid-headers, headers-only, invalid)\n" +
" }\n" +
"]\n" +
"Possible values for status:\n" +
"1. \"invalid\" This branch contains at least one " +
"invalid block\n" +
"2. \"headers-only\" Not all blocks for this branch are " +
"available, but the headers are valid\n" +
"3. \"valid-headers\" All blocks are available for this " +
"branch, but they were never fully validated\n" +
"4. \"valid-fork\" This branch is not part of the " +
"active chain, but is fully validated\n" +
"5. \"active\" This is the tip of the active main " +
"chain, which is certainly valid\n" +
"\nExamples:\n" +
HelpExampleCli("getchaintips") +
HelpExampleRPC("getchaintips")
getchaintxstatsDesc = "getchaintxstats ( nblocks blockhash )\n" +
"\nCompute statistics about the total number and rate of " +
"transactions in the chain.\n" +
"\nArguments:\n" +
"1. nblocks (numeric, optional) Size of the window in number " +
"of blocks (default: one month).\n" +
"2. \"blockhash\" (string, optional) The hash of the block that " +
"ends the window.\n" +
"\nResult:\n" +
"{\n" +
" \"time\": xxxxx, (numeric) The timestamp for the " +
"final block in the window in UNIX format.\n" +
" \"txcount\": xxxxx, (numeric) The total number of " +
"transactions in the chain up to that point.\n" +
" \"window_block_count\": xxxxx, (numeric) Size of the window in " +
"number of blocks.\n" +
" \"window_tx_count\": xxxxx, (numeric) The number of " +
"transactions in the window. Only returned if " +
"\"window_block_count\" is > 0.\n" +
" \"window_interval\": xxxxx, (numeric) The elapsed time in " +
"the window in seconds. Only returned if \"window_block_count\" is " +
"> 0.\n" +
" \"txrate\": x.xx, (numeric) The average rate of " +
"transactions per second in the window. Only returned if " +
"\"window_interval\" is > 0.\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getchaintxstats") +
HelpExampleRPC("getchaintxstats")
getdifficultyDesc = "getdifficulty\n" +
"\nReturns the proof-of-work difficulty as a " +
"multiple of the minimum difficulty.\n" +
"\nResult:\n" +
"n.nnn (numeric) the proof-of-work " +
"difficulty as a multiple of the minimum " +
"difficulty.\n" +
"\nExamples:\n" +
HelpExampleCli("getdifficulty") +
HelpExampleRPC("getdifficulty")
getmempoolancestorsDesc = "getmempoolancestors txid (verbose)\n" +
"\nIf txid is in the mempool, returns all in-mempool ancestors.\n" +
"\nArguments:\n" +
"1. \"txid\" (string, required) The transaction id " +
"(must be in mempool)\n" +
"2. verbose (boolean, optional, default=false) " +
"True for a json object, false for array of transaction ids\n" +
"\nResult (for verbose=false):\n" +
"[ (json array of strings)\n" +
" \"transactionid\" (string) The transaction id of an " +
"in-mempool ancestor transaction\n" +
" ,...\n" +
"]\n" +
"\nResult (for verbose=true):\n" +
"{ (json object)\n" +
" \"transactionid\" : { (json object)\n" +
" \"size\" : n, (numeric) transaction size.\n" +
" \"fee\" : n, (numeric) transaction fee in " +
"BCH\n" +
" \"modifiedfee\" : n, (numeric) transaction fee with fee " +
"deltas used for mining priority\n" +
" \"time\" : n, (numeric) local time transaction " +
"entered pool in seconds since 1 Jan 1970 GMT\n" +
" \"height\" : n, (numeric) block height when " +
"transaction entered pool\n" +
" \"startingpriority\" : n, (numeric) DEPRECATED. Priority when " +
"transaction entered pool\n" +
" \"currentpriority\" : n, (numeric) DEPRECATED. Transaction " +
"priority now\n" +
" \"descendantcount\" : n, (numeric) number of in-mempool " +
"descendant transactions (including this one)\n" +
" \"descendantsize\" : n, (numeric) virtual transaction size " +
"of in-mempool descendants (including this one)\n" +
" \"descendantfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool descendants (including this one)\n" +
" \"ancestorcount\" : n, (numeric) number of in-mempool " +
"ancestor transactions (including this one)\n" +
" \"ancestorsize\" : n, (numeric) virtual transaction size " +
"of in-mempool ancestors (including this one)\n" +
" \"ancestorfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool ancestors (including this one)\n" +
" \"depends\" : [ (array) unconfirmed transactions " +
"used as inputs for this transaction\n" +
" \"transactionid\", (string) parent transaction id\n" +
" ... ]\n" +
" }, ...\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getmempoolancestors", "\"mytxid\"") +
HelpExampleRPC("getmempoolancestors", "\"mytxid\"")
getmempooldescendantsDesc = "getmempooldescendants txid (verbose)\n" +
"\nIf txid is in the mempool, returns all in-mempool descendants.\n" +
"\nArguments:\n" +
"1. \"txid\" (string, required) The transaction id " +
"(must be in mempool)\n" +
"2. verbose (boolean, optional, default=false) " +
"True for a json object, false for array of transaction ids\n" +
"\nResult (for verbose=false):\n" +
"[ (json array of strings)\n" +
" \"transactionid\" (string) The transaction id of an " +
"in-mempool descendant transaction\n" +
" ,...\n" +
"]\n" +
"\nResult (for verbose=true):\n" +
"{ (json object)\n" +
" \"transactionid\" : { (json object)\n" +
" \"size\" : n, (numeric) transaction size.\n" +
" \"fee\" : n, (numeric) transaction fee in " +
"BCH\n" +
" \"modifiedfee\" : n, (numeric) transaction fee with fee " +
"deltas used for mining priority\n" +
" \"time\" : n, (numeric) local time transaction " +
"entered pool in seconds since 1 Jan 1970 GMT\n" +
" \"height\" : n, (numeric) block height when " +
"transaction entered pool\n" +
" \"startingpriority\" : n, (numeric) DEPRECATED. Priority when " +
"transaction entered pool\n" +
" \"currentpriority\" : n, (numeric) DEPRECATED. Transaction " +
"priority now\n" +
" \"descendantcount\" : n, (numeric) number of in-mempool " +
"descendant transactions (including this one)\n" +
" \"descendantsize\" : n, (numeric) virtual transaction size " +
"of in-mempool descendants (including this one)\n" +
" \"descendantfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool descendants (including this one)\n" +
" \"ancestorcount\" : n, (numeric) number of in-mempool " +
"ancestor transactions (including this one)\n" +
" \"ancestorsize\" : n, (numeric) virtual transaction size " +
"of in-mempool ancestors (including this one)\n" +
" \"ancestorfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool ancestors (including this one)\n" +
" \"depends\" : [ (array) unconfirmed transactions " +
"used as inputs for this transaction\n" +
" \"transactionid\", (string) parent transaction id\n" +
" ... ]\n" +
" }, ...\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getmempooldescendants", "\"mytxid\"") +
HelpExampleRPC("getmempooldescendants", "\"mytxid\"")
getmempoolentryDesc = "getmempoolentry txid\n" +
"\nReturns mempool data for given transaction\n" +
"\nArguments:\n" +
"1. \"txid\" (string, required) " +
"The transaction id (must be in mempool)\n" +
"\nResult:\n" +
"{ (json object)\n" +
" \"size\" : n, (numeric) transaction size.\n" +
" \"fee\" : n, (numeric) transaction fee in " +
"BCH\n" +
" \"modifiedfee\" : n, (numeric) transaction fee with fee " +
"deltas used for mining priority\n" +
" \"time\" : n, (numeric) local time transaction " +
"entered pool in seconds since 1 Jan 1970 GMT\n" +
" \"height\" : n, (numeric) block height when " +
"transaction entered pool\n" +
" \"startingpriority\" : n, (numeric) DEPRECATED. Priority when " +
"transaction entered pool\n" +
" \"currentpriority\" : n, (numeric) DEPRECATED. Transaction " +
"priority now\n" +
" \"descendantcount\" : n, (numeric) number of in-mempool " +
"descendant transactions (including this one)\n" +
" \"descendantsize\" : n, (numeric) virtual transaction size " +
"of in-mempool descendants (including this one)\n" +
" \"descendantfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool descendants (including this one)\n" +
" \"ancestorcount\" : n, (numeric) number of in-mempool " +
"ancestor transactions (including this one)\n" +
" \"ancestorsize\" : n, (numeric) virtual transaction size " +
"of in-mempool ancestors (including this one)\n" +
" \"ancestorfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool ancestors (including this one)\n" +
" \"depends\" : [ (array) unconfirmed transactions " +
"used as inputs for this transaction\n" +
" \"transactionid\", (string) parent transaction id\n" +
" ... ]\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getmempoolentry", "\"mytxid\"") +
HelpExampleRPC("getmempoolentry", "\"mytxid\"")
getmempoolinfoDesc = "getmempoolinfo\n" +
"\nReturns details on the active state of the TX memory pool.\n" +
"\nResult:\n" +
"{\n" +
" \"size\": xxxxx, (numeric) Current tx count\n" +
" \"bytes\": xxxxx, (numeric) Transaction size.\n" +
" \"usage\": xxxxx, (numeric) Total memory usage for " +
"the mempool\n" +
" \"maxmempool\": xxxxx, (numeric) Maximum memory usage " +
"for the mempool\n" +
" \"mempoolminfee\": xxxxx (numeric) Minimum fee for tx to " +
"be accepted\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getmempoolinfo") +
HelpExampleRPC("getmempoolinfo")
getrawmempoolDesc = "getrawmempool ( verbose )\n" +
"\nReturns all transaction ids in memory pool as a json array of " +
"string transaction ids.\n" +
"\nArguments:\n" +
"1. verbose (boolean, optional, default=false) True for a json " +
"object, false for array of transaction ids\n" +
"\nResult: (for verbose = false):\n" +
"[ (json array of string)\n" +
" \"transactionid\" (string) The transaction id\n" +
" ,...\n" +
"]\n" +
"\nResult: (for verbose = true):\n" +
"{ (json object)\n" +
" \"transactionid\" : { (json object)\n" +
" \"size\" : n, (numeric) transaction size.\n" +
" \"fee\" : n, (numeric) transaction fee in " +
"BCH\n" +
" \"modifiedfee\" : n, (numeric) transaction fee with fee " +
"deltas used for mining priority\n" +
" \"time\" : n, (numeric) local time transaction " +
"entered pool in seconds since 1 Jan 1970 GMT\n" +
" \"height\" : n, (numeric) block height when " +
"transaction entered pool\n" +
" \"startingpriority\" : n, (numeric) DEPRECATED. Priority when " +
"transaction entered pool\n" +
" \"currentpriority\" : n, (numeric) DEPRECATED. Transaction " +
"priority now\n" +
" \"descendantcount\" : n, (numeric) number of in-mempool " +
"descendant transactions (including this one)\n" +
" \"descendantsize\" : n, (numeric) virtual transaction size " +
"of in-mempool descendants (including this one)\n" +
" \"descendantfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool descendants (including this one)\n" +
" \"ancestorcount\" : n, (numeric) number of in-mempool " +
"ancestor transactions (including this one)\n" +
" \"ancestorsize\" : n, (numeric) virtual transaction size " +
"of in-mempool ancestors (including this one)\n" +
" \"ancestorfees\" : n, (numeric) modified fees (see above) " +
"of in-mempool ancestors (including this one)\n" +
" \"depends\" : [ (array) unconfirmed transactions " +
"used as inputs for this transaction\n" +
" \"transactionid\", (string) parent transaction id\n" +
" ... ]\n" +
" }, ...\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getrawmempool") +
HelpExampleRPC("getrawmempool")
gettxoutDesc = "gettxout \"txid\" n ( include_mempool )\n" +
"\nReturns details about an unspent transaction output.\n" +
"\nArguments:\n" +
"1. \"txid\" (string, required) The transaction id\n" +
"2. n (numeric, required) vout number\n" +
"3. include_mempool (boolean, optional) Whether to include the " +
"mempool. Default: true. " +
"Note that an unspent output that is spent in the mempool won't appear.\n" +
"\nResult:\n" +
"{\n" +
" \"bestblock\" : \"hash\", (string) the block hash\n" +
" \"confirmations\" : n, (numeric) The number of " +
"confirmations\n" +
" \"value\" : x.xxx, (numeric) The transaction value " +
"in " +
"BCH\n" +
" \"scriptPubKey\" : { (json object)\n" +
" \"asm\" : \"code\", (string) \n" +
" \"hex\" : \"hex\", (string) \n" +
" \"reqSigs\" : n, (numeric) Number of required " +
"signatures\n" +
" \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n" +
" \"addresses\" : [ (array of string) array of " +
"bitcoin addresses\n" +
" \"address\" (string) bitcoin address\n" +
" ,...\n" +
" ]\n" +
" },\n" +
" \"coinbase\" : true|false (boolean) Coinbase or not\n" +
"}\n" +
"\nExamples:\n" +
"\nGet unspent transactions\n" +
HelpExampleCli("listunspent") +
"\nView the details\n" +
HelpExampleCli("gettxout", "\"txid\"", "1") +
"\nAs a json rpc call\n" +
HelpExampleRPC("gettxout", "\"txid\"", "1")
gettxoutsetinfoDesc = "gettxoutsetinfo\n" +
"\nReturns statistics about the unspent transaction output set.\n" +
"Note this call may take some time.\n" +
"\nResult:\n" +
"{\n" +
" \"height\":n, (numeric) The current block height (index)\n" +
" \"bestblock\": \"hex\", (string) the best block hash hex\n" +
" \"transactions\": n, (numeric) The number of transactions\n" +
" \"txouts\": n, (numeric) The number of output " +
"transactions\n" +
" \"bogosize\": n, (numeric) A database-independent " +
"metric for UTXO set size\n" +
" \"hash_serialized\": \"hash\", (string) The serialized hash\n" +
" \"disk_size\": n, (numeric) The estimated size of the " +
"chainstate on disk\n" +
" \"total_amount\": x.xxx (numeric) The total amount\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("gettxoutsetinfo") +
HelpExampleRPC("gettxoutsetinfo")
pruneblockchainDesc = "pruneblockchain\n" +
"\nArguments:\n" +
"1. \"height\" (numeric, required) The block height to prune " +
"up to. May be set to a discrete height, or a unix timestamp\n" +
" to prune blocks whose block time is at least 2 " +
"hours older than the provided timestamp.\n" +
"\nResult:\n" +
"n (numeric) Height of the last block pruned.\n" +
"\nExamples:\n" +
HelpExampleCli("pruneblockchain", "1000") +
HelpExampleRPC("pruneblockchain", "1000")
verifychainDesc = "verifychain ( checklevel nblocks )\n" +
"\nVerifies blockchain database.\n" +
"\nArguments:\n" +
"1. checklevel (numeric, optional, 0-4, default=3)" +
" How thorough the block verification is.\n" +
"2. nblocks (numeric, optional, default=6 , 0=all) " +
"The number of blocks to check.\n" +
"\nResult:\n" +
"true|false (boolean) Verified or not\n" +
"\nExamples:\n" +
HelpExampleCli("verifychain") +
HelpExampleRPC("verifychain")
preciousblockDesc = "preciousblock \"blockhash\"\n" +
"\nTreats a block as if it were received before others with the " +
"same work.\n" +
"\nA later preciousblock call can override the effect of an " +
"earlier one.\n" +
"\nThe effects of preciousblock are not retained across restarts.\n" +
"\nArguments:\n" +
"1. \"blockhash\" (string, required) the hash of the block to " +
"mark as precious\n" +
"\nResult:\n" +
"\nExamples:\n" +
HelpExampleCli("preciousblock", "\"blockhash\"") +
HelpExampleRPC("preciousblock", "\"blockhash\"")
waitforblockheightDesc = "waitforblockheight \"height\" (timeout)\n" +
"\nWaits for (at least) block height and returns the height and " +
"hash\n" +
"of the current tip.\n" +
"\nReturns the current block on timeout or exit.\n" +
"\nArguments:\n" +
"1. height (required, int) Block height to wait for (int)\n" +
"2. timeout (int, optional, default=0) Time in milliseconds to " +
"wait for a response. 0 indicates no timeout.\n" +
"\nResult:\n" +
"{ (json object)\n" +
" \"hash\" : { (string) The blockhash\n" +
" \"height\" : { (int) Block height\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("waitforblockheight", "\"height\"") +
HelpExampleRPC("waitforblockheight", "\"height\"")
waitforblockDesc = "waitforblock <blockhash> (timeout)\n" +
"\nWaits for a specific new block and returns useful info about " +
"it.\n" +
"\nReturns the current block on timeout or exit.\n" +
"\nArguments:\n" +
"1. \"blockhash\" (required, string) Block hash to wait for.\n" +
"2. timeout (int, optional, default=0) Time in milliseconds " +
"to wait for a response. 0 indicates no timeout.\n" +
"\nResult:\n" +
"{ (json object)\n" +
" \"hash\" : { (string) The blockhash\n" +
" \"height\" : { (int) Block height\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("waitforblock", "\"blockhash\"") +
HelpExampleRPC("waitforblock", "\"blockhash\"")
)
//mining
var (
getnetworkhashpsDesc = "getnetworkhashps ( nblocks height )\n" +
"\nReturns the estimated network hashes per second based on the " +
"last n blocks.\n" +
"Pass in [blocks] to override # of blocks, -1 specifies since last " +
"difficulty change.\n" +
"Pass in [height] to estimate the network speed at the time when a " +
"certain block was found.\n" +
"\nArguments:\n" +
"1. nblocks (numeric, optional, default=120) The number of " +
"blocks, or -1 for blocks since last difficulty change.\n" +
"2. height (numeric, optional, default=-1) To estimate at the " +
"time of the given height.\n" +
"\nResult:\n" +
"x (numeric) Hashes per second estimated\n" +
"\nExamples:\n" +
HelpExampleCli("getnetworkhashps") +
HelpExampleRPC("getnetworkhashps")
getmininginfoDesc = "getmininginfo\n" +
"\nReturns a json object containing mining-related information." +
"\nResult:\n" +
"{\n" +
" \"blocks\": nnn, (numeric) The current block\n" +
" \"currentblocksize\": nnn, (numeric) The last block size\n" +
" \"currentblocktx\": nnn, (numeric) The last block " +
"transaction\n" +
" \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n" +
" \"errors\": \"...\" (string) Current errors\n" +
" \"networkhashps\": nnn, (numeric) The network hashes per " +
"second\n" +
" \"pooledtx\": n (numeric) The size of the mempool\n" +
" \"chain\": \"xxxx\", (string) current network name as " +
"defined in BIP70 (main, test, regtest)\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getmininginfo") +
HelpExampleRPC("getmininginfo")
prioritisetransactionDesc = "prioritisetransaction <txid> <priority delta> <fee delta>\n" +
"Accepts the transaction into mined blocks at a higher (or lower) " +
"priority\n" +
"\nArguments:\n" +
"1. \"txid\" (string, required) The transaction id.\n" +
"2. priority_delta (numeric, required) The priority to add or " +
"subtract.\n" +
" The transaction selection algorithm considers " +
"the tx as it would have a higher priority.\n" +
" (priority of a transaction is calculated: " +
"coinage * value_in_satoshis / txsize) \n" +
"3. fee_delta (numeric, required) The fee value (in satoshis) " +
"to add (or subtract, if negative).\n" +
" The fee is not actually paid, only the " +
"algorithm for selecting transactions into a block\n" +
" considers the transaction as it would have paid " +
"a higher (or lower) fee.\n" +
"\nResult:\n" +
"true (boolean) Returns true\n" +
"\nExamples:\n" +
HelpExampleCli("prioritisetransaction", "\"txid\"", "0.0", "10000") +
HelpExampleRPC("prioritisetransaction", "\"txid\"", "0.0", "10000")
getblocktemplateDesc = "getblocktemplate ( TemplateRequest )\n" +
"\nIf the request parameters include a 'mode' key, that is used to " +
"explicitly select between the default 'template' request or a " +
"'proposal'.\n" +
"It returns data needed to construct a block to work on.\n" +
"For full specification, see BIPs 22, 23, 9, and 145:\n" +
" " +
"https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki\n" +
" " +
"https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\n" +
" " +
"https://github.com/bitcoin/bips/blob/master/" +
"bip-0009.mediawiki#getblocktemplate_changes\n" +
" " +
"https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\n" +
"\nArguments:\n" +
"1. template_request (json object, optional) A json object " +
"in the following spec\n" +
" {\n" +
" \"mode\":\"template\" (string, optional) This must be " +
"set to \"template\", \"proposal\" (see BIP 23), or omitted\n" +
" \"capabilities\":[ (array, optional) A list of " +
"strings\n" +
" \"support\" (string) client side supported " +
"feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', " +
"'serverlist', 'workid'\n" +
" ,...\n" +
" ],\n" +
" \"rules\":[ (array, optional) A list of " +
"strings\n" +
" \"support\" (string) client side supported " +
"softfork deployment\n" +
" ,...\n" +
" ]\n" +
" }\n" +
"\n" +
"\nResult:\n" +
"{\n" +
" \"version\" : n, (numeric) The preferred " +
"block version\n" +
" \"rules\" : [ \"rulename\", ... ], (array of strings) " +
"specific block rules that are to be enforced\n" +
" \"vbavailable\" : { (json object) set of " +
"pending, supported versionbit (BIP 9) softfork deployments\n" +
" \"rulename\" : bitnumber (numeric) identifies the " +
"bit number as indicating acceptance and readiness for the named " +
"softfork rule\n" +
" ,...\n" +
" },\n" +
" \"vbrequired\" : n, (numeric) bit mask of " +
"versionbits the server requires set in submissions\n" +
" \"previousblockhash\" : \"xxxx\", (string) The hash of " +
"current highest block\n" +
" \"transactions\" : [ (array) contents of " +
"non-coinbase transactions that should be included in the next " +
"block\n" +
" {\n" +
" \"data\" : \"xxxx\", (string) transaction " +
"data encoded in hexadecimal (byte-for-byte)\n" +
" \"txid\" : \"xxxx\", (string) transaction id " +
"encoded in little-endian hexadecimal\n" +
" \"hash\" : \"xxxx\", (string) hash encoded " +
"in little-endian hexadecimal (including witness data)\n" +
" \"depends\" : [ (array) array of numbers " +
"\n" +
" n (numeric) transactions " +
"before this one (by 1-based index in 'transactions' list) that " +
"must be present in the final block if this one is\n" +
" ,...\n" +
" ],\n" +
" \"fee\": n, (numeric) difference in " +
"value between transaction inputs and outputs (in Satoshis); for " +
"coinbase transactions, this is a negative Number of the total " +
"collected block fees (ie, not including the block subsidy); if " +
"key is not present, fee is unknown and clients MUST NOT assume " +
"there isn't one\n" +
" \"sigops\" : n, (numeric) total SigOps " +
"cost, as counted for purposes of block limits; if key is not " +
"present, sigop cost is unknown and clients MUST NOT assume it is " +
"zero\n" +
" \"required\" : true|false (boolean) if provided and " +
"true, this transaction must be in the final block\n" +
" }\n" +
" ,...\n" +
" ],\n" +
" \"coinbaseaux\" : { (json object) data that " +
"should be included in the coinbase's scriptSig content\n" +
" \"flags\" : \"xx\" (string) key name is to " +
"be ignored, and value included in scriptSig\n" +
" },\n" +
" \"coinbasevalue\" : n, (numeric) maximum allowable " +
"input to coinbase transaction, including the generation award and " +
"transaction fees (in Satoshis)\n" +
" \"coinbasetxn\" : { ... }, (json object) information " +
"for coinbase transaction\n" +
" \"target\" : \"xxxx\", (string) The hash target\n" +
" \"mintime\" : xxx, (numeric) The minimum " +
"timestamp appropriate for next block time in seconds since epoch " +
"(Jan 1 1970 GMT)\n" +
" \"mutable\" : [ (array of string) list of " +
"ways the block template may be changed \n" +
" \"value\" (string) A way the block " +
"template may be changed, e.g. 'time', 'transactions', " +
"'prevblock'\n" +
" ,...\n" +
" ],\n" +
" \"noncerange\" : \"00000000ffffffff\",(string) A range of valid " +
"nonces\n" +
" \"sigoplimit\" : n, (numeric) limit of sigops " +
"in blocks\n" +
" \"sizelimit\" : n, (numeric) limit of block " +
"size\n" +
" \"curtime\" : ttt, (numeric) current timestamp " +
"in seconds since epoch (Jan 1 1970 GMT)\n" +
" \"bits\" : \"xxxxxxxx\", (string) compressed " +
"target of next block\n" +
" \"height\" : n (numeric) The height of the " +
"next block\n" +
"}\n" +
"\nExamples:\n" +
HelpExampleCli("getblocktemplate") +
HelpExampleRPC("getblocktemplate")
submitblockDesc = "submitblock \"hexdata\" ( \"jsonparametersobject\" )\n" +
"\nAttempts to submit new block to network.\n" +
"The 'jsonparametersobject' parameter is currently ignored.\n" +
"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n" +
"\nArguments\n" +
"1. \"hexdata\" (string, required) the hex-encoded block " +
"data to submit\n" +
"2. \"parameters\" (string, optional) object of optional " +
"parameters\n" +
" {\n" +
" \"workid\" : \"id\" (string, optional) if the server " +
"provided a workid, it MUST be included with submissions\n" +
" }\n" +
"\nResult:\n" +
"\nExamples:\n" +
HelpExampleCli("submitblock", "\"mydata\"") +
HelpExampleRPC("submitblock", "\"mydata\"")
generateDesc = "generate nblocks ( maxtries )\n" +
"\nMine up to nblocks blocks immediately (before the RPC call " +
"returns)\n" +
"\nArguments:\n" +
"1. nblocks (numeric, required) How many blocks are generated " +
"immediately.\n" +
"2. maxtries (numeric, optional) How many iterations to try " +
"(default = 1000000).\n" +
"\nResult:\n" +
"[ blockhashes ] (array) hashes of blocks generated\n" +
"\nExamples:\n" +
"\nGenerate 11 blocks\n" +
HelpExampleCli("generate", "11") +
HelpExampleRPC("generate", "11")
generatetoaddressDesc = "generatetoaddress nblocks address (maxtries)\n" +
"\nMine blocks immediately to a specified address (before the RPC " +
"call returns)\n" +
"\nArguments:\n" +
"1. nblocks (numeric, required) How many blocks are generated " +
"immediately.\n" +
"2. address (string, required) The address to send the newly " +
"generated bitcoin to.\n" +
"3. maxtries (numeric, optional) How many iterations to try " +
"(default = 1000000).\n" +
"\nResult:\n" +
"[ blockhashes ] (array) hashes of blocks generated\n" +
"\nExamples:\n" +
HelpExampleCli("generatetoaddress", "11", "\"myaddress\"") +
HelpExampleRPC("generatetoaddress", "11", "\"myaddress\"")
)
// net
var (
getconnectioncountDesc = "getconnectioncount\n" +
"\nReturns the number of connections to other nodes.\n" +
"\nResult:\n" +
"n (numeric) The connection count\n" +
"\nExamples:\n" +
HelpExampleCli("getconnectioncount") +
HelpExampleRPC("getconnectioncount")
pingDesc = "ping\n" +
"\nRequests that a ping be sent to all other nodes, to measure " +
"ping time.\n" +
"Results provided in getpeerinfo, pingtime and pingwait fields are " +
"decimal seconds.\n" +
"Ping command is handled in queue with all other commands, so it " +
"measures processing backlog, not just network ping.\n" +
"\nExamples:\n" +
HelpExampleCli("ping") +
HelpExampleRPC("ping")
getpeerinfoDesc = "getpeerinfo\n" +
"\nReturns data about each connected network node as a json array " +
"of objects.\n" +
"\nResult:\n" +
"[\n" +
" {\n" +
" \"id\": n, (numeric) Peer index\n" +
" \"addr\":\"host:port\", (string) The ip address and port " +
"of the peer\n" +
" \"addrlocal\":\"ip:port\", (string) local address\n" +
" \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services " +
"offered\n" +
" \"relaytxes\":true|false, (boolean) Whether peer has asked " +
"us to relay transactions to it\n" +
" \"lastsend\": ttt, (numeric) The time in seconds " +
"since epoch (Jan 1 1970 GMT) of the last send\n" +
" \"lastrecv\": ttt, (numeric) The time in seconds " +
"since epoch (Jan 1 1970 GMT) of the last receive\n" +
" \"bytessent\": n, (numeric) The total bytes sent\n" +
" \"bytesrecv\": n, (numeric) The total bytes " +
"received\n" +
" \"conntime\": ttt, (numeric) The connection time in " +
"seconds since epoch (Jan 1 1970 GMT)\n" +
" \"timeoffset\": ttt, (numeric) The time offset in " +
"seconds\n" +
" \"pingtime\": n, (numeric) ping time (if " +
"available)\n" +
" \"minping\": n, (numeric) minimum observed ping " +
"time (if any at all)\n" +
" \"pingwait\": n, (numeric) ping wait (if " +
"non-zero)\n" +
" \"version\": v, (numeric) The peer version, such " +
"as 7001\n" +
" \"subver\": \"/Satoshi:0.8.5/\", (string) The string " +
"version\n" +
" \"inbound\": true|false, (boolean) Inbound (true) or " +
"Outbound (false)\n" +
" \"addnode\": true|false, (boolean) Whether connection was " +
"due to addnode and is using an addnode slot\n" +
" \"startingheight\": n, (numeric) The starting height " +
"(block) of the peer\n" +
" \"banscore\": n, (numeric) The ban score\n" +
" \"synced_headers\": n, (numeric) The last header we " +
"have in common with this peer\n" +
" \"synced_blocks\": n, (numeric) The last block we have " +
"in common with this peer\n" +
" \"inflight\": [\n" +
" n, (numeric) The heights of blocks " +
"we're currently asking from this peer\n" +
" ...\n" +
" ],\n" +
" \"whitelisted\": true|false, (boolean) Whether the peer is " +
"whitelisted\n" +
" \"bytessent_per_msg\": {\n" +
" \"addr\": n, (numeric) The total bytes sent " +
"aggregated by message type\n" +
" ...\n" +
" },\n" +
" \"bytesrecv_per_msg\": {\n" +
" \"addr\": n, (numeric) The total bytes " +
"received aggregated by message type\n" +
" ...\n" +
" }\n" +
" }\n" +
" ,...\n" +
"]\n" +
"\nExamples:\n" +
HelpExampleCli("getpeerinfo") +
HelpExampleRPC("getpeerinfo")
addnodeDesc = "addnode \"node\" \"add|remove|onetry\"\n" +
"\nAttempts add or remove a node from the addnode list.\n" +
"Or try a connection to a node once.\n" +
"\nArguments:\n" +
"1. \"node\" (string, required) The node (see getpeerinfo for " +
"nodes)\n" +
"2. \"command\" (string, required) 'add' to add a node to the " +
"list, 'remove' to remove a node from the list, 'onetry' to try a " +
"connection to the node once\n" +
"\nExamples:\n" +
HelpExampleCli("addnode", "\"192.168.0.6:8333\"", "\"onetry\"") +
HelpExampleRPC("addnode", "\"192.168.0.6:8333\"", "\"onetry\"")
disconnectnodeDesc = "disconnectnode \"[address]\" [nodeid]\n" +
"\nImmediately disconnects from the specified peer node.\n" +
"\nStrictly one out of 'address' and 'nodeid' can be provided to " +
"identify the node.\n" +
"\nTo disconnect by nodeid, either set 'address' to the empty " +
"string, or call using the named 'nodeid' argument only.\n" +
"\nArguments:\n" +
"1. \"address\" (string, optional) The IP address/port of the " +
"node\n" +
"2. \"nodeid\" (number, optional) The node ID (see " +
"getpeerinfo for node IDs)\n" +
"\nExamples:\n" +
HelpExampleCli("disconnectnode", "\"192.168.0.6:8333\"") +
HelpExampleCli("disconnectnode", "\"\"", "1") +
HelpExampleRPC("disconnectnode", "\"192.168.0.6:8333\"") +
HelpExampleRPC("disconnectnode", "\"\"", "1")
getaddednodeinfoDesc = "getaddednodeinfo ( \"node\" )\n" +