forked from libbitcoin/libbitcoin-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparser.cpp
More file actions
1778 lines (1696 loc) · 61.6 KB
/
parser.cpp
File metadata and controls
1778 lines (1696 loc) · 61.6 KB
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
/**
* Copyright (c) 2011-2026 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <bitcoin/server/parser.hpp>
#include <filesystem>
#include <bitcoin/server/configuration.hpp>
#include <bitcoin/server/define.hpp>
#include <bitcoin/server/settings.hpp>
////std::filesystem::path config_default_path() NOEXCEPT
////{
//// return { "libbitcoin/bn.cfg" };
////}
namespace libbitcoin {
namespace server {
using namespace bc::system;
using namespace bc::system::config;
using namespace boost::program_options;
// Initialize configuration using defaults of the given context.
parser::parser(system::chain::selection context,
const server::settings::embedded_pages& native,
const server::settings::embedded_pages& admin) NOEXCEPT
: configured(context, native, admin)
{
// node
configured.node.threads = 32;
// network
using level = network::messages::peer::level;
using service = network::messages::peer::service;
configured.network.threads = 16;
configured.network.enable_relay = true;
configured.network.enable_address = true;
configured.network.enable_address_v2 = false;
configured.network.enable_witness_tx = false;
configured.network.enable_compact = false;
configured.network.outbound.host_pool_capacity = 10000;
configured.network.outbound.connections = 100;
configured.network.inbound.connections = 100;
configured.network.maximum_skew_minutes = 120;
configured.network.protocol_minimum = level::headers_protocol;
configured.network.protocol_maximum = level::bip130;
// services_minimum must be node_witness to be a witness node.
configured.network.services_minimum = service::node_network | service::node_witness;
configured.network.services_maximum = service::node_network | service::node_witness;
// TODO: from bitcoind, revert to defaults when seeds are up.
configured.network.outbound.seeds.clear();
configured.network.outbound.seeds.emplace_back("seed.bitcoin.sipa.be", 8333_u16);
configured.network.outbound.seeds.emplace_back("dnsseed.bluematt.me", 8333_u16);
////configured.network.outbound.seeds.emplace_back("dnsseed.bitcoin.dashjr-list-of-p2p-nodes.us", 8333_u16);
configured.network.outbound.seeds.emplace_back("seed.bitcoin.jonasschnelli.ch", 8333_u16);
configured.network.outbound.seeds.emplace_back("seed.btc.petertodd.net", 8333_u16);
configured.network.outbound.seeds.emplace_back("seed.bitcoin.sprovoost.nl", 8333_u16);
configured.network.outbound.seeds.emplace_back("dnsseed.emzy.de", 8333_u16);
configured.network.outbound.seeds.emplace_back("seed.bitcoin.wiz.biz", 8333_u16);
configured.network.outbound.seeds.emplace_back("seed.mainnet.achownodes.xyz", 8333_u16);
// server
////configured.server.admin.binds.emplace_back(asio::address{}, 8080_u16);
////configured.server.admin.safes.emplace_back(asio::address{}, 8043_u16);
////configured.server.native.binds.emplace_back(asio::address{}, 8180_u16);
////configured.server.native.safes.emplace_back(asio::address{}, 8143_u16);
////configured.server.bitcoind.binds.emplace_back(asio::address{}, 8280_u16);
////configured.server.bitcoind.safes.emplace_back(asio::address{}, 8243_u16);
////configured.server.electrum.binds.emplace_back(asio::address{}, 8380_u16);
////configured.server.electrum.safes.emplace_back(asio::address{}, 8343_u16);
////configured.server.stratum_v1.binds.emplace_back(asio::address{}, 8480_u16);
////configured.server.stratum_v1.safes.emplace_back(asio::address{}, 8443_u16);
////configured.server.stratum_v2.binds.emplace_back(asio::address{}, 8580_u16);
// SCALE: LF2.2 @ 850K.
// database (archive)
configured.database.header_buckets = 386'364;
configured.database.header_size = 21'000'000;
configured.database.header_rate = 5;
configured.database.input_size = 92'500'000'000;
configured.database.input_rate = 5;
configured.database.output_size = 25'300'000'000;
configured.database.output_rate = 5;
// point table set to 2.2LF @ ~900k.
configured.database.point_buckets = 1'365'977'136;
configured.database.point_size = 25'700'000'000;
configured.database.point_rate = 5;
configured.database.ins_size = 8'550'000'000;
configured.database.ins_rate = 5;
configured.database.outs_size = 3'700'000'000;
configured.database.outs_rate = 5;
configured.database.tx_buckets = 469'222'525;
configured.database.tx_size = 17'000'000'000;
configured.database.tx_rate = 5;
configured.database.txs_buckets = 900'001;
configured.database.txs_size = 1'050'000'000;
configured.database.txs_rate = 5;
// database (indexes)
configured.database.candidate_size = 2'575'500;
configured.database.candidate_rate = 5;
configured.database.confirmed_size = 2'575'500;
configured.database.confirmed_rate = 5;
configured.database.strong_tx_buckets = 469'222'525;
configured.database.strong_tx_size = 2'900'000'000;
configured.database.strong_tx_rate = 5;
// database (caches)
configured.database.duplicate_buckets = 1024;
configured.database.duplicate_size = 44;
configured.database.duplicate_rate = 5;
configured.database.prevout_buckets = 0;
configured.database.prevout_size = 1;
configured.database.prevout_rate = 5;
configured.database.validated_bk_buckets = 900'001;
configured.database.validated_bk_size = 1'700'000;
configured.database.validated_bk_rate = 5;
configured.database.validated_tx_buckets = 1;
configured.database.validated_tx_size = 1;
configured.database.validated_tx_rate = 5;
// database (optionals)
configured.database.address_buckets = 1;
configured.database.address_size = 1;
configured.database.address_rate = 5;
// also disabled by filter_tx
configured.database.filter_bk_buckets = 0;
configured.database.filter_bk_size = 1;
configured.database.filter_bk_rate = 5;
// also disabled by filter_bk
configured.database.filter_tx_buckets = 0;
configured.database.filter_tx_size = 1;
configured.database.filter_tx_rate = 5;
}
options_metadata parser::load_options() THROWS
{
options_metadata description("options");
description.add_options()
(
BS_CONFIG_VARIABLE ",c",
value<std::filesystem::path>(&configured.file),
"Specify path to a configuration settings file."
)
// Information.
(
BS_HELP_VARIABLE ",h",
value<bool>(&configured.help)->
default_value(false)->zero_tokens(),
"Display command line options."
)
(
BS_HARDWARE_VARIABLE ",d",
value<bool>(&configured.hardware)->
default_value(false)->zero_tokens(),
"Display hardware compatibility."
)
(
BS_SETTINGS_VARIABLE ",s",
value<bool>(&configured.settings)->
default_value(false)->zero_tokens(),
"Display all configuration settings."
)
(
BS_VERSION_VARIABLE ",v",
value<bool>(&configured.version)->
default_value(false)->zero_tokens(),
"Display version information."
)
// Actions.
(
BS_NEWSTORE_VARIABLE ",n",
value<bool>(&configured.newstore)->
default_value(false)->zero_tokens(),
"Create new store in configured directory."
)
(
BS_BACKUP_VARIABLE ",b",
value<bool>(&configured.backup)->
default_value(false)->zero_tokens(),
"Backup to a snapshot (can also do live)."
)
(
BS_RESTORE_VARIABLE ",r",
value<bool>(&configured.restore)->
default_value(false)->zero_tokens(),
"Restore from most recent snapshot."
)
// Chain scans.
(
BS_FLAGS_VARIABLE ",f",
value<bool>(&configured.flags)->
default_value(false)->zero_tokens(),
"Scan and display all flag transitions."
)
(
BS_SLABS_VARIABLE ",a",
value<bool>(&configured.slabs)->
default_value(false)->zero_tokens(),
"Scan and display store slab measures."
)
(
BS_BUCKETS_VARIABLE ",k",
value<bool>(&configured.buckets)->
default_value(false)->zero_tokens(),
"Scan and display all bucket densities."
)
(
BS_COLLISIONS_VARIABLE ",l",
value<bool>(&configured.collisions)->
default_value(false)->zero_tokens(),
"Scan and display hashmap collision stats (may exceed RAM and result in SIGKILL)."
)
(
BS_INFORMATION_VARIABLE ",i",
value<bool>(&configured.information)->
default_value(false)->zero_tokens(),
"Scan and display store information."
)
// Ad-hoc Testing.
(
BS_READ_VARIABLE ",t",
value<config::hash256>(&configured.test)->
default_value(system::null_hash),
"Run built-in read test and display."
)
(
BS_WRITE_VARIABLE ",w",
value<config::hash256>(&configured.write)->
default_value(system::null_hash),
"Run built-in write test and display."
);
return description;
}
arguments_metadata parser::load_arguments() THROWS
{
arguments_metadata description;
return description
.add(BS_CONFIG_VARIABLE, 1);
}
options_metadata parser::load_environment() THROWS
{
options_metadata description("environment");
description.add_options()
(
// For some reason po requires this to be a lower case name.
// The case must match the other declarations for it to compose.
// This composes with the cmdline options and inits to default path.
BS_CONFIG_VARIABLE,
value<std::filesystem::path>(&configured.file)->composing()
/*->default_value(config_default_path())*/,
"The path to the configuration settings file."
);
return description;
}
options_metadata parser::load_settings() THROWS
{
options_metadata description("settings");
description.add_options()
/* [forks] */
(
"forks.difficult",
value<bool>(&configured.bitcoin.forks.difficult),
"Require difficult blocks, defaults to 'true' (use false for testnet)."
)
(
"forks.retarget",
value<bool>(&configured.bitcoin.forks.retarget),
"Retarget difficulty, defaults to 'true'."
)
(
"forks.bip16",
value<bool>(&configured.bitcoin.forks.bip16),
"Add pay-to-script-hash processing, defaults to 'true' (soft fork)."
)
(
"forks.bip30",
value<bool>(&configured.bitcoin.forks.bip30),
"Disallow collision of unspent transaction hashes, defaults to 'true' (soft fork)."
)
(
"forks.bip34",
value<bool>(&configured.bitcoin.forks.bip34),
"Require coinbase input includes block height, defaults to 'true' (soft fork)."
)
(
"forks.bip42",
value<bool>(&configured.bitcoin.forks.bip42),
"Finite monetary supply, defaults to 'true' (soft fork)."
)
(
"forks.bip66",
value<bool>(&configured.bitcoin.forks.bip66),
"Require strict signature encoding, defaults to 'true' (soft fork)."
)
(
"forks.bip65",
value<bool>(&configured.bitcoin.forks.bip65),
"Add check-locktime-verify op code, defaults to 'true' (soft fork)."
)
(
"forks.bip90",
value<bool>(&configured.bitcoin.forks.bip90),
"Assume bip34, bip65, and bip66 activation if enabled, defaults to 'true' (hard fork)."
)
(
"forks.bip68",
value<bool>(&configured.bitcoin.forks.bip68),
"Add relative locktime enforcement, defaults to 'true' (soft fork)."
)
(
"forks.bip112",
value<bool>(&configured.bitcoin.forks.bip112),
"Add check-sequence-verify op code, defaults to 'true' (soft fork)."
)
(
"forks.bip113",
value<bool>(&configured.bitcoin.forks.bip113),
"Use median time past for locktime, defaults to 'true' (soft fork)."
)
(
"forks.bip141",
value<bool>(&configured.bitcoin.forks.bip141),
"Segregated witness consensus layer, defaults to 'true' (soft fork)."
)
(
"forks.bip143",
value<bool>(&configured.bitcoin.forks.bip143),
"Witness version 0 (segwit), defaults to 'true' (soft fork)."
)
(
"forks.bip147",
value<bool>(&configured.bitcoin.forks.bip147),
"Prevent dummy value malleability, defaults to 'true' (soft fork)."
)
(
"forks.bip341",
value<bool>(&configured.bitcoin.forks.bip341),
"Witness version 1 (taproot), defaults to 'true' (soft fork)."
)
(
"forks.bip342",
value<bool>(&configured.bitcoin.forks.bip342),
"Validation of taproot script, defaults to 'true' (soft fork)."
)
(
"forks.time_warp_patch",
value<bool>(&configured.bitcoin.forks.time_warp_patch),
"Fix time warp bug, defaults to 'false' (hard fork)."
)
(
"forks.retarget_overflow_patch",
value<bool>(&configured.bitcoin.forks.retarget_overflow_patch),
"Fix target overflow for very low difficulty, defaults to 'false' (hard fork)."
)
(
"forks.scrypt_proof_of_work",
value<bool>(&configured.bitcoin.forks.scrypt_proof_of_work),
"Use scrypt hashing for proof of work, defaults to 'false' (hard fork)."
)
/* [bitcoin] */
(
"bitcoin.initial_block_subsidy_bitcoin",
value<uint64_t>(&configured.bitcoin.initial_subsidy_bitcoin),
"The initial block subsidy, defaults to '50'."
)
(
"bitcoin.subsidy_interval",
value<uint32_t>(&configured.bitcoin.subsidy_interval_blocks),
"The subsidy halving period, defaults to '210000'."
)
(
"bitcoin.timestamp_limit_seconds",
value<uint32_t>(&configured.bitcoin.timestamp_limit_seconds),
"The future timestamp allowance, defaults to '7200'."
)
(
"bitcoin.retargeting_factor",
value<uint32_t>(&configured.bitcoin.retargeting_factor),
"The difficulty retargeting factor, defaults to '4'."
)
(
"bitcoin.retargeting_interval_seconds",
value<uint32_t>(&configured.bitcoin.retargeting_interval_seconds),
"The difficulty retargeting period, defaults to '1209600'."
)
(
"bitcoin.block_spacing_seconds",
value<uint32_t>(&configured.bitcoin.block_spacing_seconds),
"The target block period, defaults to '600'."
)
(
"bitcoin.proof_of_work_limit",
value<uint32_t>(&configured.bitcoin.proof_of_work_limit),
"The proof of work limit, defaults to '486604799'."
)
(
"bitcoin.genesis_block",
value<config::block>(&configured.bitcoin.genesis_block),
"The hexideciaml encoding of the genesis block, defaults to mainnet."
)
(
"bitcoin.checkpoint",
value<chain::checkpoints>(&configured.bitcoin.checkpoints),
"The blockchain checkpoints, defaults to the consensus set."
)
// [version properties excluded here]
(
"bitcoin.bip34_activation_threshold",
value<size_t>(&configured.bitcoin.bip34_activation_threshold),
"The number of new version blocks required for bip34 style soft fork activation, defaults to '750'."
)
(
"bitcoin.bip34_enforcement_threshold",
value<size_t>(&configured.bitcoin.bip34_enforcement_threshold),
"The number of new version blocks required for bip34 style soft fork enforcement, defaults to '950'."
)
(
"bitcoin.bip34_activation_sample",
value<size_t>(&configured.bitcoin.bip34_activation_sample),
"The number of blocks considered for bip34 style soft fork activation, defaults to '1000'."
)
(
"bitcoin.bip65_freeze",
value<size_t>(&configured.bitcoin.bip90_bip65_height),
"The block height to freeze the bip65 softfork for bip90, defaults to '388381'."
)
(
"bitcoin.bip66_freeze",
value<size_t>(&configured.bitcoin.bip90_bip66_height),
"The block height to freeze the bip66 softfork for bip90, defaults to '363725'."
)
(
"bitcoin.bip34_freeze",
value<size_t>(&configured.bitcoin.bip90_bip34_height),
"The block height to freeze the bip34 softfork for bip90, defaults to '227931'."
)
(
"bitcoin.bip16_activation_time",
value<uint32_t>(&configured.bitcoin.bip16_activation_time),
"The activation time for bip16 in unix time, defaults to '1333238400'."
)
(
"bitcoin.bip9_bit0_active_checkpoint",
value<chain::checkpoint>(&configured.bitcoin.bip9_bit0_active_checkpoint),
"The hash:height checkpoint for bip9 bit0 activation, defaults to '000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328'."
)
(
"bitcoin.milestone",
value<chain::checkpoint>(&configured.bitcoin.milestone),
"A block presumed to be valid but not required to be present, defaults to '000000000000000000010538edbfd2d5b809a33dd83f284aeea41c6d0d96968a:900000'."
)
(
"bitcoin.minimum_work",
value<config::hash256>(&configured.bitcoin.minimum_work),
"The minimum work for any branch to be considered valid, defaults to '000000000000000000000000000000000000000052b2559353df4117b7348b64'."
)
/* [network] */
(
"network.threads",
value<uint32_t>(&configured.network.threads),
"The minimum number of threads in the network threadpool, defaults to '16'."
)
(
"network.retry_timeout_seconds",
value<uint32_t>(&configured.network.retry_timeout_seconds),
"The time delay for failed connection retry, defaults to '1'."
)
(
"network.connect_timeout_seconds",
value<uint32_t>(&configured.network.connect_timeout_seconds),
"The time limit for connection establishment, defaults to '5'."
)
(
"network.rate_limit",
value<uint32_t>(&configured.network.rate_limit),
"The peer download rate limit (not implemented)."
)
(
"network.blacklist",
value<network::config::authorities>(&configured.network.blacklists),
"IP address to disallow, allows all others, multiple allowed."
)
(
"network.whitelist",
value<network::config::authorities>(&configured.network.whitelists),
"IP address to allow, prohibits all others, multiple allowed."
)
/* [peer] */
(
"peer.address_upper",
value<uint16_t>(&configured.network.address_upper),
"The upper bound for address selection divisor, defaults to '10'."
)
(
"peer.address_lower",
value<uint16_t>(&configured.network.address_lower),
"The lower bound for address selection divisor, defaults to '5'."
)
(
"peer.protocol_maximum",
value<uint32_t>(&configured.network.protocol_maximum),
"The maximum network protocol version, defaults to '70012'."
)
(
"peer.protocol_minimum",
value<uint32_t>(&configured.network.protocol_minimum),
"The minimum network protocol version, defaults to '31800'."
)
(
"peer.services_maximum",
value<uint64_t>(&configured.network.services_maximum),
"The maximum services exposed by network connections, defaults to '9' (full node, witness)."
)
(
"peer.services_minimum",
value<uint64_t>(&configured.network.services_minimum),
"The minimum services exposed by network connections, defaults to '9' (full node, witness)."
)
(
"peer.invalid_services",
value<uint64_t>(&configured.network.invalid_services),
"The advertised services that cause a peer to be dropped, defaults to '176'."
)
(
"peer.enable_address",
value<bool>(&configured.network.enable_address),
"Enable address messages, defaults to 'true'."
)
(
"peer.enable_address_v2",
value<bool>(&configured.network.enable_address_v2),
"Enable address v2 messages, defaults to 'false'."
)
(
"peer.enable_witness_tx",
value<bool>(&configured.network.enable_witness_tx),
"Enable witness transaction identifier relay, defaults to 'false'."
)
(
"peer.enable_compact",
value<bool>(&configured.network.enable_compact),
"Enable compact block messages, defaults to 'false'."
)
(
"peer.enable_alert",
value<bool>(&configured.network.enable_alert),
"Enable alert messages, defaults to 'false'."
)
(
"peer.enable_reject",
value<bool>(&configured.network.enable_reject),
"Enable reject messages, defaults to 'false'."
)
(
"peer.enable_relay",
value<bool>(&configured.network.enable_relay),
"Enable transaction relay, defaults to 'true'."
)
(
"peer.validate_checksum",
value<bool>(&configured.network.validate_checksum),
"Validate the checksum of network messages, defaults to 'false'."
)
(
"peer.identifier",
value<uint32_t>(&configured.network.identifier),
"The magic number for message headers, defaults to '3652501241'."
)
(
"peer.handshake_timeout_seconds",
value<uint32_t>(&configured.network.handshake_timeout_seconds),
"The time limit to complete the connection handshake, defaults to '15'."
)
(
"peer.channel_heartbeat_minutes",
value<uint32_t>(&configured.network.channel_heartbeat_minutes),
"The time between ping messages, defaults to '5'."
)
(
"peer.maximum_skew_minutes",
value<uint32_t>(&configured.network.maximum_skew_minutes),
"The maximum allowable channel clock skew, defaults to '120'."
)
(
"peer.user_agent",
value<std::string>(&configured.network.user_agent),
"The node user agent string, defaults to '" BC_USER_AGENT "'."
)
(
"peer.path",
value<std::filesystem::path>(&configured.network.path),
"The peer address cache file directory, defaults to empty."
)
/* [outbound] */
////(
//// "outbound.bind",
//// value<network::config::authorities>(&configured.network.outbound.binds),
//// "IP address to bind for load balancing, multiple allowed (not implemented)."
////)
(
"outbound.connections",
value<uint16_t>(&configured.network.outbound.connections),
"The target number of outgoing network connections, defaults to '100'."
)
(
"outbound.inactivity_minutes",
value<uint32_t>(&configured.network.outbound.inactivity_minutes),
"The inactivity time limit for any connection, defaults to '10'."
)
(
"outbound.expiration_minutes",
value<uint32_t>(&configured.network.outbound.expiration_minutes),
"The age limit for any connection, defaults to '60'."
)
(
"outbound.minimum_buffer",
value<uint32_t>(&configured.network.outbound.minimum_buffer),
"The minimum retained read buffer size, defaults to '4000000'."
)
(
"outbound.maximum_request",
value<uint32_t>(&configured.network.outbound.maximum_request),
"The maximum allowed request size, defaults to '4000000'."
)
(
"outbound.use_ipv6",
value<bool>(&configured.network.outbound.use_ipv6),
"Use internet protocol version 6 (IPv6) addresses, defaults to 'false'."
)
(
"outbound.seed",
value<network::config::endpoints>(&configured.network.outbound.seeds),
"A seed node for initializing the host pool, multiple allowed."
)
(
"outbound.connect_batch_size",
value<uint16_t>(&configured.network.outbound.connect_batch_size),
"The number of concurrent attempts to establish one connection, defaults to '5'."
)
(
"outbound.host_pool_capacity",
value<uint32_t>(&configured.network.outbound.host_pool_capacity),
"The maximum number of peer hosts in the pool, defaults to '10000'."
)
(
"outbound.seeding_timeout_seconds",
value<uint32_t>(&configured.network.outbound.seeding_timeout_seconds),
"The time limit for obtaining seed connections and addresses, defaults to '30'."
)
(
"outbound.username",
value<std::string>(&configured.network.outbound.username),
"The socks5 proxy username (optional)."
)
(
"outbound.password",
value<std::string>(&configured.network.outbound.password),
"The socks5 proxy password (optional)."
)
(
"outbound.socks",
value<config::endpoint>(&configured.network.outbound.socks),
"The socks5 proxy endpoint (port required)."
)
/* [inbound] */
////(
//// "inbound.secure",
//// value<bool>(&configured.network.inbound.secure),
//// "Require transport layer security, defaults to 'false' (not implemented)."
////)
(
"inbound.bind",
value<network::config::authorities>(&configured.network.inbound.binds),
"IP address to bind for listening, multiple allowed, defaults to '0.0.0.0:8333' (all IPv4)."
)
(
"inbound.connections",
value<uint16_t>(&configured.network.inbound.connections),
"The target number of incoming network connections, defaults to '100'."
)
(
"inbound.inactivity_minutes",
value<uint32_t>(&configured.network.inbound.inactivity_minutes),
"The inactivity time limit for any connection, defaults to '10'."
)
(
"inbound.expiration_minutes",
value<uint32_t>(&configured.network.inbound.expiration_minutes),
"The age limit for any connection, defaults to '60'."
)
(
"inbound.minimum_buffer",
value<uint32_t>(&configured.network.inbound.minimum_buffer),
"The minimum retained read buffer size, defaults to '4000000'."
)
(
"inbound.maximum_request",
value<uint32_t>(&configured.network.inbound.maximum_request),
"The maximum allowed request size, defaults to '4000000'."
)
(
"inbound.enable_loopback",
value<bool>(&configured.network.inbound.enable_loopback),
"Allow connections from the node to itself, defaults to 'false'."
)
(
"inbound.self",
value<network::config::authorities>(&configured.network.inbound.selfs),
"IP address to advertise, multiple allowed."
)
/* [manual] */
////(
//// "manual.secure",
//// value<bool>(&configured.network.manual.secure),
//// "Require transport layer security, defaults to 'false' (not implemented)."
////)
////(
//// "manual.bind",
//// value<network::config::authorities>(&configured.network.manual.binds),
//// "IP address to bind for load balancing, multiple allowed (not implemented)."
////)
////(
//// "manual.connections",
//// value<uint16_t>(&configured.network.manual.connections),
//// "The target number of outgoing manual connections (not implemented)."
////)
(
"manual.inactivity_minutes",
value<uint32_t>(&configured.network.manual.inactivity_minutes),
"The inactivity time limit for any connection, defaults to '10' (will attempt reconnect)."
)
(
"manual.expiration_minutes",
value<uint32_t>(&configured.network.manual.expiration_minutes),
"The age limit for any connection, defaults to '60' (will attempt reconnect)."
)
(
"manual.minimum_buffer",
value<uint32_t>(&configured.network.manual.minimum_buffer),
"The minimum retained read buffer size, defaults to '4000000'."
)
(
"manual.maximum_request",
value<uint32_t>(&configured.network.manual.maximum_request),
"The maximum allowed request size, defaults to '4000000'."
)
(
"manual.peer",
value<network::config::endpoints>(&configured.network.manual.peers),
"A persistent peer node, multiple allowed."
)
(
"manual.username",
value<std::string>(&configured.network.manual.username),
"The socks5 proxy username (optional)."
)
(
"manual.password",
value<std::string>(&configured.network.manual.password),
"The socks5 proxy password (optional)."
)
(
"manual.socks",
value<config::endpoint>(&configured.network.manual.socks),
"The socks5 proxy endpoint (port required)."
)
/* [admin] */
(
"admin.bind",
value<network::config::authorities>(&configured.server.admin.binds),
"IP address to bind, multiple allowed, defaults to empty (disabled)."
)
(
"admin.safe",
value<network::config::authorities>(&configured.server.admin.safes),
"IP address to secure bind, multiple allowed, defaults to empty (disabled)."
)
(
"admin.cert_auth",
value<std::filesystem::path>(&configured.server.admin.cert_auth),
"The certificate authority directory (*.PEM), enables client authentication."
)
(
"admin.cert_path",
value<std::filesystem::path>(&configured.server.admin.cert_path),
"The path to the server certificate file (.PEM), defaults to unused."
)
(
"admin.key_path",
value<std::filesystem::path>(&configured.server.admin.key_path),
"The path to the server private key file (.PEM), defaults to unused."
)
(
"admin.key_pass",
value<std::string>(&configured.server.admin.key_pass),
"The password to decrypt the server private key file (.PEM), optional."
)
(
"admin.connections",
value<uint16_t>(&configured.server.admin.connections),
"The required maximum number of connections, defaults to '0'."
)
(
"admin.inactivity_minutes",
value<uint32_t>(&configured.server.admin.inactivity_minutes),
"The idle timeout (http keep-alive), defaults to '10'."
)
(
"admin.expiration_minutes",
value<uint32_t>(&configured.server.admin.expiration_minutes),
"The idle timeout (http keep-alive), defaults to '60'."
)
(
"admin.minimum_buffer",
value<uint32_t>(&configured.server.admin.minimum_buffer),
"The minimum retained read buffer size, defaults to '4000000'."
)
(
"admin.maximum_request",
value<uint32_t>(&configured.server.admin.maximum_request),
"The maximum allowed request size, defaults to '4000000'."
)
(
"admin.server",
value<std::string>(&configured.server.admin.server),
"The server name (http header), defaults to '" BC_HTTP_SERVER_NAME "'."
)
(
"admin.host",
value<network::config::endpoints>(&configured.server.admin.hosts),
"The host name (http verification), multiple allowed, defaults to empty (disabled)."
)
(
"admin.origin",
value<network::config::endpoints>(&configured.server.admin.origins),
"The allowed origin (see CORS), multiple allowed, defaults to empty (disabled)."
)
(
"admin.allow_opaque_origin",
value<bool>(&configured.server.admin.allow_opaque_origin),
"Allow requests from opaque origin (see CORS), multiple allowed, defaults to false."
)
(
"admin.path",
value<std::filesystem::path>(&configured.server.admin.path),
"The required root path of source files to be served, defaults to empty."
)
(
"admin.default",
value<std::string>(&configured.server.admin.default_),
"The path of the default source page, defaults to 'index.html'."
)
/* [native] */
(
"native.bind",
value<network::config::authorities>(&configured.server.native.binds),
"IP address to bind, multiple allowed, defaults to empty (disabled)."
)
(
"native.safe",
value<network::config::authorities>(&configured.server.native.safes),
"IP address to secure bind, multiple allowed, defaults to empty (disabled)."
)
(
"native.cert_auth",
value<std::filesystem::path>(&configured.server.native.cert_auth),
"The certificate authority directory (*.PEM), enables client authentication."
)
(
"native.cert_path",
value<std::filesystem::path>(&configured.server.native.cert_path),
"The path to the server certificate file (.PEM), defaults to unused."
)
(
"native.key_path",
value<std::filesystem::path>(&configured.server.native.key_path),
"The path to the server private key file (.PEM), defaults to unused."
)
(
"native.key_pass",
value<std::string>(&configured.server.native.key_pass),
"The password to decrypt the server private key file (.PEM), optional."
)
(
"native.connections",
value<uint16_t>(&configured.server.native.connections),
"The required maximum number of connections, defaults to '0'."
)
(
"native.inactivity_minutes",
value<uint32_t>(&configured.server.native.inactivity_minutes),
"The idle timeout (http keep-server), defaults to '60'."
)
(
"native.expiration_minutes",
value<uint32_t>(&configured.server.native.expiration_minutes),
"The idle timeout (http keep-alive), defaults to '60'."
)
(
"native.minimum_buffer",
value<uint32_t>(&configured.server.native.minimum_buffer),
"The minimum retained read buffer size, defaults to '4000000'."
)
(
"native.maximum_request",
value<uint32_t>(&configured.server.native.maximum_request),
"The maximum allowed request size, defaults to '4000000'."
)
(
"native.server",
value<std::string>(&configured.server.native.server),
"The server name (http header), defaults to '" BC_HTTP_SERVER_NAME "'."
)
(
"native.host",
value<network::config::endpoints>(&configured.server.native.hosts),
"The host name (http verification), multiple allowed, defaults to empty (disabled)."
)
(
"native.origin",
value<network::config::endpoints>(&configured.server.native.origins),
"The allowed origin (see CORS), multiple allowed, defaults to empty (disabled)."
)
(
"native.allow_opaque_origin",
value<bool>(&configured.server.native.allow_opaque_origin),
"Allow requests from opaque origin (see CORS), multiple allowed, defaults to false."
)
(
"native.path",
value<std::filesystem::path>(&configured.server.native.path),
"The required root path of source files to be served, defaults to empty."
)
(
"native.default",
value<std::string>(&configured.server.native.default_),
"The path of the default source page, defaults to 'index.html'."
)
(
"native.websocket",
value<bool>(&configured.server.native.websocket),
"Enable websocket interface, defaults to true."
)
/* [bitcoind] */
(