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§
Source§impl 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§
Source§impl<'de> Deserialize<'de> for ChainSpec
impl<'de> Deserialize<'de> for ChainSpec
Source§fn 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 StructuralPartialEq for ChainSpec
Auto Trait Implementations§
impl !Freeze for ChainSpec
impl RefUnwindSafe for ChainSpec
impl Send for ChainSpec
impl Sync for ChainSpec
impl Unpin for ChainSpec
impl UnwindSafe for ChainSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more