Struct ckb_chain_spec::ChainSpec
source · [−]pub struct ChainSpec {
pub name: String,
pub genesis: Genesis,
pub params: Params,
pub pow: Pow,
pub hash: Byte32,
}Expand description
The CKB block chain specification
Fields
name: StringThe spec name, also used identify network
genesis: GenesisThe genesis block information
params: ParamsThe block chain parameters
pow: PowThe block chain pow
hash: Byte32Hash of blake2b_256 spec content bytes, used for check consistency between database and config
Implementations
sourceimpl ChainSpec
impl ChainSpec
sourcepub fn load_from(resource: &Resource) -> Result<ChainSpec, Box<dyn Error>>
pub fn load_from(resource: &Resource) -> Result<ChainSpec, Box<dyn Error>>
New ChainSpec instance from load spec file resource
sourcepub fn pow_engine(&self) -> Arc<dyn PowEngine>
pub fn pow_engine(&self) -> Arc<dyn PowEngine>
The ChainSpec specified pow engine
Trait Implementations
sourceimpl<'de> Deserialize<'de> for ChainSpec
impl<'de> Deserialize<'de> for ChainSpec
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ChainSpec
impl StructuralEq for ChainSpec
impl StructuralPartialEq for ChainSpec
Auto Trait Implementations
impl RefUnwindSafe for ChainSpec
impl Send for ChainSpec
impl Sync for ChainSpec
impl Unpin for ChainSpec
impl UnwindSafe for ChainSpec
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more