[]Enum nakamoto_node::Network

pub enum Network {
    Mainnet,
    Testnet,
    Regtest,
}

Bitcoin peer network.

Variants

Mainnet

Bitcoin Mainnet.

Testnet

Bitcoin Testnet.

Regtest

Bitcoin regression test net.

Implementations

impl Network

pub fn port(&self) -> u16

Return the default listen port for the network.

pub fn checkpoints(
    &self
) -> Box<dyn Iterator<Item = (u64, BlockHash)> + 'static, Global>

Blockchain checkpoints.

pub fn as_str(&self) -> &'static str

Return the short string representation of this network.

pub fn seeds(&self) -> &[&str]

DNS seeds. Used to bootstrap the client's address book.

impl Network

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

Get the genesis block.

pub fn genesis_hash(&self) -> BlockHash

Get the hash of the genesis block of this network.

pub fn params(&self) -> Params

Get the consensus parameters for this network.

pub fn magic(&self) -> u32

Get the network magic number for this network.

Trait Implementations

impl Clone for Network

impl Copy for Network

impl Debug for Network

impl Default for Network

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.