[][src]Struct solana_core::cluster_info::ClusterInfo

pub struct ClusterInfo {
    pub gossip: CrdsGossip,
    // some fields omitted
}

Fields

gossip: CrdsGossip

The 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 compress_incomplete_slots(
    incomplete_slots: &BTreeSet<Slot>
) -> EpochIncompleteSlots
[src]

pub fn decompress_incomplete_slots(
    slots: &EpochIncompleteSlots
) -> BTreeSet<Slot>
[src]

pub fn push_epoch_slots(
    &mut self,
    id: Pubkey,
    root: Slot,
    min: Slot,
    slots: BTreeSet<Slot>,
    incomplete_slots: &BTreeSet<Slot>
)
[src]

pub fn push_message(&mut self, message: CrdsValue)[src]

pub fn push_accounts_hashes(&mut self, accounts_hashes: Vec<(Slot, Hash)>)[src]

pub fn push_snapshot_hashes(&mut self, snapshot_hashes: Vec<(Slot, Hash)>)[src]

pub fn push_vote(&mut self, tower_index: usize, 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_snapshot_hash(&self, slot: Slot) -> Vec<(Pubkey, Hash)>[src]

pub fn get_accounts_hash_for_node(
    &self,
    pubkey: &Pubkey
) -> Option<&Vec<(Slot, Hash)>>
[src]

pub fn get_snapshot_hash_for_node(
    &self,
    pubkey: &Pubkey
) -> Option<&Vec<(Slot, Hash)>>
[src]

pub fn get_epoch_state_for_node(
    &self,
    pubkey: &Pubkey,
    since: Option<u64>
) -> Option<(&EpochSlots, u64)>
[src]

pub fn get_contact_info_for_node(&self, pubkey: &Pubkey) -> Option<&ContactInfo>[src]

pub fn all_rpc_peers(&self) -> Vec<ContactInfo>[src]

all validators that have a valid rpc port regardless of shred_version.

pub fn gossip_peers(&self) -> Vec<ContactInfo>[src]

pub fn all_tvu_peers(&self) -> Vec<ContactInfo>[src]

all validators that have a valid tvu port regardless of shred_version.

pub fn tvu_peers(&self) -> Vec<ContactInfo>[src]

all validators that have a valid tvu port and are on the same shred_version.

pub fn all_storage_peers(&self) -> Vec<ContactInfo>[src]

all peers that have a valid storage addr regardless of shred_version.

pub fn storage_peers(&self) -> Vec<ContactInfo>[src]

all peers that have a valid storage addr and are on the same shred_version.

pub fn retransmit_peers(&self) -> Vec<ContactInfo>[src]

all peers that have a valid tvu

pub fn repair_peers(&self, slot: Slot) -> Vec<ContactInfo>[src]

all tvu peers with valid gossip addrs that likely have the slot being requested

pub fn is_archiver(contact_info: &ContactInfo) -> bool[src]

pub fn sorted_retransmit_peers_and_stakes(
    &self,
    stakes: Option<Arc<HashMap<Pubkey, u64>>>
) -> (Vec<ContactInfo>, Vec<(u64, usize)>)
[src]

pub fn shuffle_peers_and_index(
    id: &Pubkey,
    peers: &[ContactInfo],
    stakes_and_index: &[(u64, usize)],
    seed: [u8; 32]
) -> (usize, Vec<(u64, usize)>)
[src]

Return sorted Retransmit peers and index of Self.id() as if it were in that list

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_shreds(
    &mut self,
    s: &UdpSocket,
    shreds: Vec<Vec<u8>>,
    seeds: &[[u8; 32]],
    stakes: Option<Arc<HashMap<Pubkey, u64>>>
) -> Result<(), Error>
[src]

broadcast messages from the leader to layer 1 nodes

Remarks

pub fn retransmit_to(
    peers: &[&ContactInfo],
    packet: &mut Packet,
    slot_leader_pubkey: Option<Pubkey>,
    s: &UdpSocket,
    forwarded: bool
) -> Result<(), Error>
[src]

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(
    obj: Arc<RwLock<Self>>,
    bank_forks: Option<Arc<RwLock<BankForks>>>,
    sender: PacketSender,
    exit: &Arc<AtomicBool>
) -> JoinHandle<()>
[src]

randomly pick a node and ask them for updates asynchronously

pub fn listen(
    me: Arc<RwLock<Self>>,
    bank_forks: Option<Arc<RwLock<BankForks>>>,
    requests_receiver: PacketReceiver,
    response_sender: PacketSender,
    exit: &Arc<AtomicBool>
) -> JoinHandle<()>
[src]

pub fn gossip_contact_info(id: &Pubkey, gossip: SocketAddr) -> ContactInfo[src]

pub fn spy_contact_info(id: &Pubkey) -> ContactInfo[src]

pub fn gossip_node(
    id: &Pubkey,
    gossip_addr: &SocketAddr
) -> (ContactInfo, UdpSocket, Option<TcpListener>)
[src]

An alternative to Spy Node that has a valid gossip address and fully participate in Gossip.

pub fn spy_node(id: &Pubkey) -> (ContactInfo, UdpSocket, Option<TcpListener>)[src]

A Node with dummy ports to spy on gossip via pull requests

Trait Implementations

impl Clone for ClusterInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,