[−][src]Struct solana::cluster_info::ClusterInfo
Fields
gossip: CrdsGossipThe network
Methods
impl ClusterInfo[src]
pub fn new_with_invalid_keypair(contact_info: ContactInfo) -> Self[src]
Without a valid keypair gossip will not function. Only useful for tests.
pub fn new(contact_info: ContactInfo, keypair: Arc<Keypair>) -> Self[src]
pub fn insert_self(&mut self, contact_info: ContactInfo)[src]
pub fn insert_info(&mut self, contact_info: ContactInfo)[src]
pub fn set_entrypoint(&mut self, entrypoint: ContactInfo)[src]
pub fn id(&self) -> Pubkey[src]
pub fn lookup(&self, id: &Pubkey) -> Option<&ContactInfo>[src]
pub fn my_data(&self) -> ContactInfo[src]
pub fn contact_info_trace(&self) -> String[src]
pub fn push_epoch_slots(&mut self, id: Pubkey, root: u64, slots: BTreeSet<u64>)[src]
pub fn push_vote(&mut self, vote: Transaction)[src]
pub fn get_votes(&self, since: u64) -> (Vec<Transaction>, u64)[src]
Get votes in the crds
-
since - The timestamp of when the vote inserted must be greater than since. This allows the bank to query for new votes only.
-
return - The votes, and the max timestamp from the new set.
pub fn get_epoch_state_for_node(
&self,
pubkey: &Pubkey,
since: Option<u64>
) -> Option<(&EpochSlots, u64)>[src]
&self,
pubkey: &Pubkey,
since: Option<u64>
) -> Option<(&EpochSlots, u64)>
pub fn get_gossiped_root_for_node(
&self,
pubkey: &Pubkey,
since: Option<u64>
) -> Option<u64>[src]
&self,
pubkey: &Pubkey,
since: Option<u64>
) -> Option<u64>
pub fn get_contact_info_for_node(&self, pubkey: &Pubkey) -> Option<&ContactInfo>[src]
pub fn purge(&mut self, now: u64)[src]
pub fn rpc_peers(&self) -> Vec<ContactInfo>[src]
pub fn gossip_peers(&self) -> Vec<ContactInfo>[src]
pub fn tvu_peers(&self) -> Vec<ContactInfo>[src]
all peers that have a valid tvu port.
pub fn storage_peers(&self) -> Vec<ContactInfo>[src]
all peers that have a valid storage addr
pub fn retransmit_peers(&self) -> Vec<ContactInfo>[src]
all peers that have a valid tvu
pub fn is_replicator(contact_info: &ContactInfo) -> bool[src]
pub fn shuffle_peers_and_index<S: BuildHasher>(
&self,
stakes: Option<&HashMap<Pubkey, u64, S>>,
rng: ChaChaRng
) -> (usize, Vec<ContactInfo>)[src]
&self,
stakes: Option<&HashMap<Pubkey, u64, S>>,
rng: ChaChaRng
) -> (usize, Vec<ContactInfo>)
Return sorted Retransmit peers and index of Self.id() as if it were in that list
pub fn sorted_tvu_peers(
&self,
stakes: Option<&HashMap<Pubkey, u64>>,
rng: ChaChaRng
) -> Vec<ContactInfo>[src]
&self,
stakes: Option<&HashMap<Pubkey, u64>>,
rng: ChaChaRng
) -> Vec<ContactInfo>
pub fn tpu_peers(&self) -> Vec<ContactInfo>[src]
compute broadcast table
pub fn describe_data_plane(nodes: usize, fanout: usize) -> (usize, Vec<usize>)[src]
Given a node count and fanout, it calculates how many layers are needed and at what index each layer begins.
pub fn broadcast<I>(
&self,
s: &UdpSocket,
blobs: I,
stakes: Option<&HashMap<Pubkey, u64>>
) -> Result<()> where
I: IntoIterator,
I::Item: Borrow<SharedBlob>, [src]
&self,
s: &UdpSocket,
blobs: I,
stakes: Option<&HashMap<Pubkey, u64>>
) -> Result<()> where
I: IntoIterator,
I::Item: Borrow<SharedBlob>,
broadcast messages from the leader to layer 1 nodes
Remarks
pub fn retransmit_to(
obj: &Arc<RwLock<Self>>,
peers: &[ContactInfo],
blob: &SharedBlob,
slot_leader_pubkey: Option<Pubkey>,
s: &UdpSocket,
forwarded: bool
) -> Result<()>[src]
obj: &Arc<RwLock<Self>>,
peers: &[ContactInfo],
blob: &SharedBlob,
slot_leader_pubkey: Option<Pubkey>,
s: &UdpSocket,
forwarded: bool
) -> Result<()>
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 window_index_request_bytes(
&self,
slot: u64,
blob_index: u64
) -> Result<Vec<u8>>[src]
&self,
slot: u64,
blob_index: u64
) -> Result<Vec<u8>>
pub fn repair_request(
&self,
repair_request: &RepairType
) -> Result<(SocketAddr, Vec<u8>)>[src]
&self,
repair_request: &RepairType
) -> Result<(SocketAddr, Vec<u8>)>
pub fn map_repair_request(&self, repair_request: &RepairType) -> Result<Vec<u8>>[src]
pub fn gossip(
obj: Arc<RwLock<Self>>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
blob_sender: BlobSender,
exit: &Arc<AtomicBool>
) -> JoinHandle<()>[src]
obj: Arc<RwLock<Self>>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
blob_sender: BlobSender,
exit: &Arc<AtomicBool>
) -> JoinHandle<()>
randomly pick a node and ask them for updates asynchronously
pub fn listen(
me: Arc<RwLock<Self>>,
blocktree: Option<Arc<Blocktree>>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
requests_receiver: BlobReceiver,
response_sender: BlobSender,
exit: &Arc<AtomicBool>
) -> JoinHandle<()>[src]
me: Arc<RwLock<Self>>,
blocktree: Option<Arc<Blocktree>>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
requests_receiver: BlobReceiver,
response_sender: BlobSender,
exit: &Arc<AtomicBool>
) -> JoinHandle<()>
pub fn gossip_node(
id: &Pubkey,
gossip_addr: &SocketAddr
) -> (ContactInfo, UdpSocket)[src]
id: &Pubkey,
gossip_addr: &SocketAddr
) -> (ContactInfo, UdpSocket)
An alternative to Spy Node that has a valid gossip address and fully participate in Gossip.
pub fn spy_node(id: &Pubkey) -> (ContactInfo, UdpSocket)[src]
A Node with invalid ports to spy on gossip via pull requests
Trait Implementations
impl Clone for ClusterInfo[src]
fn clone(&self) -> ClusterInfo[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl Unpin for ClusterInfo
impl Send for ClusterInfo
impl Sync for ClusterInfo
impl RefUnwindSafe for ClusterInfo
impl UnwindSafe for ClusterInfo
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,