834{
836 auto private_key_default = std::make_pair(default_priv_key.get_public_key(), default_priv_key );
837
838 boost::program_options::options_description producer_options;
839
840 producer_options.add_options()
841 ("enable-stale-production,e", boost::program_options::bool_switch()->notifier([this](bool e){my->_production_enabled = e;}), "Enable block production, even if the chain is stale.")
842 (
"pause-on-startup,x", boost::program_options::bool_switch()->notifier([
this](
bool p){my->_pause_production =
p;}),
"Start this node in a state where production is paused")
843 ("max-transaction-time", bpo::value<int32_t>()->default_value(30),
844 "Limits the maximum time (in milliseconds) that is allowed a pushed transaction's code to execute before being considered invalid")
845 ("max-irreversible-block-age", bpo::value<int32_t>()->default_value( -1 ),
846 "Limits the maximum age (in seconds) of the DPOS Irreversible Block for a chain this node will produce blocks on (use negative value to indicate unlimited)")
847 ("producer-name,p", boost::program_options::value<vector<string>>()->composing()->multitoken(),
848 "ID of producer controlled by this node (e.g. inita; may specify multiple times)")
849 ("private-key", boost::program_options::value<vector<string>>()->composing()->multitoken(),
850 "(DEPRECATED - Use signature-provider instead) Tuple of [public key, WIF private key] (may specify multiple times)")
851 ("signature-provider", boost::program_options::value<vector<string>>()->composing()->multitoken()->default_value(
852 {default_priv_key.get_public_key().to_string() + "=KEY:" + default_priv_key.to_string()},
853 default_priv_key.get_public_key().
to_string() +
"=KEY:" + default_priv_key.to_string()),
854 "Key=Value pairs in the form <public-key>=<provider-spec>\n"
855 "Where:\n"
856 " <public-key> \tis a string form of a vaild SYSIO public key\n\n"
857 " <provider-spec> \tis a string in the form <provider-type>:<data>\n\n"
858 " <provider-type> \tis KEY, or KSYSD\n\n"
859 " KEY:<data> \tis a string form of a valid SYSIO private key which maps to the provided public key\n\n"
860 " KSYSD:<data> \tis the URL where kiod is available and the approptiate wallet(s) are unlocked")
861 ("kiod-provider-timeout", boost::program_options::value<int32_t>()->default_value(5),
862 "Limits the maximum time (in milliseconds) that is allowed for sending blocks to a kiod provider for signing")
863 ("greylist-account", boost::program_options::value<vector<string>>()->composing()->multitoken(),
864 "account that can not access to extended CPU/NET virtual resources")
865 ("greylist-limit", boost::program_options::value<uint32_t>()->default_value(1000),
866 "Limit (between 1 and 1000) on the multiple that CPU/NET virtual resources can extend during low usage (only enforced subjectively; use 1000 to not enforce any limit)")
867 ("produce-time-offset-us", boost::program_options::value<int32_t>()->default_value(0),
868 "Offset of non last block producing time in microseconds. Valid range 0 .. -block_time_interval.")
869 ("last-block-time-offset-us", boost::program_options::value<int32_t>()->default_value(-200000),
870 "Offset of last block producing time in microseconds. Valid range 0 .. -block_time_interval.")
871 ("cpu-effort-percent", bpo::value<uint32_t>()->default_value(config::default_block_cpu_effort_pct / config::percent_1),
872 "Percentage of cpu block production time used to produce block. Whole number percentages, e.g. 80 for 80%")
873 ("last-block-cpu-effort-percent", bpo::value<uint32_t>()->default_value(config::default_block_cpu_effort_pct / config::percent_1),
874 "Percentage of cpu block production time used to produce last block. Whole number percentages, e.g. 80 for 80%")
875 ("max-block-cpu-usage-threshold-us", bpo::value<uint32_t>()->default_value( 5000 ),
876 "Threshold of CPU block production to consider block full; when within threshold of max-block-cpu-usage block can be produced immediately")
877 ("max-block-net-usage-threshold-bytes", bpo::value<uint32_t>()->default_value( 1024 ),
878 "Threshold of NET block production to consider block full; when within threshold of max-block-net-usage block can be produced immediately")
879 ("max-scheduled-transaction-time-per-block-ms", boost::program_options::value<int32_t>()->default_value(100),
880 "Maximum wall-clock time, in milliseconds, spent retiring scheduled transactions in any block before returning to normal transaction processing.")
881 ("subjective-cpu-leeway-us", boost::program_options::value<int32_t>()->default_value( config::default_subjective_cpu_leeway_us ),
882 "Time in microseconds allowed for a transaction that starts with insufficient CPU quota to complete and cover its CPU usage.")
883 ("subjective-account-max-failures", boost::program_options::value<uint32_t>()->default_value(3),
884 "Sets the maximum amount of failures that are allowed for a given account per block.")
885 ("subjective-account-decay-time-minutes", bpo::value<uint32_t>()->default_value( config::account_cpu_usage_average_window_ms / 1000 / 60 ),
886 "Sets the time to return full subjective cpu for accounts")
887 ("incoming-defer-ratio", bpo::value<double>()->default_value(1.0),
888 "ratio between incoming transactions and deferred transactions when both are queued for execution")
889 ("incoming-transaction-queue-size-mb", bpo::value<uint16_t>()->default_value( 1024 ),
890 "Maximum size (in MiB) of the incoming transaction queue. Exceeding this value will subjectively drop transaction with resource exhaustion.")
891 ("disable-api-persisted-trx", bpo::bool_switch()->default_value(false),
892 "Disable the re-apply of API transactions.")
893 ("disable-subjective-billing", bpo::value<bool>()->default_value(true),
894 "Disable subjective CPU billing for API/P2P transactions")
895 ("disable-subjective-account-billing", boost::program_options::value<vector<string>>()->composing()->multitoken(),
896 "Account which is excluded from subjective CPU billing")
897 ("disable-subjective-p2p-billing", bpo::value<bool>()->default_value(true),
898 "Disable subjective CPU billing for P2P transactions")
899 ("disable-subjective-api-billing", bpo::value<bool>()->default_value(true),
900 "Disable subjective CPU billing for API transactions")
901 ("producer-threads", bpo::value<uint16_t>()->default_value(config::default_controller_thread_pool_size),
902 "Number of worker threads in producer thread pool")
903 ("snapshots-dir", bpo::value<bfs::path>()->default_value("snapshots"),
904 "the location of the snapshots directory (absolute path or relative to application data dir)")
905 ;
906 config_file_options.add(producer_options);
907}
static private_key regenerate(const typename KeyType::data_type &data)
static sha256 hash(const char *d, uint32_t dlen)
fc::string to_string(double)