pub enum EventPayload {
Show 120 variants
NewBlock {
block_hash: [u8; 32],
height: u64,
},
NewTransaction {
tx_hash: [u8; 32],
},
BlockDisconnected {
hash: [u8; 32],
height: u64,
},
ChainReorg {
old_tip: [u8; 32],
new_tip: [u8; 32],
},
ReservedPaymentRequestCreated,
ReservedPaymentSettled,
ReservedPaymentFailed,
ReservedPaymentVerified,
ReservedPaymentRouteFound,
ReservedPaymentRouteFailed,
ReservedChannelOpened,
ReservedChannelClosed,
BlockMined {
block_hash: [u8; 32],
height: u64,
miner_id: Option<String>,
},
BlockTemplateUpdated {
prev_hash: [u8; 32],
height: u64,
tx_count: usize,
},
MiningDifficultyChanged {
old_difficulty: u32,
new_difficulty: u32,
height: u64,
},
ReservedMiningJobCreated,
ReservedShareSubmitted,
ReservedMergeMiningReward,
ReservedMiningPoolConnected,
ReservedMiningPoolDisconnected,
ReservedGovernanceProposalCreated,
ReservedGovernanceProposalVoted,
ReservedGovernanceProposalMerged,
ReservedWebhookSent,
ReservedWebhookFailed,
ReservedGovernanceForkDetected,
PeerConnected {
peer_addr: String,
transport_type: String,
services: u64,
version: u32,
peer_node_id: Option<Vec<u8>>,
},
PeerDisconnected {
peer_addr: String,
reason: String,
},
PeerBanned {
peer_addr: String,
reason: String,
ban_duration_seconds: u64,
},
PeerUnbanned {
peer_addr: String,
},
MessageReceived {
peer_addr: String,
message_type: String,
message_size: usize,
protocol_version: u32,
},
MessageSent {
peer_addr: String,
message_type: String,
message_size: usize,
},
ReservedBroadcastStarted,
ReservedBroadcastCompleted,
ReservedRouteDiscovered,
ReservedRouteFailed,
ReservedConnectionAttempt,
ReservedAddressDiscovered,
ReservedAddressExpired,
ReservedNetworkPartition,
ReservedNetworkReconnected,
ReservedDoSAttackDetected,
ReservedRateLimitExceeded,
BlockValidationStarted {
block_hash: [u8; 32],
height: u64,
},
BlockValidationCompleted {
block_hash: [u8; 32],
height: u64,
success: bool,
validation_time_ms: u64,
error: Option<String>,
},
ReservedScriptVerificationStarted,
ReservedScriptVerificationCompleted,
ReservedUTXOValidationStarted,
ReservedUTXOValidationCompleted,
DifficultyAdjusted {
old_difficulty: u32,
new_difficulty: u32,
height: u64,
},
ReservedSoftForkActivated,
ReservedSoftForkLockedIn,
ReservedConsensusRuleViolation,
HeadersSyncStarted {
start_height: u64,
},
HeadersSyncProgress {
current_height: u64,
target_height: u64,
progress_percent: f64,
},
HeadersSyncCompleted {
final_height: u64,
duration_seconds: u64,
},
BlockSyncStarted {
start_height: u64,
target_height: u64,
},
BlockSyncProgress {
current_height: u64,
target_height: u64,
progress_percent: f64,
blocks_per_second: f64,
},
BlockSyncCompleted {
final_height: u64,
duration_seconds: u64,
},
SyncStateChanged {
old_state: String,
new_state: String,
},
MempoolTransactionAdded {
tx_hash: [u8; 32],
fee_rate: f64,
mempool_size: usize,
},
MempoolTransactionRemoved {
tx_hash: [u8; 32],
reason: String,
mempool_size: usize,
},
MempoolThresholdExceeded {
current_size: usize,
threshold: usize,
},
FeeRateChanged {
old_fee_rate: f64,
new_fee_rate: f64,
mempool_size: usize,
},
MempoolCleared {
cleared_count: usize,
},
ReservedStorageRead,
ReservedStorageWrite,
ReservedStorageQuery,
ReservedDatabaseBackupStarted,
ReservedDatabaseBackupCompleted,
ModuleLoaded {
module_name: String,
version: String,
},
ModuleUnloaded {
module_name: String,
version: String,
},
ModuleReloaded {
module_name: String,
old_version: String,
new_version: String,
},
ReservedModuleStarted,
ReservedModuleStopped,
MeshPacketReceived {
packet_data: Vec<u8>,
peer_addr: String,
},
StratumV2MessageReceived {
message_data: Vec<u8>,
peer_addr: String,
},
ModuleCrashed {
module_name: String,
error: String,
},
ModuleHealthChanged {
module_name: String,
old_health: String,
new_health: String,
},
ModuleStateChanged {
module_name: String,
old_state: String,
new_state: String,
},
ConfigLoaded {
changed_sections: Vec<String>,
config_json: Option<String>,
},
NodeShutdown {
reason: String,
timeout_seconds: u64,
},
NodeShutdownCompleted {
duration_ms: u64,
},
NodeStartupCompleted {
duration_ms: u64,
components: Vec<String>,
},
ReservedMaintenanceStarted,
ReservedMaintenanceCompleted,
DataMaintenance {
operation: String,
urgency: String,
reason: String,
target_age_days: Option<u64>,
timeout_seconds: Option<u64>,
},
HealthCheck {
check_type: String,
node_healthy: bool,
health_report: Option<String>,
},
DiskSpaceLow {
available_bytes: u64,
total_bytes: u64,
percent_free: f64,
disk_path: String,
},
ReservedResourceLimitWarning,
ReservedDandelionStemStarted,
ReservedDandelionStemAdvanced,
ReservedDandelionFluffed,
ReservedDandelionStemPathExpired,
ReservedCompactBlockReceived,
ReservedBlockReconstructionStarted,
ReservedBlockReconstructionCompleted,
ReservedFibreBlockEncoded,
ReservedFibreBlockSent,
CompanionUdpPeerRegistered {
p2p_peer_addr: String,
udp_addr: String,
},
CompanionUdpPeerUnregistered {
p2p_peer_addr: String,
},
ReservedPackageReceived,
ReservedPackageRejected,
ReservedUtxoCommitmentReceived,
ReservedUtxoCommitmentVerified,
BanListShared {
peer_addr: String,
ban_count: usize,
},
BanListReceived {
peer_addr: String,
ban_count: usize,
},
ReservedSelectiveSyncPolicyApplied,
ReservedActionExecuted,
ReservedModulePurchaseCompleted,
ReservedStratumClientConnected,
ReservedStratumClientDisconnected,
ReservedIBDBlockFiltered,
ModuleDiscovered {
module_name: String,
version: String,
source: String,
},
ModuleInstalled {
module_name: String,
version: String,
},
ModuleUpdated {
module_name: String,
old_version: String,
new_version: String,
},
ModuleRemoved {
module_name: String,
version: String,
},
PeerPayment {
command: String,
payload: Vec<u8>,
peer_addr: String,
},
ModuleEvent {
source_module: String,
name: String,
data: Vec<u8>,
},
FeeTableReady {
tip_hash: [u8; 32],
tip_height: u64,
generation: u64,
},
}Expand description
Event payload types
Variants§
NewBlock
NewTransaction
BlockDisconnected
ChainReorg
ReservedPaymentRequestCreated
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedPaymentSettled
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedPaymentFailed
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedPaymentVerified
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedPaymentRouteFound
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedPaymentRouteFailed
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedChannelOpened
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedChannelClosed
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
BlockMined
BlockTemplateUpdated
MiningDifficultyChanged
ReservedMiningJobCreated
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedMergeMiningReward
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedMiningPoolConnected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedMiningPoolDisconnected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedGovernanceProposalCreated
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedGovernanceProposalVoted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedGovernanceProposalMerged
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedWebhookSent
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedWebhookFailed
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedGovernanceForkDetected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
PeerConnected
Fields
PeerDisconnected
PeerBanned
PeerUnbanned
MessageReceived
MessageSent
ReservedBroadcastStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedBroadcastCompleted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedRouteDiscovered
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedRouteFailed
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedConnectionAttempt
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedAddressDiscovered
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedAddressExpired
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedNetworkPartition
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedNetworkReconnected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedDoSAttackDetected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedRateLimitExceeded
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
BlockValidationStarted
BlockValidationCompleted
ReservedScriptVerificationStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedScriptVerificationCompleted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedUTXOValidationStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedUTXOValidationCompleted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
DifficultyAdjusted
ReservedSoftForkActivated
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedSoftForkLockedIn
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedConsensusRuleViolation
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
HeadersSyncStarted
HeadersSyncProgress
HeadersSyncCompleted
BlockSyncStarted
BlockSyncProgress
BlockSyncCompleted
SyncStateChanged
MempoolTransactionAdded
MempoolTransactionRemoved
MempoolThresholdExceeded
FeeRateChanged
MempoolCleared
ReservedStorageRead
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedStorageWrite
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedStorageQuery
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedDatabaseBackupStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedDatabaseBackupCompleted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ModuleLoaded
ModuleUnloaded
ModuleReloaded
ReservedModuleStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedModuleStopped
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
MeshPacketReceived
StratumV2MessageReceived
ModuleCrashed
ModuleHealthChanged
ModuleStateChanged
ConfigLoaded
Fields
NodeShutdown
Fields
NodeShutdownCompleted
NodeStartupCompleted
Fields
ReservedMaintenanceStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedMaintenanceCompleted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
DataMaintenance
Fields
HealthCheck
Fields
DiskSpaceLow
Fields
ReservedResourceLimitWarning
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedDandelionStemStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedDandelionStemAdvanced
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedDandelionFluffed
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedDandelionStemPathExpired
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedCompactBlockReceived
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedBlockReconstructionStarted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedBlockReconstructionCompleted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedFibreBlockEncoded
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedFibreBlockSent
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
CompanionUdpPeerRegistered
Fields
CompanionUdpPeerUnregistered
ReservedPackageReceived
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedPackageRejected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedUtxoCommitmentReceived
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedUtxoCommitmentVerified
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
BanListReceived
ReservedSelectiveSyncPolicyApplied
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedActionExecuted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedModulePurchaseCompleted
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedStratumClientConnected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedStratumClientDisconnected
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ReservedIBDBlockFiltered
F5 reserved. Nothing publishes this. The slot keeps the bincode index.
ModuleDiscovered
ModuleInstalled
ModuleUpdated
ModuleRemoved
PeerPayment
Raw BIP70 frame from a peer. command is the P2P command name.
ModuleEvent
Published by a module. source_module is the authenticated session, not the caller’s value.
FeeTableReady
First native table for a tip. One event per tip hash.
Implementations§
Source§impl EventPayload
impl EventPayload
Sourcepub fn module_event(name: impl Into<String>, data: Vec<u8>) -> EventPayload
pub fn module_event(name: impl Into<String>, data: Vec<u8>) -> EventPayload
Build a module event. The node replaces source_module with the session id.
Sourcepub fn module_event_json(
name: impl Into<String>,
data: &impl Serialize,
) -> EventPayload
pub fn module_event_json( name: impl Into<String>, data: &impl Serialize, ) -> EventPayload
JSON body for EventPayload::module_event.
Source§impl EventPayload
Typed payload extraction for event handlers.
impl EventPayload
Typed payload extraction for event handlers.
Use these helpers in #[on_event] handlers to get event-specific data without manual matching.
Example: if let Some((hash, height)) = event.payload.as_new_block() { ... }
pub fn as_new_block(&self) -> Option<(&[u8; 32], u64)>
pub fn as_new_transaction(&self) -> Option<&[u8; 32]>
pub fn as_module_loaded(&self) -> Option<(&str, &str)>
pub fn as_block_disconnected(&self) -> Option<(&[u8; 32], u64)>
pub fn as_chain_reorg(&self) -> Option<(&[u8; 32], &[u8; 32])>
Trait Implementations§
Source§impl Clone for EventPayload
impl Clone for EventPayload
Source§fn clone(&self) -> EventPayload
fn clone(&self) -> EventPayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EventPayload
impl Debug for EventPayload
Source§impl<'de> Deserialize<'de> for EventPayload
impl<'de> Deserialize<'de> for EventPayload
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EventPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EventPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for EventPayload
impl Serialize for EventPayload
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Forget for EventPayload
impl Freeze for EventPayload
impl RefUnwindSafe for EventPayload
impl Send for EventPayload
impl Sync for EventPayload
impl Unpin for EventPayload
impl UnsafeUnpin for EventPayload
impl UnwindSafe for EventPayload
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.