|
20 | 20 | geyser_plugin_manager::GeyserPluginManager, GeyserPluginManagerRequest,
|
21 | 21 | },
|
22 | 22 | solana_gossip::{
|
23 |
| - cluster_info::{ClusterInfo, Node, NodeConfig}, |
| 23 | + cluster_info::{ClusterInfo, Node}, |
24 | 24 | contact_info::Protocol,
|
25 | 25 | gossip_service::discover_cluster,
|
26 | 26 | socketaddr,
|
|
29 | 29 | blockstore::create_new_ledger, blockstore_options::LedgerColumnOptions,
|
30 | 30 | create_new_tmp_ledger,
|
31 | 31 | },
|
32 |
| - solana_net_utils::{find_available_port_in_range, PortRange}, |
| 32 | + solana_net_utils::PortRange, |
33 | 33 | solana_rpc::{rpc::JsonRpcConfig, rpc_pubsub_service::PubSubConfig},
|
34 | 34 | solana_rpc_client::{nonblocking, rpc_client::RpcClient},
|
35 | 35 | solana_rpc_client_api::request::MAX_MULTIPLE_ACCOUNTS,
|
|
63 | 63 | fs::{self, remove_dir_all, File},
|
64 | 64 | io::Read,
|
65 | 65 | net::{IpAddr, Ipv4Addr, SocketAddr},
|
66 |
| - num::NonZero, |
67 | 66 | path::{Path, PathBuf},
|
68 | 67 | str::FromStr,
|
69 | 68 | sync::{Arc, RwLock},
|
@@ -949,30 +948,17 @@ impl TestValidator {
|
949 | 948 | .unwrap(),
|
950 | 949 | )?;
|
951 | 950 |
|
952 |
| - let node_config = NodeConfig { |
953 |
| - gossip_addr: config.node_config.gossip_addr, |
954 |
| - port_range: config.node_config.port_range, |
955 |
| - bind_ip_addr: config.node_config.bind_ip_addr, |
956 |
| - public_tpu_addr: None, |
957 |
| - public_tpu_forwards_addr: None, |
958 |
| - num_quic_endpoints: NonZero::new(1).unwrap(), |
959 |
| - num_tvu_receive_sockets: NonZero::new(1).unwrap(), |
960 |
| - num_tvu_retransmit_sockets: NonZero::new(1).unwrap(), |
961 |
| - }; |
962 |
| - |
963 |
| - let port_range = node_config.port_range; |
964 |
| - let mut node = Node::new_with_external_ip(&validator_identity.pubkey(), node_config); |
965 |
| - let addr = node.info.gossip().unwrap().ip(); |
| 951 | + let mut node = Node::new_single_bind( |
| 952 | + &validator_identity.pubkey(), |
| 953 | + &config.node_config.gossip_addr, |
| 954 | + config.node_config.port_range, |
| 955 | + config.node_config.bind_ip_addr, |
| 956 | + ); |
966 | 957 | if let Some((rpc, rpc_pubsub)) = config.rpc_ports {
|
| 958 | + let addr = node.info.gossip().unwrap().ip(); |
967 | 959 | node.info.set_rpc((addr, rpc)).unwrap();
|
968 | 960 | node.info.set_rpc_pubsub((addr, rpc_pubsub)).unwrap();
|
969 |
| - } else { |
970 |
| - let rpc_port = find_available_port_in_range(addr, port_range).unwrap(); |
971 |
| - let rpc_pubsub_port = find_available_port_in_range(addr, port_range).unwrap(); |
972 |
| - node.info.set_rpc((addr, rpc_port)).unwrap(); |
973 |
| - node.info.set_rpc_pubsub((addr, rpc_pubsub_port)).unwrap(); |
974 | 961 | }
|
975 |
| - |
976 | 962 | let vote_account_address = validator_vote_account.pubkey();
|
977 | 963 | let rpc_url = format!("http://{}", node.info.rpc().unwrap());
|
978 | 964 | let rpc_pubsub_url = format!("ws://{}/", node.info.rpc_pubsub().unwrap());
|
|
0 commit comments