pub struct ProtocolConfig {
pub protocol_version: ProtocolVersion,
pub network_limits: NetworkMessageLimits,
pub validation: ProtocolValidationConfig,
pub service_flags: ServiceFlagsConfig,
pub features: ProtocolFeaturesConfig,
pub fee_rates: FeeRateConfig,
pub compact_blocks: CompactBlockConfig,
pub commons: CommonsExtensionsConfig,
}Expand description
Complete protocol configuration
Fields§
§protocol_version: ProtocolVersionProtocol version to use Default: BitcoinV1 (mainnet)
network_limits: NetworkMessageLimitsNetwork message limits (from blvm-consensus to avoid duplication) These limits protect against DoS attacks by bounding message sizes
validation: ProtocolValidationConfigProtocol validation rules
service_flags: ServiceFlagsConfigService flags configuration
features: ProtocolFeaturesConfigProtocol features configuration
fee_rates: FeeRateConfigFee rate configuration
compact_blocks: CompactBlockConfigBIP152 Compact Block Relay configuration
commons: CommonsExtensionsConfigCommons-specific extensions configuration
Implementations§
Source§impl ProtocolConfig
impl ProtocolConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Load configuration from environment variables
Uses short names aligned with blvm-consensus where applicable.
Examples: BLVM_PROTOCOL_VERSION=Testnet3, BLVM_MAX_BLOCK_SIZE=4000000
Sourcepub fn get_service_flags(&self) -> u64
pub fn get_service_flags(&self) -> u64
Get service flags value from configuration
Trait Implementations§
Source§impl Clone for ProtocolConfig
impl Clone for ProtocolConfig
Source§fn clone(&self) -> ProtocolConfig
fn clone(&self) -> ProtocolConfig
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 ProtocolConfig
impl Debug for ProtocolConfig
Source§impl Default for ProtocolConfig
impl Default for ProtocolConfig
Source§impl<'de> Deserialize<'de> for ProtocolConfig
impl<'de> Deserialize<'de> for ProtocolConfig
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 ProtocolConfig
impl PartialEq for ProtocolConfig
Source§fn eq(&self, other: &ProtocolConfig) -> bool
fn eq(&self, other: &ProtocolConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ProtocolConfig
impl Serialize for ProtocolConfig
impl StructuralPartialEq for ProtocolConfig
Auto Trait Implementations§
impl Freeze for ProtocolConfig
impl RefUnwindSafe for ProtocolConfig
impl Send for ProtocolConfig
impl Sync for ProtocolConfig
impl Unpin for ProtocolConfig
impl UnsafeUnpin for ProtocolConfig
impl UnwindSafe for ProtocolConfig
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<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