pub struct ChainInfo {
pub chain: String,
pub median_time: Timestamp,
pub epoch: EpochNumberWithFraction,
pub difficulty: U256,
pub is_initial_block_download: bool,
pub alerts: Vec<AlertMessage>,
}
Expand description
Chain information.
Fields§
§chain: String
The network name.
Examples:
- “ckb” - Mirana the mainnet.
- “ckb_testnet” - Pudge the testnet.
median_time: Timestamp
The median time of the last 37 blocks, including the tip block.
epoch: EpochNumberWithFraction
The epoch information of tip block in the chain.
difficulty: U256
Current difficulty.
Decoded from the epoch compact_target
.
is_initial_block_download: bool
Whether the local node is in IBD, Initial Block Download.
When a node starts and its chain tip timestamp is far behind the wall clock, it will enter the IBD until it catches up the synchronization.
During IBD, the local node only synchronizes the chain with one selected remote node and stops responding the most P2P requests.
alerts: Vec<AlertMessage>
Active alerts stored in the local node.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChainInfo
impl<'de> Deserialize<'de> for ChainInfo
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
Source§impl JsonSchema for ChainInfo
impl JsonSchema for ChainInfo
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreAuto Trait Implementations§
impl Freeze for ChainInfo
impl RefUnwindSafe for ChainInfo
impl Send for ChainInfo
impl Sync for ChainInfo
impl Unpin for ChainInfo
impl UnwindSafe for ChainInfo
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