Struct solana_local_cluster::local_cluster::LocalCluster
source · pub struct LocalCluster {
pub funding_keypair: Keypair,
pub entry_point_info: ContactInfo,
pub validators: HashMap<Pubkey, ClusterValidatorInfo>,
pub genesis_config: GenesisConfig,
pub connection_cache: Arc<ConnectionCache>,
}
Fields§
§funding_keypair: Keypair
Keypair with funding to participate in the network
entry_point_info: ContactInfo
Entry point from which the rest of the network can be discovered
validators: HashMap<Pubkey, ClusterValidatorInfo>
§genesis_config: GenesisConfig
§connection_cache: Arc<ConnectionCache>
Implementations§
source§impl LocalCluster
impl LocalCluster
pub fn new_with_equal_stakes( num_nodes: usize, cluster_lamports: u64, lamports_per_node: u64, socket_addr_space: SocketAddrSpace ) -> Self
pub fn new( config: &mut ClusterConfig, socket_addr_space: SocketAddrSpace ) -> Self
pub fn exit(&mut self)
pub fn close_preserve_ledgers(&mut self)
sourcepub fn add_validator_listener(
&mut self,
validator_config: &ValidatorConfig,
stake: u64,
validator_keypair: Arc<Keypair>,
voting_keypair: Option<Arc<Keypair>>,
socket_addr_space: SocketAddrSpace
) -> Pubkey
pub fn add_validator_listener( &mut self, validator_config: &ValidatorConfig, stake: u64, validator_keypair: Arc<Keypair>, voting_keypair: Option<Arc<Keypair>>, socket_addr_space: SocketAddrSpace ) -> Pubkey
Set up validator without voting or staking accounts
sourcepub fn add_validator(
&mut self,
validator_config: &ValidatorConfig,
stake: u64,
validator_keypair: Arc<Keypair>,
voting_keypair: Option<Arc<Keypair>>,
socket_addr_space: SocketAddrSpace
) -> Pubkey
pub fn add_validator( &mut self, validator_config: &ValidatorConfig, stake: u64, validator_keypair: Arc<Keypair>, voting_keypair: Option<Arc<Keypair>>, socket_addr_space: SocketAddrSpace ) -> Pubkey
Set up validator with voting and staking accounts
pub fn ledger_path(&self, validator_pubkey: &Pubkey) -> PathBuf
pub fn transfer( &self, source_keypair: &Keypair, dest_pubkey: &Pubkey, lamports: u64 ) -> u64
pub fn check_for_new_roots( &self, num_new_roots: usize, test_name: &str, socket_addr_space: SocketAddrSpace )
pub fn check_no_new_roots( &self, num_slots_to_wait: usize, test_name: &str, socket_addr_space: SocketAddrSpace )
pub fn create_dummy_load_only_snapshot_config() -> SnapshotConfig
source§impl LocalCluster
impl LocalCluster
sourcepub fn wait_for_next_full_snapshot<T>(
&self,
full_snapshot_archives_dir: T,
max_wait_duration: Option<Duration>
) -> FullSnapshotArchiveInfo
pub fn wait_for_next_full_snapshot<T>( &self, full_snapshot_archives_dir: T, max_wait_duration: Option<Duration> ) -> FullSnapshotArchiveInfo
Return the next full snapshot archive info after the cluster’s last processed slot
sourcepub fn wait_for_next_incremental_snapshot(
&self,
full_snapshot_archives_dir: impl AsRef<Path>,
incremental_snapshot_archives_dir: impl AsRef<Path>,
max_wait_duration: Option<Duration>
) -> (IncrementalSnapshotArchiveInfo, FullSnapshotArchiveInfo)
pub fn wait_for_next_incremental_snapshot( &self, full_snapshot_archives_dir: impl AsRef<Path>, incremental_snapshot_archives_dir: impl AsRef<Path>, max_wait_duration: Option<Duration> ) -> (IncrementalSnapshotArchiveInfo, FullSnapshotArchiveInfo)
Return the next incremental snapshot archive info (and associated full snapshot archive info) after the cluster’s last processed slot
Trait Implementations§
source§impl Cluster for LocalCluster
impl Cluster for LocalCluster
fn get_node_pubkeys(&self) -> Vec<Pubkey>
fn get_validator_client(&self, pubkey: &Pubkey) -> Option<ThinClient>
fn exit_node(&mut self, pubkey: &Pubkey) -> ClusterValidatorInfo
fn create_restart_context( &mut self, pubkey: &Pubkey, cluster_validator_info: &mut ClusterValidatorInfo ) -> (Node, Option<ContactInfo>)
fn set_entry_point(&mut self, entry_point_info: ContactInfo)
fn restart_node( &mut self, pubkey: &Pubkey, cluster_validator_info: ClusterValidatorInfo, socket_addr_space: SocketAddrSpace )
fn add_node( &mut self, pubkey: &Pubkey, cluster_validator_info: ClusterValidatorInfo )
fn restart_node_with_context( cluster_validator_info: ClusterValidatorInfo, (node, entry_point_info): (Node, Option<ContactInfo>), socket_addr_space: SocketAddrSpace ) -> ClusterValidatorInfo
fn exit_restart_node( &mut self, pubkey: &Pubkey, validator_config: ValidatorConfig, socket_addr_space: SocketAddrSpace )
fn get_contact_info(&self, pubkey: &Pubkey) -> Option<&ContactInfo>
fn send_shreds_to_validator( &self, dup_shreds: Vec<&Shred>, validator_key: &Pubkey )
Auto Trait Implementations§
impl !RefUnwindSafe for LocalCluster
impl Send for LocalCluster
impl Sync for LocalCluster
impl Unpin for LocalCluster
impl !UnwindSafe for LocalCluster
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
Mutably borrows from an owned value. Read more
§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>
Wrap the input message
T
in a tonic::Request