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

pub struct Spec {
    pub name: String,
    pub engine: Arc<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 hardcoded_sync: Option<SpecHardcodedSync>,
    // 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.

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 KECCAK_NULL_RLP.

Receipts root of the genesis block. Should be KECCAK_NULL_RLP.

The genesis block's extra data field.

Each seal field, expressed as RLP, concatenated.

Hardcoded synchronization. Allows the light client to immediately jump to a specific block.

Methods

impl Spec
[src]

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

Get common blockchain parameters.

Important traits for &'a [u8]

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.

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).

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

Create the EthereumMachine corresponding to Spec::new_test.

Create a new Spec which conforms to the Frontier-era Morden chain except that it's a NullEngine consensus with applying reward on block close.

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

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

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

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

Create a new Spec with AuthorityRound consensus (with empty steps) using a block reward contract. The contract source code can be found at: https://github.com/parity-contracts/block-reward/blob/daf7d44383b6cdb11cb6b953b018648e2b027cfb/contracts/ExampleBlockReward.sol

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

TestList.sol used in both specs: https://github.com/paritytech/contracts/pull/30/files Accounts with secrets keccak("0") and keccak("1") 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.

Create a new Spec with BasicAuthority which uses multiple validator sets changing with height. Account with secrets keccak("0") is the validator for block 1 and with keccak("1") onwards.

Trait Implementations

Auto Trait Implementations

impl Send for Spec

impl Sync for Spec