dncurrency/nano/node/cli.hpp
Sergey Kroshnin 29f2a735b8
[Pruning] Pruning configuration settings (#2947)
* [Pruning] Pruning configuration settings
Splitting https://github.com/nanocurrency/nano-node/pull/2881

* Enable optional ledger pruning with node launch flag `--enable_pruning` for automatic node background actions.
* Pruning rules can be configured in [node.experimental] config with “max_pruning_age” (Time in seconds to limit for blocks age after pruning. Also period for automatic node pruning task, default 1 day, 5 minutes for beta network) & “max_pruning_depth” (Limit for full blocks in chain after pruning, default 0 - unlimited). By default all confirmed blocks older than 1 day can be pruned, except genesis block & last confirmed block in each account chain.
* `--enable_pruning` flag & config option “enable_voting” are mutually exclusive to prevent representatives start with pruned ledger. Pruning is not available for any representatives.

* Update ledger.pruning status if there are any pruned blocks in ledger

* Remove unused variables
2020-09-23 17:13:29 +03:00

31 lines
888 B
C++

#pragma once
#include <nano/lib/errors.hpp>
#include <nano/node/nodeconfig.hpp>
#include <boost/program_options.hpp>
namespace nano
{
/** Command line related error codes */
enum class error_cli
{
generic = 1,
parse_error = 2,
invalid_arguments = 3,
unknown_command = 4,
database_write_error = 5,
reading_config = 6,
disable_all_network = 7,
ambiguous_udp_options = 8,
ambiguous_pruning_voting_options = 9
};
void add_node_options (boost::program_options::options_description &);
void add_node_flag_options (boost::program_options::options_description &);
std::error_code update_flags (nano::node_flags &, boost::program_options::variables_map const &);
std::error_code flags_config_conflicts (nano::node_flags const &, nano::node_config const &);
std::error_code handle_node_options (boost::program_options::variables_map const &);
}
REGISTER_ERROR_CODES (nano, error_cli)