Enum nakamoto_common::network::Network
source · 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
sourceimpl Network
impl Network
sourceimpl Network
impl Network
sourcepub 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());
sourcepub fn genesis_block(&self) -> Block
pub fn genesis_block(&self) -> Block
Get the genesis block.
sourcepub fn genesis_hash(&self) -> BlockHash
pub fn genesis_hash(&self) -> BlockHash
Get the hash of the genesis block of 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