Struct ethcore::spec::spec::Spec [] [src]

pub struct Spec {
    pub name: String,
    pub engine: Arc<Engine>,
    pub data_dir: String,
    pub nodes: Vec<String>,
    pub params: CommonParams,
    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,
    // some fields omitted
}

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

User friendly spec name

What engine are we using for this?

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

Known nodes on the network in enode format.

Parameters common to all engines.

The genesis block's parent hash field.

The genesis block's author field.

The genesis block's difficulty field.

The genesis block's gas limit field.

The genesis block's gas used field.

The genesis block's timestamp field.

Transactions root of the genesis block. Should be SHA3_NULL_RLP.

Receipts root of the genesis block. Should be SHA3_NULL_RLP.

The genesis block's extra data field.

Each seal field, expressed as RLP, concatenated.

Methods

impl Spec
[src]

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

Get the known knodes of the network in enode format.

Get the configured Network ID.

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.

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 spec from json file.

Create a new Spec which conforms to the Frontier-era Morden chain except that it's a NullEngine consensus.

Create a new Spec which is a NullEngine consensus with a premine of address whose secret is sha3('').

Create a new Spec which constructs a contract at address 5 with storage at 0 equal to 1.

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

Create a new Spec with AuthorityRound consensus which does internal sealing (not requiring work). Accounts with secrets "0".sha3() and "1".sha3() are the validators.

Create a new Spec with Tendermint consensus which does internal sealing (not requiring work). Account "0".sha3() and "1".sha3() are a authorities.

TestList.sol used in both specs: https://github.com/ethcore/contracts/pull/30/files Accounts with secrets "0".sha3() and "1".sha3() are initially the validators. Create a new Spec with BasicAuthority which uses a contract at address 5 to determine the current validators using getValidators. Second validator can be removed with "0xbfc708a000000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f1" and added back in using "0x4d238c8e00000000000000000000000082a978b3f5962a5b0957d9ee9eef472ee55b42f1".

The same as the safeContract, but allows reporting and uses AuthorityRound. Account is marked with reportBenign it can be checked as disliked with "0xd8f2e0bf". Validator can be removed with reportMalicious.

Trait Implementations

impl From<Spec> for Spec
[src]

Performs the conversion.