Enum nakamoto_node::Network
pub enum Network {
Mainnet,
Testnet,
Regtest,
Signet,
}
Expand description
Bitcoin peer network.
Variants
Mainnet
Bitcoin Mainnet.
Testnet
Bitcoin Testnet.
Regtest
Bitcoin regression test net.
Signet
Bitcoin signet.
Implementations
impl Network
impl Network
pub fn checkpoints(
&self
) -> Box<dyn Iterator<Item = (u64, BlockHash)> + 'static, Global>
pub fn checkpoints(
&self
) -> Box<dyn Iterator<Item = (u64, BlockHash)> + 'static, Global>
Blockchain checkpoints.
impl Network
impl Network
pub fn genesis(&self) -> BlockHeader
pub fn genesis(&self) -> BlockHeader
Get the genesis block header.
use nakamoto_common::network::Network;
let network = Network::Mainnet;
let genesis = network.genesis();
assert_eq!(network.genesis_hash(), genesis.block_hash());
pub fn genesis_block(&self) -> Block
pub fn genesis_block(&self) -> Block
Get the genesis block.
pub fn genesis_hash(&self) -> BlockHash
pub fn genesis_hash(&self) -> BlockHash
Get the hash of the genesis block of this network.
pub fn params(&self) -> Params
pub fn params(&self) -> Params
Get the consensus parameters for this network.
Trait Implementations
impl Copy for Network
Auto Trait Implementations
impl RefUnwindSafe for Network
impl Send for Network
impl Sync for Network
impl Unpin for Network
impl UnwindSafe for Network
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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