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: String
The spec name, also used identify network
genesis: Genesis
The genesis block information
params: Params
The block chain parameters
pow: Pow
The block chain pow
hash: Byte32
Hash 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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