pub struct NetworkConstants {
pub magic_bytes: [u8; 4],
pub default_port: u16,
pub genesis_hash: [u8; 32],
pub max_target: u32,
pub halving_interval: u64,
pub network_name: String,
pub is_testnet: bool,
pub dns_seeds: Vec<String>,
pub checkpoints: Vec<Checkpoint>,
}Expand description
Network-specific constants
Fields§
§magic_bytes: [u8; 4]Network magic bytes for P2P protocol identification
default_port: u16Default P2P port for this network
genesis_hash: [u8; 32]Genesis block hash for this network
max_target: u32Maximum proof-of-work target
halving_interval: u64Block subsidy halving interval
network_name: StringNetwork name for identification
is_testnet: boolWhether this is a test network
dns_seeds: Vec<String>DNS seeds for peer discovery
checkpoints: Vec<Checkpoint>Checkpoint blocks for fast sync
Implementations§
Source§impl NetworkConstants
impl NetworkConstants
Sourcepub fn for_version(version: ProtocolVersion) -> Result<Self>
pub fn for_version(version: ProtocolVersion) -> Result<Self>
Get constants for a specific protocol version
Trait Implementations§
Source§impl Clone for NetworkConstants
impl Clone for NetworkConstants
Source§fn clone(&self) -> NetworkConstants
fn clone(&self) -> NetworkConstants
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetworkConstants
impl Debug for NetworkConstants
Source§impl<'de> Deserialize<'de> for NetworkConstants
impl<'de> Deserialize<'de> for NetworkConstants
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 PartialEq for NetworkConstants
impl PartialEq for NetworkConstants
Source§fn eq(&self, other: &NetworkConstants) -> bool
fn eq(&self, other: &NetworkConstants) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for NetworkConstants
impl Serialize for NetworkConstants
impl Eq for NetworkConstants
impl StructuralPartialEq for NetworkConstants
Auto Trait Implementations§
impl Freeze for NetworkConstants
impl RefUnwindSafe for NetworkConstants
impl Send for NetworkConstants
impl Sync for NetworkConstants
impl Unpin for NetworkConstants
impl UnsafeUnpin for NetworkConstants
impl UnwindSafe for NetworkConstants
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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