pub struct RelaychainConfigBuilder<State> { /* private fields */ }
Expand description
A relay chain configuration builder, used to build a RelaychainConfig
declaratively with fields validation.
Implementations§
source§impl RelaychainConfigBuilder<Initial>
impl RelaychainConfigBuilder<Initial>
pub fn new( validation_context: Rc<RefCell<ValidationContext>>, ) -> RelaychainConfigBuilder<Initial>
sourcepub fn with_chain<T>(self, chain: T) -> RelaychainConfigBuilder<WithChain>
pub fn with_chain<T>(self, chain: T) -> RelaychainConfigBuilder<WithChain>
Set the chain name (e.g. rococo-local).
source§impl RelaychainConfigBuilder<WithChain>
impl RelaychainConfigBuilder<WithChain>
sourcepub fn with_default_command<T>(self, command: T) -> Self
pub fn with_default_command<T>(self, command: T) -> Self
Set the default command used for nodes. Can be overridden.
sourcepub fn with_default_image<T>(self, image: T) -> Self
pub fn with_default_image<T>(self, image: T) -> Self
Set the default container image used for nodes. Can be overridden.
sourcepub fn with_default_resources(
self,
f: impl FnOnce(ResourcesBuilder) -> ResourcesBuilder,
) -> Self
pub fn with_default_resources( self, f: impl FnOnce(ResourcesBuilder) -> ResourcesBuilder, ) -> Self
Set the default resources limits used for nodes. Can be overridden.
sourcepub fn with_default_db_snapshot(
self,
location: impl Into<AssetLocation>,
) -> Self
pub fn with_default_db_snapshot( self, location: impl Into<AssetLocation>, ) -> Self
Set the default database snapshot location that will be used for state. Can be overridden.
sourcepub fn with_default_args(self, args: Vec<Arg>) -> Self
pub fn with_default_args(self, args: Vec<Arg>) -> Self
Set the default arguments that will be used to execute the node command. Can be overridden.
sourcepub fn with_chain_spec_path(self, location: impl Into<AssetLocation>) -> Self
pub fn with_chain_spec_path(self, location: impl Into<AssetLocation>) -> Self
Set the location of a pre-existing chain specification for the relay chain.
sourcepub fn with_chain_spec_command(self, cmd_template: impl Into<String>) -> Self
pub fn with_chain_spec_command(self, cmd_template: impl Into<String>) -> Self
Set the chain-spec command template for the relay chain.
sourcepub fn chain_spec_command_is_local(self, choice: bool) -> Self
pub fn chain_spec_command_is_local(self, choice: bool) -> Self
Set if the chain-spec command needs to be run locally or not (false by default)
sourcepub fn with_random_nominators_count(self, random_nominators_count: u32) -> Self
pub fn with_random_nominators_count(self, random_nominators_count: u32) -> Self
Set the number of random nominators
to create for chains using staking, this is used in tandem with max_nominations
to simulate the amount of nominators and nominations.
sourcepub fn with_max_nominations(self, max_nominations: u8) -> Self
pub fn with_max_nominations(self, max_nominations: u8) -> Self
Set the maximum number of nominations to create per nominator.
sourcepub fn with_genesis_overrides(self, genesis_overrides: impl Into<Value>) -> Self
pub fn with_genesis_overrides(self, genesis_overrides: impl Into<Value>) -> Self
Set the genesis overrides as a JSON object.
sourcepub fn with_node(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> RelaychainConfigBuilder<WithAtLeastOneNode>
pub fn with_node( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> RelaychainConfigBuilder<WithAtLeastOneNode>
Add a new node using a nested NodeConfigBuilder
.
source§impl RelaychainConfigBuilder<WithAtLeastOneNode>
impl RelaychainConfigBuilder<WithAtLeastOneNode>
sourcepub fn with_node(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> Self
pub fn with_node( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> Self
Add a new node using a nested NodeConfigBuilder
.
sourcepub fn build(self) -> Result<RelaychainConfig, Vec<Error>>
pub fn build(self) -> Result<RelaychainConfig, Vec<Error>>
Seals the builder and returns a RelaychainConfig
if there are no validation errors, else returns errors.
Trait Implementations§
Auto Trait Implementations§
impl<State> Freeze for RelaychainConfigBuilder<State>
impl<State> !RefUnwindSafe for RelaychainConfigBuilder<State>
impl<State> !Send for RelaychainConfigBuilder<State>
impl<State> !Sync for RelaychainConfigBuilder<State>
impl<State> Unpin for RelaychainConfigBuilder<State>where
State: Unpin,
impl<State> !UnwindSafe for RelaychainConfigBuilder<State>
Blanket Implementations§
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
§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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more