Ledger quorum configuration.

This commit is contained in:
JoelKatz
2012-05-01 02:27:08 -07:00
parent 43ac5f8023
commit 3df579bbae
2 changed files with 18 additions and 7 deletions

View File

@@ -18,6 +18,8 @@
#define SECTION_PEER_SCAN_INTERVAL_MIN "peer_scan_interval_min"
#define SECTION_PEER_START_MAX "peer_start_max"
#define SECTION_PEER_CONNECT_LOW_WATER "peer_connect_low_water"
#define SECTION_NETWORK_QUORUM "network_quorum"
#define SECTION_BELIEF_QUORUM "belief_quorum"
Config theConfig;
@@ -46,6 +48,9 @@ Config::Config()
PEER_CONNECT_LOW_WATER = DEFAULT_PEER_CONNECT_LOW_WATER;
TRANSACTION_FEE_BASE = 1000;
NETWORK_QUORUM = 0;
BELIEF_QUORUM = 1;
}
void Config::load()
@@ -75,23 +80,28 @@ void Config::load()
(void) sectionSingleB(secConfig, SECTION_PEER_IP, PEER_IP);
if (sectionSingleB(secConfig, SECTION_PEER_PORT, strTemp))
PEER_PORT=boost::lexical_cast<int>(strTemp);
PEER_PORT = boost::lexical_cast<int>(strTemp);
(void) sectionSingleB(secConfig, SECTION_RPC_IP, RPC_IP);
if (sectionSingleB(secConfig, SECTION_RPC_PORT, strTemp))
RPC_PORT=boost::lexical_cast<int>(strTemp);
RPC_PORT = boost::lexical_cast<int>(strTemp);
(void) sectionSingleB(secConfig, SECTION_VALIDATION_PASSWORD, VALIDATION_PASSWORD);
(void) sectionSingleB(secConfig, SECTION_VALIDATION_KEY, VALIDATION_KEY);
(void) sectionSingleB(secConfig, SECTION_PEER_SSL_CIPHER_LIST, PEER_SSL_CIPHER_LIST);
(void) sectionSingleB(secConfig, SECTION_PEER_SCAN_INTERVAL_MIN, strTemp);
PEER_SCAN_INTERVAL_MIN=MAX(60, boost::lexical_cast<int>(strTemp));
PEER_SCAN_INTERVAL_MIN = MAX(60, boost::lexical_cast<int>(strTemp));
(void) sectionSingleB(secConfig, SECTION_PEER_START_MAX, strTemp);
PEER_START_MAX=MIN(1, boost::lexical_cast<int>(strTemp));
PEER_START_MAX = MIN(1, boost::lexical_cast<int>(strTemp));
(void) sectionSingleB(secConfig, SECTION_PEER_CONNECT_LOW_WATER, strTemp);
PEER_CONNECT_LOW_WATER=MAX(1, boost::lexical_cast<int>(strTemp));
PEER_CONNECT_LOW_WATER = MAX(1, boost::lexical_cast<int>(strTemp));
(void) sectionSingleB(secConfig, SECTION_NETWORK_QUORUM, strTemp);
NETWORK_QUORUM = MIN(0, boost::lexical_cast<int>(strTemp));
(void) sectionSingleB(secConfig, SECTION_BELIEF_QUORUM, strTemp);
BELIEF_QUORUM = MIN(0, boost::lexical_cast<int>(strTemp));
}
}

View File

@@ -34,8 +34,9 @@ public:
int LEDGER_SECONDS;
int LEDGER_PROPOSAL_DELAY_SECONDS;
int LEDGER_AVALANCHE_SECONDS;
int BELIEF_QUORUM;
float BELIEF_PERCENT;
int NETWORK_QUORUM; // Minimum number of nodes to consider the network present
int BELIEF_QUORUM; // Percent agreement needed to sync ledger w/o validations
// node networking parameters
std::string PEER_IP;