Struct solana_core::cluster_info::ClusterInfo [−][src]
Fields
gossip: RwLock<CrdsGossip>
The network
Implementations
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 clone_with_id(&self, new_id: &Pubkey) -> Self
[src]
pub fn set_contact_debug_interval(&mut self, new: u64)
[src]
pub fn update_contact_info<F>(&self, modify: F) where
F: FnOnce(&mut ContactInfo),
[src]
F: FnOnce(&mut ContactInfo),
pub fn insert_info(&self, contact_info: ContactInfo)
[src]
pub fn set_entrypoint(&self, entrypoint: ContactInfo)
[src]
pub fn set_entrypoints(&self, entrypoints: Vec<ContactInfo>)
[src]
pub fn save_contact_info(&self)
[src]
pub fn restore_contact_info(
&mut self,
contact_info_path: &Path,
contact_save_interval: u64
)
[src]
&mut self,
contact_info_path: &Path,
contact_save_interval: u64
)
pub fn id(&self) -> Pubkey
[src]
pub fn lookup_contact_info<F, Y>(&self, id: &Pubkey, map: F) -> Option<Y> where
F: FnOnce(&ContactInfo) -> Y,
[src]
F: FnOnce(&ContactInfo) -> Y,
pub fn lookup_contact_info_by_gossip_addr(
&self,
gossip_addr: &SocketAddr
) -> Option<ContactInfo>
[src]
&self,
gossip_addr: &SocketAddr
) -> Option<ContactInfo>
pub fn my_contact_info(&self) -> ContactInfo
[src]
pub fn my_shred_version(&self) -> u16
[src]
pub fn lookup_epoch_slots(&self, ix: EpochSlotsIndex) -> EpochSlots
[src]
pub fn rpc_info_trace(&self) -> String
[src]
pub fn contact_info_trace(&self) -> String
[src]
pub fn push_lowest_slot(&self, id: Pubkey, min: Slot)
[src]
pub fn push_epoch_slots(&self, update: &[Slot])
[src]
pub fn push_message(&self, message: CrdsValue)
[src]
pub fn push_accounts_hashes(&self, accounts_hashes: Vec<(Slot, Hash)>)
[src]
pub fn push_snapshot_hashes(&self, snapshot_hashes: Vec<(Slot, Hash)>)
[src]
pub fn push_vote(&self, tower: &[Slot], vote: Transaction)
[src]
pub fn send_vote(&self, vote: &Transaction) -> Result<(), Error>
[src]
pub fn get_votes(
&self,
since: u64
) -> (Vec<CrdsValueLabel>, Vec<Transaction>, u64)
[src]
&self,
since: u64
) -> (Vec<CrdsValueLabel>, Vec<Transaction>, u64)
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_accounts_hash_for_node<F, Y>(
&self,
pubkey: &Pubkey,
map: F
) -> Option<Y> where
F: FnOnce(&Vec<(Slot, Hash)>) -> Y,
[src]
&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,
[src]
&self,
pubkey: &Pubkey,
map: F
) -> Option<Y> where
F: FnOnce(&Vec<(Slot, Hash)>) -> Y,
pub fn get_lowest_slot_for_node<F, Y>(
&self,
pubkey: &Pubkey,
since: Option<u64>,
map: F
) -> Option<Y> where
F: FnOnce(&LowestSlot, u64) -> Y,
[src]
&self,
pubkey: &Pubkey,
since: Option<u64>,
map: F
) -> Option<Y> where
F: FnOnce(&LowestSlot, u64) -> Y,
pub fn get_epoch_slots_since(
&self,
since: Option<u64>
) -> (Vec<EpochSlots>, Option<u64>)
[src]
&self,
since: Option<u64>
) -> (Vec<EpochSlots>, Option<u64>)
pub fn get_node_version(&self, pubkey: &Pubkey) -> Option<Version>
[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 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 sorted_retransmit_peers_and_stakes(
&self,
stakes: Option<&HashMap<Pubkey, u64>>
) -> (Vec<ContactInfo>, Vec<(u64, usize)>)
[src]
&self,
stakes: Option<&HashMap<Pubkey, u64>>
) -> (Vec<ContactInfo>, Vec<(u64, usize)>)
pub fn shuffle_peers_and_index(
id: &Pubkey,
peers: &[ContactInfo],
stakes_and_index: &[(u64, usize)],
seed: [u8; 32]
) -> (usize, Vec<(u64, usize)>)
[src]
id: &Pubkey,
peers: &[ContactInfo],
stakes_and_index: &[(u64, usize)],
seed: [u8; 32]
) -> (usize, Vec<(u64, usize)>)
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 retransmit_to(
peers: &[&ContactInfo],
packet: &mut Packet,
slot_leader_pubkey: Option<Pubkey>,
s: &UdpSocket,
forwarded: bool
) -> Result<(), Error>
[src]
peers: &[&ContactInfo],
packet: &mut Packet,
slot_leader_pubkey: Option<Pubkey>,
s: &UdpSocket,
forwarded: bool
) -> Result<(), Error>
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<()>
[src]
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 listen(
self: Arc<Self>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
requests_receiver: PacketReceiver,
response_sender: PacketSender,
should_check_duplicate_instance: bool,
exit: &Arc<AtomicBool>
) -> JoinHandle<()>
[src]
self: Arc<Self>,
bank_forks: Option<Arc<RwLock<BankForks>>>,
requests_receiver: PacketReceiver,
response_sender: PacketSender,
should_check_duplicate_instance: bool,
exit: &Arc<AtomicBool>
) -> JoinHandle<()>
pub fn gossip_contact_info(
id: &Pubkey,
gossip: SocketAddr,
shred_version: u16
) -> ContactInfo
[src]
id: &Pubkey,
gossip: SocketAddr,
shred_version: u16
) -> ContactInfo
pub fn gossip_node(
id: &Pubkey,
gossip_addr: &SocketAddr,
shred_version: u16
) -> (ContactInfo, UdpSocket, Option<TcpListener>)
[src]
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>)
[src]
id: &Pubkey,
shred_version: u16
) -> (ContactInfo, UdpSocket, Option<TcpListener>)
A Node with dummy ports to spy on gossip via pull requests
Trait Implementations
impl Default for ClusterInfo
[src]
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<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,