From a1822b8abafefc9b5c4f06d3c18b12863a1636aa Mon Sep 17 00:00:00 2001 From: evoskuil Date: Tue, 16 Oct 2018 15:51:32 -0700 Subject: [PATCH] Sort [bitcoin] settings. --- data/bs.cfg | 76 ++++++++++---------- src/parser.cpp | 186 +++++++++++++++++++++++++------------------------ 2 files changed, 132 insertions(+), 130 deletions(-) diff --git a/data/bs.cfg b/data/bs.cfg index 5cceba91..ba9293a4 100644 --- a/data/bs.cfg +++ b/data/bs.cfg @@ -20,6 +20,44 @@ statistics_server = 0.0.0.0:0 # Enable verbose logging, defaults to false. verbose = false +[bitcoin] +# The difficulty retargeting factor, defaults to 4. +retargeting_factor = 4 +# The target block period in seconds, defaults to 600. +block_spacing_seconds = 600 +# The future timestamp allowance in seconds, defaults to 7200. +timestamp_limit_seconds = 7200 +# The difficulty retargeting period in seconds, defaults to 1209600. +retargeting_interval_seconds = 1209600 +# The proof of work limit, defaults to 486604799. +proof_of_work_limit = 486604799 +# The initial block subsidy in bitcoin, defaults to 50. +initial_block_subsidy_bitcoin = 50 +# The subsidy halving period in number of blocks, defaults to 210000. +subsidy_interval = 210000 +# The genesis block, defaults to mainnet (use xxxx for testnet). +genesis_block = 0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000 +# The number of new version blocks required for bip34 style soft fork activation, defaults to 750 (use xxxx for testnet). +activation_threshold = 750 +# The number of new version blocks required for bip34 style soft fork enforcement, defaults to 950 (use xxxx for testnet). +enforcement_threshold = 950 +# The number of blocks considered for bip34 style soft fork activation, defaults to 1000 (use xxxx for testnet). +activation_sample = 1000 +# The block height to freeze the bip65 softfork as in bip90, defaults to 388381 (use xxxx for testnet). +bip65_freeze = 388381 +# The block height to freeze the bip66 softfork as in bip90, defaults to 363725 (use xxxx for testnet). +bip66_freeze = 363725 +# The block height to freeze the bip34 softfork as in bip90, defaults to 227931 (use xxxx for testnet). +bip34_freeze = 227931 +# The activation time for bip16 in unix time, defaults to 1333238400. +bip16_activation_time = 1333238400 +# The hash:height checkpoint for bip34 activation, defaults to 000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8:227931 (use xxxx for testnet). +bip34_active_checkpoint = 000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8:227931 +# The hash:height checkpoint for bip9 bit0 activation, defaults to 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328 (use xxxx for testnet). +bip9_bit0_active_checkpoint = 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328 +# The hash:height checkpoint for bip9 bit1 activation, defaults to 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:481824 (use xxxx for testnet). +bip9_bit1_active_checkpoint = 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:481824 + [network] # The minimum number of threads in the network threadpool, defaults to 0 (physical cores). threads = 0 @@ -236,41 +274,3 @@ public_transaction_endpoint = tcp://*:9094 #client_address = 127.0.0.1 # Blocked client IP address, multiple entries allowed. #blacklist = 127.0.0.1 - -[bitcoin] -# The difficulty retargeting factor, defaults to 4. -retargeting_factor = 4 -# The target block period in seconds, defaults to 600. -block_spacing_seconds = 600 -# The future timestamp allowance in seconds, defaults to 7200. -timestamp_limit_seconds = 7200 -# The difficulty retargeting period in seconds, defaults to 1209600. -retargeting_interval_seconds = 1209600 -# The proof of work limit, defaults to 486604799. -proof_of_work_limit = 486604799 -# The genesis block (defaults to mainnet). -genesis_block = 0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000 -# The number of new version blocks required for bip34 style soft fork activation, defaults to 750. -activation_threshold = 750 -# The number of new version blocks required for bip34 style soft fork enforcement, defaults to 950. -enforcement_threshold = 950 -# The number of blocks considered for bip34 style soft fork activation, defaults to 1000. -activation_sample = 1000 -# The block height to freeze the bip65 softfork as in bip90, defaults to 388381. -bip65_freeze = 388381 -# The block height to freeze the bip66 softfork as in bip90, defaults to 363725. -bip66_freeze = 363725 -# The block height to freeze the bip34 softfork as in bip90, defaults to 227931. -bip34_freeze = 227931 -# The activation time for bip16 in unix time, defaults to 1333238400. -bip16_activation_time = 1333238400 -# The hash:height checkpoint for bip34 activation, defaults to 000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8:227931. -bip34_active_checkpoint = 000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8:227931 -# The hash:height checkpoint for bip9 bit0 activation, defaults to 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328. -bip9_bit0_active_checkpoint = 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328 -# The hash:height checkpoint for bip9 bit1 activation, defaults to 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:481824. -bip9_bit1_active_checkpoint = 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:481824 -# The initial block subsidy in bitcoin, defaults to 50. -initial_block_subsidy_bitcoin = 50 -# The subsidy halving period in number of blocks, defaults to 210000. -subsidy_interval = 210000 diff --git a/src/parser.cpp b/src/parser.cpp index 4ae78f0b..a9319696 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -136,6 +136,7 @@ options_metadata parser::load_settings() { options_metadata description("settings"); description.add_options() + /* [log] */ ( "log.debug_file", @@ -182,6 +183,99 @@ options_metadata parser::load_settings() value(&configured.network.verbose), "Enable verbose logging, defaults to false." ) + + /* [bitcoin] */ + ( + "bitcoin.retargeting_factor", + PROPERTY(uint32_t, configured.bitcoin.retargeting_factor), + "The difficulty retargeting factor, defaults to 4." + ) + ( + "bitcoin.block_spacing_seconds", + PROPERTY(uint32_t, configured.bitcoin.block_spacing_seconds), + "The target block period in seconds, defaults to 600." + ) + ( + "bitcoin.timestamp_limit_seconds", + value(&configured.bitcoin.timestamp_limit_seconds), + "The future timestamp allowance in seconds, defaults to 7200." + ) + ( + "bitcoin.retargeting_interval_seconds", + PROPERTY(uint32_t, configured.bitcoin.retargeting_interval_seconds), + "The difficulty retargeting period in seconds, defaults to 1209600." + ) + ( + "bitcoin.proof_of_work_limit", + value(&configured.bitcoin.proof_of_work_limit), + "The proof of work limit, defaults to 486604799." + ) + ( + "bitcoin.initial_block_subsidy_bitcoin", + PROPERTY(uint64_t, configured.bitcoin.initial_block_subsidy_bitcoin), + "The initial block subsidy in bitcoin, defaults to 50." + ) + ( + "bitcoin.subsidy_interval", + PROPERTY(uint64_t, configured.bitcoin.subsidy_interval), + "The subsidy halving period in number of blocks, defaults to 210000." + ) + ( + "bitcoin.genesis_block", + value(&configured.bitcoin.genesis_block), + "The genesis block, defaults to mainnet." + ) + ( + "bitcoin.activation_threshold", + value(&configured.bitcoin.activation_threshold), + "The number of new version blocks required for bip34 style soft fork activation, defaults to 750." + ) + ( + "bitcoin.enforcement_threshold", + value(&configured.bitcoin.enforcement_threshold), + "The number of new version blocks required for bip34 style soft fork enforcement, defaults to 950." + ) + ( + "bitcoin.activation_sample", + value(&configured.bitcoin.activation_sample), + "The number of blocks considered for bip34 style soft fork activation, defaults to 1000." + ) + ( + "bitcoin.bip65_freeze", + value(&configured.bitcoin.bip65_freeze), + "The block height to freeze the bip65 softfork as in bip90, defaults to 388381." + ) + ( + "bitcoin.bip66_freeze", + value(&configured.bitcoin.bip66_freeze), + "The block height to freeze the bip66 softfork as in bip90, defaults to 363725." + ) + ( + "bitcoin.bip34_freeze", + value(&configured.bitcoin.bip34_freeze), + "The block height to freeze the bip34 softfork as in bip90, defaults to 227931." + ) + ( + "bitcoin.bip16_activation_time", + value(&configured.bitcoin.bip16_activation_time), + "The activation time for bip16 in unix time, defaults to 1333238400." + ) + ( + "bitcoin.bip34_active_checkpoint", + value(&configured.bitcoin.bip34_active_checkpoint), + "The hash:height checkpoint for bip34 activation, defaults to 000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8:227931." + ) + ( + "bitcoin.bip9_bit0_active_checkpoint", + value(&configured.bitcoin.bip9_bit0_active_checkpoint), + "The hash:height checkpoint for bip9 bit0 activation, defaults to 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328." + ) + ( + "bitcoin.bip9_bit1_active_checkpoint", + value(&configured.bitcoin.bip9_bit1_active_checkpoint), + "The hash:height checkpoint for bip9 bit1 activation, defaults to 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:481824." + ) + /* [network] */ ( "network.threads", @@ -621,98 +715,6 @@ options_metadata parser::load_settings() "server.blacklist", value(&configured.server.blacklists), "Blocked client IP address, multiple entries allowed." - ) - - /* [bitcoin] */ - ( - "bitcoin.retargeting_factor", - PROPERTY(uint32_t, configured.bitcoin.retargeting_factor), - "The difficulty retargeting factor, defaults to 4." - ) - ( - "bitcoin.block_spacing_seconds", - PROPERTY(uint32_t, configured.bitcoin.block_spacing_seconds), - "The target block period in seconds, defaults to 600." - ) - ( - "bitcoin.timestamp_limit_seconds", - value(&configured.bitcoin.timestamp_limit_seconds), - "The future timestamp allowance in seconds, defaults to 7200." - ) - ( - "bitcoin.retargeting_interval_seconds", - PROPERTY(uint32_t, configured.bitcoin.retargeting_interval_seconds), - "The difficulty retargeting period in seconds, defaults to 1209600." - ) - ( - "bitcoin.proof_of_work_limit", - value(&configured.bitcoin.proof_of_work_limit), - "The proof of work limit, defaults to 486604799." - ) - ( - "bitcoin.genesis_block", - value(&configured.bitcoin.genesis_block), - "The genesis block." - ) - ( - "bitcoin.activation_threshold", - value(&configured.bitcoin.activation_threshold), - "The number of new version blocks required for bip34 style soft fork activation, defaults to 750." - ) - ( - "bitcoin.enforcement_threshold", - value(&configured.bitcoin.enforcement_threshold), - "The number of new version blocks required for bip34 style soft fork enforcement, defaults to 950." - ) - ( - "bitcoin.activation_sample", - value(&configured.bitcoin.activation_sample), - "The number of blocks considered for bip34 style soft fork activation, defaults to 1000." - ) - ( - "bitcoin.bip65_freeze", - value(&configured.bitcoin.bip65_freeze), - "The block height to freeze the bip65 softfork as in bip90, defaults to 388381." - ) - ( - "bitcoin.bip66_freeze", - value(&configured.bitcoin.bip66_freeze), - "The block height to freeze the bip66 softfork as in bip90, defaults to 363725." - ) - ( - "bitcoin.bip34_freeze", - value(&configured.bitcoin.bip34_freeze), - "The block height to freeze the bip34 softfork as in bip90, defaults to 227931." - ) - ( - "bitcoin.bip16_activation_time", - value(&configured.bitcoin.bip16_activation_time), - "The activation time for bip16 in unix time, defaults to 1333238400." - ) - ( - "bitcoin.bip34_active_checkpoint", - value(&configured.bitcoin.bip34_active_checkpoint), - "The hash:height checkpoint for bip34 activation, defaults to 000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8:227931." - ) - ( - "bitcoin.bip9_bit0_active_checkpoint", - value(&configured.bitcoin.bip9_bit0_active_checkpoint), - "The hash:height checkpoint for bip9 bit0 activation, defaults to 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328." - ) - ( - "bitcoin.bip9_bit1_active_checkpoint", - value(&configured.bitcoin.bip9_bit1_active_checkpoint), - "The hash:height checkpoint for bip9 bit1 activation, defaults to 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:481824." - ) - ( - "bitcoin.initial_block_subsidy_bitcoin", - PROPERTY(uint64_t, configured.bitcoin.initial_block_subsidy_bitcoin), - "The initial block subsidy in bitcoin, defaults to 50." - ) - ( - "bitcoin.subsidy_interval", - PROPERTY(uint64_t, configured.bitcoin.subsidy_interval), - "The subsidy halving period in number of blocks, defaults to 210000." ); return description;