Skip to content

sgns::node_config

#include <node_config.hpp>

Public Functions

Name
node_config()
node_config(uint16_t , sgns::logging const & )
sgns::error_ serialize_json(sgns::jsonconfig & ) const
sgns::error_ deserialize_json(bool & , sgns::jsonconfig & )
sgns::error_ serialize_toml(sgns::tomlconfig & ) const
sgns::error_ deserialize_toml(sgns::tomlconfig & )
bool upgrade_json(unsigned , sgns::jsonconfig & )
sgns::account random_representative() const
void deserialize_address(std::string const & , std::vector< std::pair< std::string, uint16_t > > & ) const
unsigned json_version()

Public Attributes

Name
sgns::network_params network_params
uint16_t peering_port
sgns::logging logging
std::vector< std::pair< std::string, uint16_t > > work_peers
std::vector< std::pair< std::string, uint16_t > > secondary_work_peers
std::vector< std::string > preconfigured_peers
std::vector< sgns::account > preconfigured_representatives
unsigned bootstrap_fraction_numerator
sgns::amount receive_minimum
sgns::amount vote_minimum
std::chrono::milliseconds vote_generator_delay
unsigned vote_generator_threshold
sgns::amount online_weight_minimum
unsigned online_weight_quorum
unsigned password_fanout
unsigned io_threads
unsigned network_threads
unsigned work_threads
unsigned signature_checker_threads
bool enable_voting
unsigned bootstrap_connections
unsigned bootstrap_connections_max
unsigned bootstrap_initiator_threads
size_t confirmation_history_size
std::string callback_address
uint16_t callback_port
std::string callback_target
int deprecated_lmdb_max_dbs
bool allow_local_peers
std::string external_address
uint16_t external_port
std::chrono::milliseconds block_processor_batch_max_time
std::chrono::seconds unchecked_cutoff_time
std::chrono::seconds tcp_io_timeout
std::chrono::nanoseconds pow_sleep_interval
size_t active_elections_size
unsigned tcp_incoming_connections_max
bool use_memory_pools
size_t bandwidth_limit
double bandwidth_limit_burst_ratio
std::chrono::milliseconds conf_height_processor_batch_min_time
bool backup_before_upgrade
std::chrono::seconds work_watcher_period
double max_work_generate_multiplier
uint32_t max_queued_requests
std::chrono::seconds constexpr keepalive_period
std::chrono::seconds constexpr keepalive_cutoff
std::chrono::minutes constexpr wallet_backup_interval

Public Functions Documentation

function node_config

node_config()

function node_config

node_config(
    uint16_t ,
    sgns::logging const & 
)

function serialize_json

sgns::error_ serialize_json(
    sgns::jsonconfig & 
) const

function deserialize_json

sgns::error_ deserialize_json(
    bool & ,
    sgns::jsonconfig & 
)

function serialize_toml

sgns::error_ serialize_toml(
    sgns::tomlconfig & 
) const

function deserialize_toml

sgns::error_ deserialize_toml(
    sgns::tomlconfig & 
)

function upgrade_json

bool upgrade_json(
    unsigned ,
    sgns::jsonconfig & 
)

function random_representative

sgns::account random_representative() const

function deserialize_address

void deserialize_address(
    std::string const & ,
    std::vector< std::pair< std::string, uint16_t > > & 
) const

Entry is ignored if it cannot be parsed as a valid address:port

function json_version

static inline unsigned json_version()

Public Attributes Documentation

variable network_params

sgns::network_params network_params;

variable peering_port

uint16_t peering_port { 0 };

variable logging

sgns::logging logging;

variable work_peers

std::vector< std::pair< std::string, uint16_t > > work_peers;

variable secondary_work_peers

std::vector< std::pair< std::string, uint16_t > > secondary_work_peers { { "127.0.0.1", 8076 } };

variable preconfigured_peers

std::vector< std::string > preconfigured_peers;

variable preconfigured_representatives

std::vector< sgns::account > preconfigured_representatives;

variable bootstrap_fraction_numerator

unsigned bootstrap_fraction_numerator { 1 };

