Enum chain_spec_builder::ChainSpecBuilder[][src]

pub(crate) enum ChainSpecBuilder {
    New {
        authority_seeds: Vec<String>,
        nominator_accounts: Vec<String>,
        endowed_accounts: Vec<String>,
        sudo_account: String,
        chain_spec_path: PathBuf,
    },
    Generate {
        authorities: usize,
        nominators: usize,
        endowed: usize,
        chain_spec_path: PathBuf,
        keystore_path: Option<PathBuf>,
    },
}
Expand description

A utility to easily create a testnet chain spec definition with a given set of authorities and endowed accounts and/or generate random accounts.

Variants

New

Create a new chain spec with the given authorities, endowed and sudo accounts.

Show fields

Fields of New

authority_seeds: Vec<String>

Authority key seed.

nominator_accounts: Vec<String>

Active nominators (SS58 format), each backing a random subset of the aforementioned authorities.

endowed_accounts: Vec<String>

Endowed account address (SS58 format).

sudo_account: String

Sudo account address (SS58 format).

chain_spec_path: PathBuf

The path where the chain spec should be saved.

Generate

Create a new chain spec with the given number of authorities and endowed accounts. Random keys will be generated as required.

Show fields

Fields of Generate

authorities: usize

The number of authorities.

nominators: usize

The number of nominators backing the aforementioned authorities.

Will nominate a random subset of authorities.

endowed: usize

The number of endowed accounts.

chain_spec_path: PathBuf

The path where the chain spec should be saved.

keystore_path: Option<PathBuf>

Path to use when saving generated keystores for each authority.

At this path, a new folder will be created for each authority’s keystore named auth-$i where i is the authority index, i.e. auth-0, auth-1, etc.

Implementations

Returns the path where the chain spec should be saved.

Trait Implementations

Returns clap::App corresponding to the struct.

Builds the struct from clap::ArgMatches. It’s guaranteed to succeed if matches originates from an App generated by [StructOpt::clap] called on the same type, otherwise it must panic. Read more

Builds the struct from the command line arguments (std::env::args_os). Calls clap::Error::exit on failure, printing the error message and aborting the program. Read more

Builds the struct from the command line arguments (std::env::args_os). Unlike [StructOpt::from_args], returns clap::Error on failure instead of aborting the program, so calling .exit is up to you. Read more

Gets the struct from any iterator such as a Vec of your making. Print the error message and quit the program in case of failure. Read more

Gets the struct from any iterator such as a Vec of your making. Read more

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

Convert from a value of T into an equivalent instance of Option<Self>. Read more

Consume self to return Some equivalent value of Option<T>. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

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

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

Performs the conversion.

Cast reference.

Cast reference.

Cast mutable reference.

Cast mutable reference.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

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

Convert from a value of T into an equivalent instance of Self. Read more

Consume self to return an equivalent value of T. Read more

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

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.

The counterpart to unchecked_from.

Consume self to return an equivalent value of T.

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