Struct solana_core::cluster_info::ClusterInfo [−][src]
pub struct ClusterInfo {
pub gossip: RwLock<CrdsGossip>,
// some fields omitted
}
Fields
gossip: RwLock<CrdsGossip>
The network
Implementations
Without a valid keypair gossip will not function. Only useful for tests.
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>
Returns votes inserted since the given cursor.
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,
all validators that have a valid rpc port regardless of shred_version
.
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
.
all tvu peers with valid gossip addrs that likely have the slot being requested
pub fn sorted_retransmit_peers_and_stakes(
&self,
stakes: Option<&HashMap<Pubkey, u64>>
) -> (Vec<ContactInfo>, Vec<(u64, usize)>)
Return sorted Retransmit peers and index of Self.id()
as if it were in that list
compute broadcast table
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: PacketSender,
gossip_validators: Option<HashSet<Pubkey>>,
exit: Arc<AtomicBool>
) -> JoinHandle<()>
pub fn gossip(
self: Arc<Self>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
sender: PacketSender,
gossip_validators: Option<HashSet<Pubkey>>,
exit: Arc<AtomicBool>
) -> JoinHandle<()>
randomly pick a node and ask them for updates asynchronously
pub fn gossip_contact_info(
id: &Pubkey,
gossip: SocketAddr,
shred_version: u16
) -> ContactInfo
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
Trait Implementations
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
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