diff --git a/Cargo.lock b/Cargo.lock index fbaf6b3500f8d0..4c4296aa1839e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2596,7 +2596,6 @@ dependencies = [ "log", "openssl", "prost-types 0.12.3", - "reqwest", "solana-address-lookup-table-program", "solana-client", "solana-core", diff --git a/Cargo.toml b/Cargo.toml index 8c22a443bd09f6..36929b8eedbe7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,6 @@ protobuf-src = "1.1.0" quinn = "0.9" rand = "0.8.5" rayon = "1.7.0" -reqwest = "0.11.16" rustls = { version = "0.20", features = ["dangerous_configuration"] } serde = { version = "1.0.160", features = ["derive"] } serde_json = "1.0.96" diff --git a/transaction-relayer/Cargo.toml b/transaction-relayer/Cargo.toml index e43e3091887307..8cce8b3e07039e 100644 --- a/transaction-relayer/Cargo.toml +++ b/transaction-relayer/Cargo.toml @@ -26,7 +26,6 @@ jwt = { workspace = true } log = { workspace = true } openssl = { workspace = true } prost-types = { workspace = true } -reqwest = { workspace = true } solana-address-lookup-table-program = { workspace = true } solana-client = { workspace = true } solana-core = { workspace = true } diff --git a/transaction-relayer/src/main.rs b/transaction-relayer/src/main.rs index c39739d255bf20..5038a485101e21 100644 --- a/transaction-relayer/src/main.rs +++ b/transaction-relayer/src/main.rs @@ -102,6 +102,9 @@ struct Args { )] websocket_servers: Vec, + #[arg(long, env, default_value = "entrypoint.mainnet-beta.solana.com:8001")] + entrypoint_address: String, + /// This is the IP address that will be shared with the validator. The validator will /// tell the rest of the network to send packets here. #[arg(long, env)] @@ -253,13 +256,15 @@ fn main() { let public_ip = if args.public_ip.is_some() { args.public_ip.unwrap() } else { - info!("reading public ip from ifconfig.me..."); - let response = reqwest::blocking::get("https://ifconfig.me") - .expect("response from ifconfig.me") - .text() - .expect("public ip response"); - response.parse().unwrap() + let entrypoint = solana_net_utils::parse_host_port(args.entrypoint_address.as_str()) + .expect("parse entrypoint"); + info!( + "Contacting {} to determine the validator's public IP address", + entrypoint + ); + solana_net_utils::get_public_ip_addr(&entrypoint).expect("get public ip address") }; + info!("public ip: {:?}", public_ip); assert!( public_ip.is_ipv4(),