Struct vapcore_spec::Spec [−][src]
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.
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]
&self,
db: T,
factories: &Factories
) -> Result<T, Error>
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]
params: T,
reader: R
) -> Result<Self, Error>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,