Add configuration support for peer_private.

This commit is contained in:
Arthur Britto
2012-11-20 14:47:55 -08:00
parent a014bc5843
commit ea00a2d0d0
3 changed files with 15 additions and 2 deletions

View File

@@ -76,6 +76,11 @@
# [peer_port]: # [peer_port]:
# Port to bind to allow external connections from peers. # Port to bind to allow external connections from peers.
# #
# [peer_private]:
# 0 or 1.
# 0: allow peers to broadcast your address. [default]
# 1: request peers not broadcast your address.
#
# [rpc_ip]: # [rpc_ip]:
# IP address or domain to bind to allow insecure RPC connections. # IP address or domain to bind to allow insecure RPC connections.
# Defaults to not allow RPC connections. # Defaults to not allow RPC connections.
@@ -84,7 +89,8 @@
# Port to bind to if allowing insecure RPC connections. # Port to bind to if allowing insecure RPC connections.
# #
# [rpc_allow_remote]: # [rpc_allow_remote]:
# 0 or 1. 0 only allows RPC connections from 127.0.0.1. [default 0] # 0 or 1.
# 0: only allows RPC connections from 127.0.0.1. [default]
# #
# [websocket_ip]: # [websocket_ip]:
# IP address or domain to bind to allow client connections. # IP address or domain to bind to allow client connections.

View File

@@ -20,6 +20,7 @@
#define SECTION_PEER_CONNECT_LOW_WATER "peer_connect_low_water" #define SECTION_PEER_CONNECT_LOW_WATER "peer_connect_low_water"
#define SECTION_PEER_IP "peer_ip" #define SECTION_PEER_IP "peer_ip"
#define SECTION_PEER_PORT "peer_port" #define SECTION_PEER_PORT "peer_port"
#define SECTION_PEER_PRIVATE "peer_private"
#define SECTION_PEER_SCAN_INTERVAL_MIN "peer_scan_interval_min" #define SECTION_PEER_SCAN_INTERVAL_MIN "peer_scan_interval_min"
#define SECTION_PEER_SSL_CIPHER_LIST "peer_ssl_cipher_list" #define SECTION_PEER_SSL_CIPHER_LIST "peer_ssl_cipher_list"
#define SECTION_PEER_START_MAX "peer_start_max" #define SECTION_PEER_START_MAX "peer_start_max"
@@ -143,6 +144,8 @@ void Config::setup(const std::string& strConf)
PEER_START_MAX = DEFAULT_PEER_START_MAX; PEER_START_MAX = DEFAULT_PEER_START_MAX;
PEER_CONNECT_LOW_WATER = DEFAULT_PEER_CONNECT_LOW_WATER; PEER_CONNECT_LOW_WATER = DEFAULT_PEER_CONNECT_LOW_WATER;
PEER_PRIVATE = false;
TRANSACTION_FEE_BASE = 1000; TRANSACTION_FEE_BASE = 1000;
NETWORK_QUORUM = 0; // Don't need to see other nodes NETWORK_QUORUM = 0; // Don't need to see other nodes
@@ -222,6 +225,9 @@ void Config::load()
if (sectionSingleB(secConfig, SECTION_PEER_PORT, strTemp)) if (sectionSingleB(secConfig, SECTION_PEER_PORT, strTemp))
PEER_PORT = boost::lexical_cast<int>(strTemp); PEER_PORT = boost::lexical_cast<int>(strTemp);
if (sectionSingleB(secConfig, SECTION_PEER_PRIVATE, strTemp))
PEER_PRIVATE = boost::lexical_cast<bool>(strTemp);
(void) sectionSingleB(secConfig, SECTION_RPC_IP, RPC_IP); (void) sectionSingleB(secConfig, SECTION_RPC_IP, RPC_IP);
if (sectionSingleB(secConfig, SECTION_RPC_PORT, strTemp)) if (sectionSingleB(secConfig, SECTION_RPC_PORT, strTemp))

View File

@@ -66,7 +66,7 @@ public:
int LEDGER_SECONDS; int LEDGER_SECONDS;
int LEDGER_PROPOSAL_DELAY_SECONDS; int LEDGER_PROPOSAL_DELAY_SECONDS;
int LEDGER_AVALANCHE_SECONDS; int LEDGER_AVALANCHE_SECONDS;
bool LEDGER_CREATOR; // should be false unless we are starting a new ledger bool LEDGER_CREATOR; // Should be false unless we are starting a new ledger.
bool RUN_STANDALONE; bool RUN_STANDALONE;
// Note: The following parameters do not relate to the UNL or trust at all // Note: The following parameters do not relate to the UNL or trust at all
@@ -81,6 +81,7 @@ public:
int PEER_SCAN_INTERVAL_MIN; int PEER_SCAN_INTERVAL_MIN;
int PEER_START_MAX; int PEER_START_MAX;
unsigned int PEER_CONNECT_LOW_WATER; unsigned int PEER_CONNECT_LOW_WATER;
bool PEER_PRIVATE; // True to ask peers not to relay current IP.
// Websocket networking parameters // Websocket networking parameters
std::string WEBSOCKET_PUBLIC_IP; // XXX Going away. Merge with the inbound peer connction. std::string WEBSOCKET_PUBLIC_IP; // XXX Going away. Merge with the inbound peer connction.