variable receive_minimum

sgns::amount receive_minimum { sgns::xrb_ratio };

variable vote_minimum

sgns::amount vote_minimum { sgns::Gxrb_ratio };

variable vote_generator_delay

std::chrono::milliseconds vote_generator_delay { std::chrono::milliseconds (100) };

variable vote_generator_threshold

unsigned vote_generator_threshold { 3 };

variable online_weight_minimum

sgns::amount online_weight_minimum { 60000 * sgns::Gxrb_ratio };

variable online_weight_quorum

unsigned online_weight_quorum { 50 };

variable password_fanout

unsigned password_fanout { 1024 };

variable io_threads

unsigned io_threads { std::max<unsigned> (4, std::thread::hardware_concurrency ()) };

variable network_threads

unsigned network_threads { std::max<unsigned> (4, std::thread::hardware_concurrency ()) };

variable work_threads

unsigned work_threads { std::max<unsigned> (4, std::thread::hardware_concurrency ()) };

variable signature_checker_threads

unsigned signature_checker_threads { std::thread::hardware_concurrency () / 2 };

variable enable_voting

bool enable_voting { false };

variable bootstrap_connections

unsigned bootstrap_connections { 4 };

variable bootstrap_connections_max

unsigned bootstrap_connections_max { 64 };

variable bootstrap_initiator_threads

unsigned bootstrap_initiator_threads { network_params.network.is_test_network () ? 1u : std::min<unsigned> (2, std::max<unsigned> (1, std::thread::hardware_concurrency ())) };

variable confirmation_history_size

size_t confirmation_history_size { 2048 };

variable callback_address

std::string callback_address;

variable callback_port

uint16_t callback_port { 0 };

variable callback_target

std::string callback_target;

variable deprecated_lmdb_max_dbs

int deprecated_lmdb_max_dbs { 128 };

variable allow_local_peers

bool allow_local_peers { !network_params.network.is_live_network () };

variable external_address

std::string external_address;

variable external_port

uint16_t external_port { 0 };

variable block_processor_batch_max_time

std::chrono::milliseconds block_processor_batch_max_time { std::chrono::milliseconds (5000) };

variable unchecked_cutoff_time

std::chrono::seconds unchecked_cutoff_time { std::chrono::seconds (4 * 60 * 60) };

variable tcp_io_timeout

std::chrono::seconds tcp_io_timeout { (network_params.network.is_test_network () && !is_sanitizer_build) ? std::chrono::seconds (5) : std::chrono::seconds (15) };

Timeout for initiated async operations

variable pow_sleep_interval

std::chrono::nanoseconds pow_sleep_interval { 0 };

variable active_elections_size

size_t active_elections_size { 50000 };

variable tcp_incoming_connections_max

unsigned tcp_incoming_connections_max { 1024 };

Default maximum incoming TCP connections, including realtime network & bootstrap

variable use_memory_pools

bool use_memory_pools { true };

variable bandwidth_limit

size_t bandwidth_limit { 5 * 1024 * 1024 };

Default outbound traffic shaping is 5MB/s

variable bandwidth_limit_burst_ratio

double bandwidth_limit_burst_ratio { 3. };

By default, allow bursts of 15MB/s (not sustainable)

variable conf_height_processor_batch_min_time

std::chrono::milliseconds conf_height_processor_batch_min_time { 50 };

variable backup_before_upgrade

bool backup_before_upgrade { false };

variable work_watcher_period

std::chrono::seconds work_watcher_period { std::chrono::seconds (5) };

variable max_work_generate_multiplier

double max_work_generate_multiplier { 64. };

variable max_queued_requests

uint32_t max_queued_requests { 512 };

variable keepalive_period

static std::chrono::seconds constexpr keepalive_period = std::chrono::seconds (60);

variable keepalive_cutoff

static std::chrono::seconds constexpr keepalive_cutoff = keepalive_period * 5;

variable wallet_backup_interval

static std::chrono::minutes constexpr wallet_backup_interval = std::chrono::minutes (5);

Updated on 2026-03-04 at 13:10:43 -0800