Struct solana_gossip::cluster_info::ClusterInfo [−][src]
pub struct ClusterInfo {
pub gossip: CrdsGossip,
// some fields omitted
}
Fields
gossip: CrdsGossip
The network
Implementations
pub fn new(
contact_info: ContactInfo,
keypair: Arc<Keypair>,
socket_addr_space: SocketAddrSpace
) -> Self
pub fn lookup_contact_info<F, Y>(&self, id: &Pubkey, map: F) -> Option<Y> where
F: FnOnce(&ContactInfo) -> Y,
pub fn lookup_contact_info_by_gossip_addr(
&self,
gossip_addr: &SocketAddr
) -> Option<ContactInfo>
pub fn push_incremental_snapshot_hashes(
&self,
base: (Slot, Hash),
hashes: Vec<(Slot, Hash)>
) -> Result<(), ClusterInfoError>
pub fn send_transaction(
&self,
transaction: &Transaction,
tpu: Option<SocketAddr>
) -> Result<(), GossipError>
Returns votes inserted since the given cursor.
pub fn get_votes_with_labels(
&self,
cursor: &mut Cursor
) -> (Vec<CrdsValueLabel>, Vec<Transaction>)
pub fn get_votes_with_labels(
&self,
cursor: &mut Cursor
) -> (Vec<CrdsValueLabel>, Vec<Transaction>)
Returns votes and the associated labels inserted since the given cursor.
pub fn push_duplicate_shred(
&self,
shred: &Shred,
other_payload: &[u8]
) -> Result<(), GossipError>
pub fn get_accounts_hash_for_node<F, Y>(
&self,
pubkey: &Pubkey,
map: F
) -> Option<Y> where
F: FnOnce(&Vec<(Slot, Hash)>) -> Y,
pub fn get_snapshot_hash_for_node<F, Y>(
&self,
pubkey: &Pubkey,
map: F
) -> Option<Y> where
F: FnOnce(&Vec<(Slot, Hash)>) -> Y,
pub fn get_incremental_snapshot_hashes_for_node(
&self,
pubkey: &Pubkey
) -> Option<IncrementalSnapshotHashes>
Returns epoch-slots inserted since the given cursor. Excludes entries from nodes with unkown or different shred version.
pub fn all_rpc_peers(&self) -> Vec<ContactInfo>ⓘ
pub fn all_rpc_peers(&self) -> Vec<ContactInfo>ⓘ
all validators that have a valid rpc port regardless of shred_version
.
pub fn gossip_peers(&self) -> Vec<ContactInfo>ⓘ
pub fn all_tvu_peers(&self) -> Vec<ContactInfo>ⓘ
pub fn all_tvu_peers(&self) -> Vec<ContactInfo>ⓘ
all validators that have a valid tvu port regardless of shred_version
.
all validators that have a valid tvu port and are on the same shred_version
.
pub fn repair_peers(&self, slot: Slot) -> Vec<ContactInfo>ⓘ
pub fn repair_peers(&self, slot: Slot) -> Vec<ContactInfo>ⓘ
all tvu peers with valid gossip addrs that likely have the slot being requested
compute broadcast table
pub fn retransmit_to(
peers: &[&ContactInfo],
data: &[u8],
s: &UdpSocket,
forwarded: bool,
socket_addr_space: &SocketAddrSpace
)
pub fn retransmit_to(
peers: &[&ContactInfo],
data: &[u8],
s: &UdpSocket,
forwarded: bool,
socket_addr_space: &SocketAddrSpace
)
retransmit messages to a list of nodes
Remarks
We need to avoid having obj locked while doing a io, such as the send_to
pub fn gossip(
self: Arc<Self>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
sender: PacketBatchSender,
gossip_validators: Option<HashSet<Pubkey>>,
exit: Arc<AtomicBool>
) -> JoinHandle<()>
pub fn gossip(
self: Arc<Self>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
sender: PacketBatchSender,
gossip_validators: Option<HashSet<Pubkey>>,
exit: Arc<AtomicBool>
) -> JoinHandle<()>
randomly pick a node and ask them for updates asynchronously
pub fn gossip_node(
id: Pubkey,
gossip_addr: &SocketAddr,
shred_version: u16
) -> (ContactInfo, UdpSocket, Option<TcpListener>)
pub fn gossip_node(
id: Pubkey,
gossip_addr: &SocketAddr,
shred_version: u16
) -> (ContactInfo, UdpSocket, Option<TcpListener>)
An alternative to Spy Node that has a valid gossip address and fully participate in Gossip.
pub fn spy_node(
id: Pubkey,
shred_version: u16
) -> (ContactInfo, UdpSocket, Option<TcpListener>)
pub fn spy_node(
id: Pubkey,
shred_version: u16
) -> (ContactInfo, UdpSocket, Option<TcpListener>)
A Node with dummy ports to spy on gossip via pull requests
Auto Trait Implementations
impl RefUnwindSafe for ClusterInfo
impl Send for ClusterInfo
impl Sync for ClusterInfo
impl Unpin for ClusterInfo
impl UnwindSafe for ClusterInfo
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T
in a tonic::Request
impl<T> TupleTree<T, ()> for T
impl<T> TupleTree<T, ()> for T
pub const SIZE: Size
pub fn descendants(_indirect_level: usize) -> usize
pub fn preorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
pub fn postorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more