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_wasm_override(self, location: impl Into<AssetLocation>) -> Self
pub fn with_wasm_override(self, location: impl Into<AssetLocation>) -> Self
Set the location of a wasm to override the chain-spec.
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_validator(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> RelaychainConfigBuilder<WithAtLeastOneNode>
pub fn with_validator( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> RelaychainConfigBuilder<WithAtLeastOneNode>
Add a new validator node using a nested NodeConfigBuilder
.
The node will be configured as a validator (authority) with the –validator flag.
Sourcepub fn with_fullnode(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> RelaychainConfigBuilder<WithAtLeastOneNode>
pub fn with_fullnode( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> RelaychainConfigBuilder<WithAtLeastOneNode>
Add a new full node using a nested NodeConfigBuilder
.
The node will be configured as a full node (non-validator).
Sourcepub fn with_node(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> RelaychainConfigBuilder<WithAtLeastOneNode>
👎Deprecated since 0.4.0: Use with_validator()
for validator nodes or with_fullnode()
for full nodes instead
pub fn with_node( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> RelaychainConfigBuilder<WithAtLeastOneNode>
with_validator()
for validator nodes or with_fullnode()
for full nodes insteadAdd a new node using a nested NodeConfigBuilder
.
Deprecated: Use [with_validator
] for validator nodes or [with_fullnode
] for full nodes instead.
Sourcepub fn with_node_group(
self,
f: impl FnOnce(GroupNodeConfigBuilder<Initial>) -> GroupNodeConfigBuilder<Buildable>,
) -> RelaychainConfigBuilder<WithAtLeastOneNode>
pub fn with_node_group( self, f: impl FnOnce(GroupNodeConfigBuilder<Initial>) -> GroupNodeConfigBuilder<Buildable>, ) -> RelaychainConfigBuilder<WithAtLeastOneNode>
Add a new group node using a nested GroupNodeConfigBuilder
.
Sourcepub fn with_raw_spec_override(self, overrides: impl Into<JsonOverrides>) -> Self
pub fn with_raw_spec_override(self, overrides: impl Into<JsonOverrides>) -> Self
Set the location or inline value of a json to override the raw chain-spec.
Source§impl RelaychainConfigBuilder<WithAtLeastOneNode>
impl RelaychainConfigBuilder<WithAtLeastOneNode>
Sourcepub fn with_validator(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> RelaychainConfigBuilder<WithAtLeastOneNode>
pub fn with_validator( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> RelaychainConfigBuilder<WithAtLeastOneNode>
Add a new validator node using a nested NodeConfigBuilder
.
The node will be configured as a validator (authority) with the –validator flag.
Sourcepub fn with_fullnode(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> Self
pub fn with_fullnode( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> Self
Add a new full node using a nested NodeConfigBuilder
.
The node will be configured as a full node (non-validator).
Sourcepub fn with_node(
self,
f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>,
) -> Self
👎Deprecated since 0.4.0: Use with_validator()
for validator nodes or with_fullnode()
for full nodes instead
pub fn with_node( self, f: impl FnOnce(NodeConfigBuilder<Initial>) -> NodeConfigBuilder<Buildable>, ) -> Self
with_validator()
for validator nodes or with_fullnode()
for full nodes insteadAdd a new node using a nested NodeConfigBuilder
.
Deprecated: Use [with_validator
] for validator nodes or [with_fullnode
] for full nodes instead.
Sourcepub fn with_node_group(
self,
f: impl FnOnce(GroupNodeConfigBuilder<Initial>) -> GroupNodeConfigBuilder<Buildable>,
) -> Self
pub fn with_node_group( self, f: impl FnOnce(GroupNodeConfigBuilder<Initial>) -> GroupNodeConfigBuilder<Buildable>, ) -> Self
Add a new group node using a nested GroupNodeConfigBuilder
.
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.