pub struct Spec {
Show 16 fields pub name: String, pub engine: Arc<dyn EthEngine>, pub data_dir: String, pub nodes: Vec<String>, pub parent_hash: H256, pub author: Address, pub difficulty: U256, pub gas_limit: U256, pub gas_used: U256, pub timestamp: u64, pub transactions_root: H256, pub receipts_root: H256, pub extra_data: Bytes, pub seal_rlp: Bytes, pub base_fee: Option<U256>, pub hard_forks: BTreeSet<BlockNumber>, /* private fields */
}
Expand description

Parameters for a block chain; includes both those intrinsic to the design of the chain and those to be interpreted by the active chain engine.

Fields

name: String

User friendly spec name

engine: Arc<dyn EthEngine>

What engine are we using for this?

data_dir: String

Name of the subdir inside the main data dir to use for chain data and settings.

nodes: Vec<String>

Known nodes on the network in enode format.

parent_hash: H256

The genesis block’s parent hash field.

author: Address

The genesis block’s author field.

difficulty: U256

The genesis block’s difficulty field.

gas_limit: U256

The genesis block’s gas limit field.

gas_used: U256

The genesis block’s gas used field.

timestamp: u64

The genesis block’s timestamp field.

transactions_root: H256

Transactions root of the genesis block. Should be KECCAK_NULL_RLP.

receipts_root: H256

Receipts root of the genesis block. Should be KECCAK_NULL_RLP.

extra_data: Bytes

The genesis block’s extra data field.

seal_rlp: Bytes

Each seal field, expressed as RLP, concatenated.

base_fee: Option<U256>

Base fee,

hard_forks: BTreeSet<BlockNumber>

List of hard forks in the network.

Implementations

Return the state root for the genesis state, memoising accordingly.

Get common blockchain parameters.

Get the known knodes of the network in enode format.

Get the configured Network ID.

Get the chain ID used for signing.

Get the configured subprotocol name.

Get the configured network fork block.

Get the header of the genesis block.

Compose the genesis block for this chain.

Overwrite the genesis components.

Alter the value of the genesis state.

Return genesis state as Plain old data.

Returns false if the memoized state root is invalid. true otherwise.

Ensure that the given state DB has the trie nodes in for the genesis state.

Loads just the state machine from a json file.

Loads spec from json file. Provide factories for executing contracts and ensuring storage goes to the right place.

initialize genesis epoch data, using in-memory database for constructor.

Create a new Spec with InstantSeal consensus which does internal sealing (not requiring work).

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

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.