pub enum EventPayload {
Show 117 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],
},
PaymentRequestCreated {
payment_id: String,
amount_sats: u64,
invoice: Option<String>,
},
PaymentSettled {
payment_id: String,
tx_hash: [u8; 32],
confirmations: u32,
},
PaymentFailed {
payment_id: String,
reason: String,
},
PaymentVerified {
payment_id: String,
amount_msats: u64,
invoice: String,
},
PaymentRouteFound {
payment_id: String,
route_hops: usize,
route_cost_msats: u64,
},
PaymentRouteFailed {
payment_id: String,
reason: String,
},
ChannelOpened {
channel_id: String,
peer_pubkey: Vec<u8>,
capacity_sats: u64,
},
ChannelClosed {
channel_id: String,
reason: String,
},
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,
},
MiningJobCreated {
job_id: String,
prev_hash: [u8; 32],
height: u64,
},
ShareSubmitted {
job_id: String,
share_hash: [u8; 32],
miner_id: Option<String>,
},
MergeMiningReward {
secondary_chain: String,
reward_amount: u64,
block_hash: [u8; 32],
},
MiningPoolConnected {
pool_url: String,
pool_id: Option<String>,
},
MiningPoolDisconnected {
pool_url: String,
reason: String,
},
GovernanceProposalCreated {
proposal_id: String,
repository: String,
pr_number: u64,
tier: String,
},
GovernanceProposalVoted {
proposal_id: String,
voter: String,
vote: String,
},
GovernanceProposalMerged {
proposal_id: String,
repository: String,
pr_number: u64,
},
WebhookSent {
webhook_url: String,
event_type: String,
success: bool,
},
WebhookFailed {
webhook_url: String,
event_type: String,
error: String,
},
GovernanceForkDetected {
fork_id: String,
ruleset_version: String,
adoption_count: usize,
},
PeerConnected {
peer_addr: String,
transport_type: String,
services: u64,
version: u32,
},
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,
},
BroadcastStarted {
message_type: String,
target_peers: usize,
},
BroadcastCompleted {
message_type: String,
successful: usize,
failed: usize,
},
RouteDiscovered {
destination: Vec<u8>,
route_path: Vec<String>,
route_cost: u64,
},
RouteFailed {
destination: Vec<u8>,
reason: String,
},
ConnectionAttempt {
peer_addr: String,
success: bool,
error: Option<String>,
},
AddressDiscovered {
peer_addr: String,
source: String,
},
AddressExpired {
peer_addr: String,
},
NetworkPartition {
partition_id: Vec<u8>,
disconnected_peers: Vec<String>,
partition_size: usize,
},
NetworkReconnected {
partition_id: Vec<u8>,
reconnected_peers: Vec<String>,
},
DoSAttackDetected {
peer_addr: String,
attack_type: String,
severity: String,
},
RateLimitExceeded {
peer_addr: String,
limit_type: String,
current_rate: f64,
limit: f64,
},
BlockValidationStarted {
block_hash: [u8; 32],
height: u64,
},
BlockValidationCompleted {
block_hash: [u8; 32],
height: u64,
success: bool,
validation_time_ms: u64,
error: Option<String>,
},
ScriptVerificationStarted {
tx_hash: [u8; 32],
input_index: usize,
},
ScriptVerificationCompleted {
tx_hash: [u8; 32],
input_index: usize,
success: bool,
verification_time_ms: u64,
},
UTXOValidationStarted {
block_hash: [u8; 32],
height: u64,
},
UTXOValidationCompleted {
block_hash: [u8; 32],
height: u64,
success: bool,
},
DifficultyAdjusted {
old_difficulty: u32,
new_difficulty: u32,
height: u64,
},
SoftForkActivated {
fork_name: String,
height: u64,
},
SoftForkLockedIn {
fork_name: String,
height: u64,
},
ConsensusRuleViolation {
rule_name: String,
block_hash: Option<[u8; 32]>,
tx_hash: Option<[u8; 32]>,
error: String,
},
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,
},
StorageRead {
operation: String,
duration_ms: u64,
},
StorageWrite {
operation: String,
duration_ms: u64,
bytes_written: usize,
},
StorageQuery {
query_type: String,
duration_ms: u64,
},
DatabaseBackupStarted {
backup_path: String,
},
DatabaseBackupCompleted {
backup_path: String,
success: bool,
size_bytes: u64,
duration_seconds: u64,
},
ModuleLoaded {
module_name: String,
version: String,
},
ModuleUnloaded {
module_name: String,
version: String,
},
ModuleReloaded {
module_name: String,
old_version: String,
new_version: String,
},
ModuleStarted {
module_name: String,
},
ModuleStopped {
module_name: String,
},
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>,
},
MaintenanceStarted {
maintenance_type: String,
estimated_duration_seconds: Option<u64>,
},
MaintenanceCompleted {
maintenance_type: String,
success: bool,
duration_ms: u64,
results: Option<String>,
},
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,
},
ResourceLimitWarning {
resource_type: String,
usage_percent: f64,
current_usage: u64,
limit: u64,
threshold_percent: f64,
},
DandelionStemStarted {
tx_hash: [u8; 32],
current_peer: String,
next_peer: String,
},
DandelionStemAdvanced {
tx_hash: [u8; 32],
hop_count: u8,
next_peer: String,
},
DandelionFluffed {
tx_hash: [u8; 32],
stem_hops: u8,
},
DandelionStemPathExpired {
peer_addr: String,
},
CompactBlockReceived {
block_hash: [u8; 32],
height: u64,
short_ids_count: usize,
},
BlockReconstructionStarted {
block_hash: [u8; 32],
height: u64,
},
BlockReconstructionCompleted {
block_hash: [u8; 32],
height: u64,
success: bool,
missing_txs: usize,
},
FibreBlockEncoded {
block_hash: [u8; 32],
height: u64,
chunks: usize,
encoding_time_ms: u64,
},
FibreBlockSent {
block_hash: [u8; 32],
height: u64,
peer_addr: String,
},
CompanionUdpPeerRegistered {
p2p_peer_addr: String,
udp_addr: String,
},
CompanionUdpPeerUnregistered {
p2p_peer_addr: String,
},
PackageReceived {
package_id: Vec<u8>,
transaction_count: usize,
peer_addr: String,
},
PackageRejected {
package_id: Vec<u8>,
reason: String,
peer_addr: String,
},
UtxoCommitmentReceived {
block_hash: [u8; 32],
height: u64,
commitment_hash: [u8; 32],
peer_addr: String,
},
UtxoCommitmentVerified {
block_hash: [u8; 32],
height: u64,
commitment_hash: [u8; 32],
valid: bool,
},
BanListShared {
peer_addr: String,
ban_count: usize,
},
BanListReceived {
peer_addr: String,
ban_count: usize,
},
SelectiveSyncPolicyApplied {
policy_source: String,
registry_count: usize,
},
ActionExecuted {
action_id: String,
action_type: String,
target: String,
success: bool,
},
ModulePurchaseCompleted {
module_id: String,
payment_id: String,
amount_sats: u64,
},
StratumClientConnected {
endpoint: String,
protocol_version: u32,
},
StratumClientDisconnected {
endpoint: String,
reason: String,
},
IBDBlockFiltered {
block_hash: [u8; 32],
height: u64,
reason: String,
},
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,
},
}Expand description
Event payload types
Variants§
NewBlock
NewTransaction
BlockDisconnected
ChainReorg
PaymentRequestCreated
PaymentSettled
PaymentFailed
PaymentVerified
PaymentRouteFound
PaymentRouteFailed
ChannelOpened
ChannelClosed
BlockMined
BlockTemplateUpdated
MiningDifficultyChanged
MiningJobCreated
MergeMiningReward
MiningPoolConnected
MiningPoolDisconnected
GovernanceProposalCreated
GovernanceProposalVoted
GovernanceProposalMerged
WebhookSent
WebhookFailed
GovernanceForkDetected
PeerConnected
PeerDisconnected
PeerBanned
PeerUnbanned
MessageReceived
MessageSent
BroadcastStarted
BroadcastCompleted
RouteDiscovered
RouteFailed
ConnectionAttempt
AddressDiscovered
AddressExpired
NetworkPartition
NetworkReconnected
DoSAttackDetected
RateLimitExceeded
BlockValidationStarted
BlockValidationCompleted
ScriptVerificationStarted
ScriptVerificationCompleted
UTXOValidationStarted
UTXOValidationCompleted
DifficultyAdjusted
SoftForkActivated
SoftForkLockedIn
ConsensusRuleViolation
HeadersSyncStarted
HeadersSyncProgress
HeadersSyncCompleted
BlockSyncStarted
BlockSyncProgress
BlockSyncCompleted
SyncStateChanged
MempoolTransactionAdded
MempoolTransactionRemoved
MempoolThresholdExceeded
FeeRateChanged
MempoolCleared
StorageRead
StorageWrite
StorageQuery
DatabaseBackupStarted
DatabaseBackupCompleted
ModuleLoaded
ModuleUnloaded
ModuleReloaded
ModuleStarted
ModuleStopped
MeshPacketReceived
StratumV2MessageReceived
ModuleCrashed
ModuleHealthChanged
ModuleStateChanged
ConfigLoaded
Fields
NodeShutdown
Fields
NodeShutdownCompleted
NodeStartupCompleted
Fields
MaintenanceStarted
Fields
MaintenanceCompleted
Fields
DataMaintenance
Fields
HealthCheck
Fields
DiskSpaceLow
Fields
ResourceLimitWarning
Fields
DandelionStemStarted
DandelionStemAdvanced
DandelionFluffed
DandelionStemPathExpired
CompactBlockReceived
BlockReconstructionStarted
BlockReconstructionCompleted
FibreBlockEncoded
FibreBlockSent
CompanionUdpPeerRegistered
Fields
CompanionUdpPeerUnregistered
PackageReceived
PackageRejected
UtxoCommitmentReceived
UtxoCommitmentVerified
BanListReceived
SelectiveSyncPolicyApplied
ActionExecuted
ModulePurchaseCompleted
StratumClientConnected
StratumClientDisconnected
IBDBlockFiltered
ModuleDiscovered
ModuleInstalled
ModuleUpdated
ModuleRemoved
Implementations§
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
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 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>,
Deserialize this value from the given Serde deserializer. Read more
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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
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> 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