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

source

pub fn new_with_equal_stakes( num_nodes: usize, cluster_lamports: u64, lamports_per_node: u64, socket_addr_space: SocketAddrSpace ) -> Self

source

pub fn new( config: &mut ClusterConfig, socket_addr_space: SocketAddrSpace ) -> Self

source

pub fn exit(&mut self)

source

pub fn close_preserve_ledgers(&mut self)

source

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

source

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

source

pub fn ledger_path(&self, validator_pubkey: &Pubkey) -> PathBuf

source

pub fn transfer( &self, source_keypair: &Keypair, dest_pubkey: &Pubkey, lamports: u64 ) -> u64

source

pub fn check_for_new_roots( &self, num_new_roots: usize, test_name: &str, socket_addr_space: SocketAddrSpace )

source

pub fn check_no_new_roots( &self, num_slots_to_wait: usize, test_name: &str, socket_addr_space: SocketAddrSpace )

source

pub fn create_dummy_load_only_snapshot_config() -> SnapshotConfig

source§

impl LocalCluster

source

pub fn wait_for_next_full_snapshot<T>( &self, full_snapshot_archives_dir: T, max_wait_duration: Option<Duration> ) -> FullSnapshotArchiveInfo
where T: AsRef<Path>,

Return the next full snapshot archive info after the cluster’s last processed slot

source

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

source§

fn get_node_pubkeys(&self) -> Vec<Pubkey>

source§

fn get_validator_client(&self, pubkey: &Pubkey) -> Option<ThinClient>

source§

fn exit_node(&mut self, pubkey: &Pubkey) -> ClusterValidatorInfo

source§

fn create_restart_context( &mut self, pubkey: &Pubkey, cluster_validator_info: &mut ClusterValidatorInfo ) -> (Node, Option<ContactInfo>)

source§

fn set_entry_point(&mut self, entry_point_info: ContactInfo)

source§

fn restart_node( &mut self, pubkey: &Pubkey, cluster_validator_info: ClusterValidatorInfo, socket_addr_space: SocketAddrSpace )

source§

fn add_node( &mut self, pubkey: &Pubkey, cluster_validator_info: ClusterValidatorInfo )

source§

fn restart_node_with_context( cluster_validator_info: ClusterValidatorInfo, (node, entry_point_info): (Node, Option<ContactInfo>), socket_addr_space: SocketAddrSpace ) -> ClusterValidatorInfo

source§

fn exit_restart_node( &mut self, pubkey: &Pubkey, validator_config: ValidatorConfig, socket_addr_space: SocketAddrSpace )

source§

fn get_contact_info(&self, pubkey: &Pubkey) -> Option<&ContactInfo>

source§

fn send_shreds_to_validator( &self, dup_shreds: Vec<&Shred>, validator_key: &Pubkey )

source§

impl Drop for LocalCluster

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> AbiExample for T

§

default fn example() -> T

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> TupleTree<T, ()> for T

source§

const SIZE: Size = _

source§

fn descendants(_indirect_level: usize) -> usize

source§

fn height() -> usize

source§

fn preorder(self, f: &mut impl FnMut(Visit<T>))

source§

fn preorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))

source§

fn postorder(self, f: &mut impl FnMut(Visit<T>))

source§

fn postorder_with_size_hint(self, f: &mut impl FnMut(Visit<T>, Size))

§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more