Struct solana_gossip::cluster_info::ClusterInfo
source · [−]pub struct ClusterInfo {
pub gossip: CrdsGossip,
/* private fields */
}
Fields
gossip: CrdsGossip
The network
Implementations
sourceimpl ClusterInfo
impl ClusterInfo
pub fn new(
contact_info: ContactInfo,
keypair: Arc<Keypair>,
socket_addr_space: SocketAddrSpace
) -> Self
pub fn clone_with_id(&self, new_id: &Pubkey) -> Self
pub fn set_contact_debug_interval(&mut self, new: u64)
pub fn socket_addr_space(&self) -> &SocketAddrSpace
pub fn insert_info(&self, contact_info: ContactInfo)
pub fn set_entrypoint(&self, entrypoint: ContactInfo)
pub fn set_entrypoints(&self, entrypoints: Vec<ContactInfo>)
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 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 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_snapshot_hashes(&self, snapshot_hashes: Vec<(Slot, Hash)>)
pub fn push_incremental_snapshot_hashes(
&self,
base: (Slot, Hash),
hashes: 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>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_votes(&self, cursor: &mut Cursor) -> Vec<Transaction>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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> 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>
sourcepub fn get_epoch_slots(&self, cursor: &mut Cursor) -> Vec<EpochSlots>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_epoch_slots(&self, cursor: &mut Cursor) -> Vec<EpochSlots>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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<Version>
sourcepub fn all_rpc_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn all_rpc_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
all validators that have a valid rpc port regardless of shred_version
.
pub fn all_peers(&self) -> Vec<(ContactInfo, u64)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn gossip_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn all_tvu_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn all_tvu_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
all validators that have a valid tvu port regardless of shred_version
.
sourcepub fn tvu_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn tvu_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
all validators that have a valid tvu port and are on the same shred_version
.
sourcepub fn repair_peers(&self, slot: Slot) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn repair_peers(&self, slot: Slot) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
all tvu peers with valid gossip addrs that likely have the slot being requested
sourcepub fn tpu_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn tpu_peers(&self) -> Vec<ContactInfo>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> TupleTree<T, ()> for T
impl<T> TupleTree<T, ()> for T
const SIZE: Size = Size{ degree: 0, descendants: 0,}
fn descendants(_indirect_level: usize) -> usize
fn height() -> usize
fn preorder(self, f: &mut impl FnMut(Visit<T>))
fn preorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
fn postorder(self, f: &mut impl FnMut(Visit<T>))
fn postorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more