* Minor help improvements (cherry picked from commit04bf5ce830
) * Bind RPC and faucet to 0.0.0.0 (cherry picked from commit0b23abd479
) Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
@ -24,8 +24,13 @@ use {
|
|||||||
signature::{read_keypair_file, write_keypair_file, Keypair, Signer},
|
signature::{read_keypair_file, write_keypair_file, Keypair, Signer},
|
||||||
},
|
},
|
||||||
std::{
|
std::{
|
||||||
collections::HashMap, fs::remove_dir_all, net::SocketAddr, path::PathBuf, sync::Arc,
|
collections::HashMap,
|
||||||
thread::sleep, time::Duration,
|
fs::remove_dir_all,
|
||||||
|
net::{IpAddr, Ipv4Addr, SocketAddr},
|
||||||
|
path::PathBuf,
|
||||||
|
sync::Arc,
|
||||||
|
thread::sleep,
|
||||||
|
time::Duration,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -328,13 +333,19 @@ impl TestValidator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let vote_account_address = validator_vote_account.pubkey();
|
let vote_account_address = validator_vote_account.pubkey();
|
||||||
let rpc_url = format!("http://{}:{}", node.info.rpc.ip(), node.info.rpc.port());
|
let rpc_url = format!("http://{}", node.info.rpc);
|
||||||
let rpc_pubsub_url = format!("ws://{}/", node.info.rpc_pubsub);
|
let rpc_pubsub_url = format!("ws://{}/", node.info.rpc_pubsub);
|
||||||
let tpu = node.info.tpu;
|
let tpu = node.info.tpu;
|
||||||
let gossip = node.info.gossip;
|
let gossip = node.info.gossip;
|
||||||
|
|
||||||
let validator_config = ValidatorConfig {
|
let validator_config = ValidatorConfig {
|
||||||
rpc_addrs: Some((node.info.rpc, node.info.rpc_pubsub)),
|
rpc_addrs: Some((
|
||||||
|
SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), node.info.rpc.port()),
|
||||||
|
SocketAddr::new(
|
||||||
|
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
|
||||||
|
node.info.rpc_pubsub.port(),
|
||||||
|
),
|
||||||
|
)),
|
||||||
rpc_config: config.rpc_config.clone(),
|
rpc_config: config.rpc_config.clone(),
|
||||||
accounts_hash_interval_slots: 100,
|
accounts_hash_interval_slots: 100,
|
||||||
account_paths: vec![ledger_path.join("accounts")],
|
account_paths: vec![ledger_path.join("accounts")],
|
||||||
|
@ -159,7 +159,7 @@ fn main() {
|
|||||||
};
|
};
|
||||||
let rpc_port = value_t_or_exit!(matches, "rpc_port", u16);
|
let rpc_port = value_t_or_exit!(matches, "rpc_port", u16);
|
||||||
let faucet_addr = Some(SocketAddr::new(
|
let faucet_addr = Some(SocketAddr::new(
|
||||||
IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)),
|
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
|
||||||
FAUCET_PORT,
|
FAUCET_PORT,
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -318,7 +318,10 @@ fn main() {
|
|||||||
println_name_value("Gossip Address:", &test_validator.gossip().to_string());
|
println_name_value("Gossip Address:", &test_validator.gossip().to_string());
|
||||||
println_name_value("TPU Address:", &test_validator.tpu().to_string());
|
println_name_value("TPU Address:", &test_validator.tpu().to_string());
|
||||||
if let Some(faucet_addr) = &faucet_addr {
|
if let Some(faucet_addr) = &faucet_addr {
|
||||||
println_name_value("Faucet Address:", &faucet_addr.to_string());
|
println_name_value(
|
||||||
|
"Faucet Address:",
|
||||||
|
&format!("{}:{}", &test_validator.gossip().ip(), faucet_addr.port()),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
let progress_bar = new_spinner_progress_bar();
|
let progress_bar = new_spinner_progress_bar();
|
||||||
|
@ -45,7 +45,7 @@ use std::{
|
|||||||
collections::HashSet,
|
collections::HashSet,
|
||||||
env,
|
env,
|
||||||
fs::{self, File},
|
fs::{self, File},
|
||||||
net::{SocketAddr, TcpListener, UdpSocket},
|
net::{IpAddr, SocketAddr, TcpListener, UdpSocket},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process::exit,
|
process::exit,
|
||||||
str::FromStr,
|
str::FromStr,
|
||||||
@ -872,7 +872,7 @@ pub fn main() {
|
|||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("Create this file if it doesn't already exist \
|
.help("Create this file if it doesn't already exist \
|
||||||
once node initialization is complete"),
|
once validator initialization is complete"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("ledger_path")
|
Arg::with_name("ledger_path")
|
||||||
@ -910,7 +910,7 @@ pub fn main() {
|
|||||||
Arg::with_name("no_voting")
|
Arg::with_name("no_voting")
|
||||||
.long("no-voting")
|
.long("no-voting")
|
||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.help("Launch node without voting"),
|
.help("Launch validator without voting"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("no_check_vote_account")
|
Arg::with_name("no_check_vote_account")
|
||||||
@ -951,7 +951,7 @@ pub fn main() {
|
|||||||
Arg::with_name("private_rpc")
|
Arg::with_name("private_rpc")
|
||||||
.long("--private-rpc")
|
.long("--private-rpc")
|
||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.help("Do not publish the RPC port for use by other nodes")
|
.help("Do not publish the RPC port for use by others")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("no_port_check")
|
Arg::with_name("no_port_check")
|
||||||
@ -1046,7 +1046,7 @@ pub fn main() {
|
|||||||
.long("gossip-port")
|
.long("gossip-port")
|
||||||
.value_name("PORT")
|
.value_name("PORT")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("Gossip port number for the node"),
|
.help("Gossip port number for the validator"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("gossip_host")
|
Arg::with_name("gossip_host")
|
||||||
@ -1054,7 +1054,7 @@ pub fn main() {
|
|||||||
.value_name("HOST")
|
.value_name("HOST")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.validator(solana_net_utils::is_host)
|
.validator(solana_net_utils::is_host)
|
||||||
.help("Gossip DNS name or IP address for the node to advertise in gossip \
|
.help("Gossip DNS name or IP address for the validator to advertise in gossip \
|
||||||
[default: ask --entrypoint, or 127.0.0.1 when --entrypoint is not provided]"),
|
[default: ask --entrypoint, or 127.0.0.1 when --entrypoint is not provided]"),
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -1065,8 +1065,8 @@ pub fn main() {
|
|||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.conflicts_with("private_rpc")
|
.conflicts_with("private_rpc")
|
||||||
.validator(solana_net_utils::is_host_port)
|
.validator(solana_net_utils::is_host_port)
|
||||||
.help("RPC address for the node to advertise publicly in gossip. \
|
.help("RPC address for the validator to advertise publicly in gossip. \
|
||||||
Useful for nodes running behind a load balancer or proxy \
|
Useful for validators running behind a load balancer or proxy \
|
||||||
[default: use --rpc-bind-address / --rpc-port]"),
|
[default: use --rpc-bind-address / --rpc-port]"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
@ -1141,7 +1141,7 @@ pub fn main() {
|
|||||||
Arg::with_name("skip_poh_verify")
|
Arg::with_name("skip_poh_verify")
|
||||||
.long("skip-poh-verify")
|
.long("skip-poh-verify")
|
||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.help("Skip ledger verification at node bootup"),
|
.help("Skip ledger verification at validator bootup"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("cuda")
|
Arg::with_name("cuda")
|
||||||
@ -1754,7 +1754,6 @@ pub fn main() {
|
|||||||
info!("{} {}", crate_name!(), solana_version::version!());
|
info!("{} {}", crate_name!(), solana_version::version!());
|
||||||
info!("Starting validator with: {:#?}", std::env::args_os());
|
info!("Starting validator with: {:#?}", std::env::args_os());
|
||||||
|
|
||||||
use std::net::IpAddr;
|
|
||||||
let gossip_host: IpAddr = matches
|
let gossip_host: IpAddr = matches
|
||||||
.value_of("gossip_host")
|
.value_of("gossip_host")
|
||||||
.map(|gossip_host| {
|
.map(|gossip_host| {
|
||||||
|
Reference in New Issue
Block a user