Skip to content

Commit

Permalink
rpc: add tpu_forwards/tpu_forwards_quic to getClusterNodes
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Jun 12, 2024
1 parent 5ff764d commit dd65eab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rpc-client-api/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,12 @@ pub struct RpcContactInfo {
pub gossip: Option<SocketAddr>,
/// Tpu UDP port
pub tpu: Option<SocketAddr>,
/// Tpu UDP forwards port
pub tpu_forwards: Option<SocketAddr>,
/// Tpu QUIC port
pub tpu_quic: Option<SocketAddr>,
/// Tpu QUIC forwards port
pub tpu_forwards_quic: Option<SocketAddr>,
/// JSON RPC port
pub rpc: Option<SocketAddr>,
/// WebSocket PubSub port
Expand Down
2 changes: 2 additions & 0 deletions rpc-client/src/mock_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ impl RpcSender for MockSender {
pubkey: PUBKEY.to_string(),
gossip: Some(SocketAddr::from(([10, 239, 6, 48], 8899))),
tpu: Some(SocketAddr::from(([10, 239, 6, 48], 8856))),
tpu_forwards: Some(SocketAddr::from(([10, 239, 6, 48], 8857))),
tpu_quic: Some(SocketAddr::from(([10, 239, 6, 48], 8862))),
tpu_forwards_quic: Some(SocketAddr::from(([10, 239, 6, 48], 8863))),
rpc: Some(SocketAddr::from(([10, 239, 6, 48], 8899))),
pubsub: Some(SocketAddr::from(([10, 239, 6, 48], 8900))),
version: Some("1.0.0 c375ce1f".to_string()),
Expand Down
12 changes: 12 additions & 0 deletions rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3556,10 +3556,18 @@ pub mod rpc_full {
.tpu(Protocol::UDP)
.ok()
.filter(|addr| socket_addr_space.check(addr)),
tpu_forwards: contact_info
.tpu_forwards(Protocol::UDP)
.ok()
.filter(|addr| socket_addr_space.check(addr)),
tpu_quic: contact_info
.tpu(Protocol::QUIC)
.ok()
.filter(|addr| socket_addr_space.check(addr)),
tpu_forwards_quic: contact_info
.tpu_forwards(Protocol::QUIC)
.ok()
.filter(|addr| socket_addr_space.check(addr)),
rpc: contact_info
.rpc()
.ok()
Expand Down Expand Up @@ -5322,7 +5330,9 @@ pub mod tests {
"gossip": "127.0.0.1:8000",
"shredVersion": 0u16,
"tpu": "127.0.0.1:8003",
"tpuForwards": "127.0.0.1:8004",
"tpuQuic": "127.0.0.1:8009",
"tpuForwardsQuic": "127.0.0.1:8010",
"rpc": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PORT),
"pubsub": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PUBSUB_PORT),
"version": format!("{version}"),
Expand All @@ -5332,7 +5342,9 @@ pub mod tests {
"gossip": "127.0.0.1:1235",
"shredVersion": 0u16,
"tpu": "127.0.0.1:1234",
"tpuForwards": "127.0.0.1:1239",
"tpuQuic": "127.0.0.1:1240",
"tpuForwardsQuic": "127.0.0.1:1245",
"rpc": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PORT),
"pubsub": format!("127.0.0.1:{}", rpc_port::DEFAULT_RPC_PUBSUB_PORT),
"version": format!("{version}"),
Expand Down

0 comments on commit dd65eab

Please sign in to comment.