pub struct Cluster {
    pub committee_shared: SharedCommittee,
    pub worker_cache_shared: SharedWorkerCache,
    /* private fields */
}

Fields

committee_shared: SharedCommitteeworker_cache_shared: SharedWorkerCache

Implementations

Initialises a new cluster by the provided parameters. The cluster will create all the authorities (primaries & workers) that are defined under the committee structure, but none of them will be started.

When the internal_consensus_enabled is true then the standard internal consensus engine will be enabled. If false, then the internal consensus will be disabled and the gRPC server will be enabled to manage the Collections & the DAG externally.

Starts a cluster by the defined number of authorities. The authorities will be started sequentially started from the one with id zero up to the provided number authorities_number. If none number is provided, then the maximum number of authorities will be started. If a number higher than the available ones in the committee is provided then the method will panic. The workers_per_authority dictates how many workers per authority should also be started (the same number will be started for each authority). If none is provided then the maximum number of workers will be started. If the boot_wait_time is provided then between node starts we’ll wait for this time before the next node is started. This is useful to simulate staggered node starts. If none is provided then the nodes will be started immediately the one after the other.

Starts the authority node by the defined id - if not already running - and the details are returned. If the node is already running then a panic is thrown instead. When the preserve_store is true, then the started authority will use the same path that has been used the last time when started (both the primary and the workers). This is basically a way to use the same storage between node restarts. When the preserve_store is false, then authority will start with an empty storage. If the workers_per_authority is provided then the corresponding number of workers will be started per authority. Otherwise if not provided, then maximum number of workers will be started per authority.

This method stops the authority (both the primary and the worker nodes) with the provided id.

Returns all the running authorities. Any authority that:

  • has been started ever
  • or has been stopped will not be returned by this method.

Returns the authority identified by the provided id. Will panic if the authority with the id is not found. The returned authority can be freely cloned and managed without having the need to fetch again.

This method asserts the progress of the cluster. expected_nodes: Nodes expected to have made progress. Any number different than that will make the assertion fail. commit_threshold: The acceptable threshold between the minimum and maximum reported commit value from the nodes.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Wrap the input message T in a Request
Wrap the input message T in a tonic::Request
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more