Struct vapcore_spec::Spec[][src]

pub struct Spec {
    pub name: String,
    pub engine: Arc<dyn Engine>,
    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>,
    pub constructors: Vec<(Address, Bytes)>,
    pub state_root: H256,
    pub genesis_state: PodState,
}

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 Engine>

Engine specified by json file.

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.

hardcoded_sync: Option<SpecHardcodedSync>

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

constructors: Vec<(Address, Bytes)>

Contract constructors to be executed on genesis.

state_root: H256

May be pre-populated if we know this in advance.

genesis_state: PodState

Genesis state as plain old data.

Implementations

impl Spec[src]

pub fn params(&self) -> &CommonParams[src]

Get common blockchain parameters.

pub fn network_id(&self) -> u64[src]

Get the configured Network ID.

pub fn chain_id(&self) -> u64[src]

Get the chain ID used for signing.

pub fn subprotocol_name(&self) -> String[src]

Get the configured subprotocol name.

pub fn fork_block(&self) -> Option<(BlockNumber, H256)>[src]

Get the configured network fork block.

pub fn genesis_header(&self) -> Header[src]

Get the header of the genesis block.

pub fn genesis_block(&self) -> Bytes[src]

Compose the genesis block for this chain.

pub fn overwrite_genesis_params(&mut self, g: Genesis)[src]

Overwrite the genesis components.

pub fn set_genesis_state(&mut self, s: PodState) -> Result<(), Error>[src]

Alter the value of the genesis state.

pub fn ensure_db_good<T: Backend>(
    &self,
    db: T,
    factories: &Factories
) -> Result<T, Error>
[src]

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

pub fn load_mashina<R: Read>(reader: R) -> Result<Machine, Error>[src]

Loads just the state mashina from a json file.

pub fn load<'a, T: Into<SpecParams<'a>>, R: Read>(
    params: T,
    reader: R
) -> Result<Self, Error>
[src]

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

pub fn genesis_epoch_data(&self) -> Result<Vec<u8>, String>[src]

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

Auto Trait Implementations

impl !RefUnwindSafe for Spec

impl Send for Spec

impl Sync for Spec

impl Unpin for Spec

impl !UnwindSafe for Spec

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,