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,
}
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
Implementations
sourceimpl 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
)
sourceimpl LocalCluster
impl LocalCluster
sourcepub fn wait_for_next_full_snapshot(
&self,
snapshot_archives_dir: impl AsRef<Path>
) -> FullSnapshotArchiveInfo
pub fn wait_for_next_full_snapshot(
&self,
snapshot_archives_dir: impl AsRef<Path>
) -> FullSnapshotArchiveInfo
Return the next full snapshot archive info after the cluster’s last processed slot
sourcepub fn wait_for_next_incremental_snapshot(
&self,
snapshot_archives_dir: impl AsRef<Path>
) -> (IncrementalSnapshotArchiveInfo, FullSnapshotArchiveInfo)
pub fn wait_for_next_incremental_snapshot(
&self,
snapshot_archives_dir: impl AsRef<Path>
) -> (IncrementalSnapshotArchiveInfo, FullSnapshotArchiveInfo)
Return the next incremental snapshot archive info (and associated full snapshot archive info) after the cluster’s last processed slot
sourcepub fn wait_for_next_snapshot(
&self,
snapshot_archives_dir: impl AsRef<Path>,
next_snapshot_type: NextSnapshotType
) -> NextSnapshotResult
pub fn wait_for_next_snapshot(
&self,
snapshot_archives_dir: impl AsRef<Path>,
next_snapshot_type: NextSnapshotType
) -> NextSnapshotResult
Return the next snapshot archive infos after the cluster’s last processed slot
Trait Implementations
sourceimpl Cluster for LocalCluster
impl Cluster for LocalCluster
fn get_node_pubkeys(&self) -> Vec<Pubkey>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn get_validator_client(
&self,
pubkey: &Pubkey
) -> Option<ThinClient<UdpTpuConnection>>
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 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>
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<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> 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
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