Struct solana_gossip::cluster_info::ClusterInfo
source · pub struct ClusterInfo {
pub gossip: CrdsGossip,
/* private fields */
}
Fields§
§gossip: CrdsGossip
The network
Implementations§
source§impl ClusterInfo
impl ClusterInfo
pub fn new( contact_info: ContactInfo, keypair: Arc<Keypair>, socket_addr_space: SocketAddrSpace ) -> Self
pub fn set_contact_debug_interval(&mut self, new: u64)
pub fn socket_addr_space(&self) -> &SocketAddrSpace
pub fn insert_legacy_info(&self, contact_info: LegacyContactInfo)
pub fn insert_info(&self, node: ContactInfo)
pub fn set_entrypoint(&self, entrypoint: LegacyContactInfo)
pub fn set_entrypoints(&self, entrypoints: Vec<LegacyContactInfo>)
pub fn save_contact_info(&self)
pub fn restore_contact_info( &mut self, contact_info_path: &Path, contact_save_interval: u64 )
pub fn id(&self) -> Pubkey
pub fn keypair(&self) -> RwLockReadGuard<'_, Arc<Keypair>>
pub fn set_keypair(&self, new_keypair: Arc<Keypair>)
pub fn set_tpu(&self, tpu_addr: SocketAddr) -> Result<(), ContactInfoError>
pub fn set_tpu_forwards( &self, tpu_forwards_addr: SocketAddr ) -> Result<(), ContactInfoError>
pub fn lookup_contact_info<F, Y>(&self, id: &Pubkey, map: F) -> Option<Y>where
F: FnOnce(&LegacyContactInfo) -> Y,
pub fn lookup_contact_info_by_gossip_addr( &self, gossip_addr: &SocketAddr ) -> Option<LegacyContactInfo>
pub fn my_contact_info(&self) -> ContactInfo
pub fn my_shred_version(&self) -> u16
pub fn rpc_info_trace(&self) -> String
pub fn contact_info_trace(&self) -> String
pub fn push_lowest_slot(&self, min: Slot)
pub fn push_epoch_slots(&self, update: &[Slot])
pub fn push_message(&self, message: CrdsValue)
pub fn push_accounts_hashes(&self, accounts_hashes: Vec<(Slot, Hash)>)
pub fn push_legacy_snapshot_hashes(&self, snapshot_hashes: Vec<(Slot, Hash)>)
pub fn push_snapshot_hashes( &self, full: (Slot, Hash), incremental: Vec<(Slot, Hash)> ) -> Result<(), ClusterInfoError>
pub fn push_vote_at_index(&self, vote: Transaction, vote_index: u8)
pub fn push_vote(&self, tower: &[Slot], vote: Transaction)
pub fn refresh_vote(&self, vote: Transaction, vote_slot: Slot)
pub fn send_transaction( &self, transaction: &Transaction, tpu: Option<SocketAddr> ) -> Result<(), GossipError>
sourcepub fn get_votes(&self, cursor: &mut Cursor) -> Vec<Transaction>
pub fn get_votes(&self, cursor: &mut Cursor) -> Vec<Transaction>
Returns votes inserted since the given cursor.
sourcepub 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>
pub fn get_legacy_snapshot_hash_for_node<F, Y>( &self, pubkey: &Pubkey, map: F ) -> Option<Y>
pub fn get_snapshot_hashes_for_node( &self, pubkey: &Pubkey ) -> Option<SnapshotHashes>
sourcepub fn get_epoch_slots(&self, cursor: &mut Cursor) -> Vec<EpochSlots>
pub fn get_epoch_slots(&self, cursor: &mut Cursor) -> Vec<EpochSlots>
Returns epoch-slots inserted since the given cursor. Excludes entries from nodes with unkown or different shred version.
pub fn get_node_version(&self, pubkey: &Pubkey) -> Option<LegacyVersion2>
sourcepub fn all_rpc_peers(&self) -> Vec<LegacyContactInfo>
pub fn all_rpc_peers(&self) -> Vec<LegacyContactInfo>
all validators that have a valid rpc port regardless of shred_version
.
pub fn all_peers(&self) -> Vec<(LegacyContactInfo, u64)>
pub fn gossip_peers(&self) -> Vec<LegacyContactInfo>
sourcepub fn all_tvu_peers(&self) -> Vec<LegacyContactInfo>
pub fn all_tvu_peers(&self) -> Vec<LegacyContactInfo>
all validators that have a valid tvu port regardless of shred_version
.
sourcepub fn tvu_peers(&self) -> Vec<LegacyContactInfo>
pub fn tvu_peers(&self) -> Vec<LegacyContactInfo>
all validators that have a valid tvu port and are on the same shred_version
.
sourcepub fn repair_peers(&self, slot: Slot) -> Vec<LegacyContactInfo>
pub fn repair_peers(&self, slot: Slot) -> Vec<LegacyContactInfo>
all tvu peers with valid gossip addrs that likely have the slot being requested
sourcepub fn tpu_peers(&self) -> Vec<LegacyContactInfo>
pub fn tpu_peers(&self) -> Vec<LegacyContactInfo>
compute broadcast table
pub fn flush_push_queue(&self)
sourcepub 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_contact_info( id: Pubkey, gossip: SocketAddr, shred_version: u16 ) -> ContactInfo
sourcepub 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.
sourcepub 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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request