pub trait NodeAPI: Send + Sync {
Show 64 methods
// Required methods
fn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Block>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<BlockHeader>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn has_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_chain_tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_block_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_utxo<'life0, 'life1, 'async_trait>(
&'life0 self,
outpoint: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<Option<UTXO>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn subscribe_events<'life0, 'async_trait>(
&'life0 self,
event_types: Vec<EventType>,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ModuleMessage>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_mempool_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<[u8; 32]>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_mempool_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_mempool_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MempoolSize, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_network_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkStats, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_network_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_block_by_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Block>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_lightning_node_url<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_lightning_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<LightningInfo>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_payment_state<'life0, 'life1, 'async_trait>(
&'life0 self,
payment_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentState>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn check_transaction_in_mempool<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_fee_estimate<'life0, 'async_trait>(
&'life0 self,
target_blocks: u32,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn register_rpc_endpoint<'life0, 'async_trait>(
&'life0 self,
method: String,
description: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn unregister_rpc_endpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn register_core_rpc_override<'life0, 'async_trait>(
&'life0 self,
method: String,
description: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn unregister_core_rpc_override<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn register_timer<'life0, 'async_trait>(
&'life0 self,
interval_seconds: u64,
callback: Arc<dyn TimerCallback>,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn cancel_timer<'life0, 'async_trait>(
&'life0 self,
timer_id: u64,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn schedule_task<'life0, 'async_trait>(
&'life0 self,
delay_seconds: u64,
callback: Arc<dyn TaskCallback>,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn report_metric<'life0, 'async_trait>(
&'life0 self,
metric: Metric,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_module_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Metric>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_all_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Vec<Metric>>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn read_file<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn write_file<'life0, 'async_trait>(
&'life0 self,
path: String,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn delete_file<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn list_directory<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn create_directory<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_file_metadata<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<FileMetadata, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn initialize_module<'life0, 'async_trait>(
&'life0 self,
module_id: String,
module_data_dir: PathBuf,
base_data_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn discover_modules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModuleInfo>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_module_info<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ModuleInfo>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn is_module_available<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn publish_event<'life0, 'async_trait>(
&'life0 self,
event_type: EventType,
payload: EventPayload,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn call_module<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_module_id: Option<&'life1 str>,
method: &'life2 str,
params: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn register_module_api<'life0, 'async_trait>(
&'life0 self,
api: Arc<dyn ModuleAPI>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn unregister_module_api<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn send_mesh_packet_to_module<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
packet_data: Vec<u8>,
peer_addr: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn send_mesh_packet_to_peer<'life0, 'async_trait>(
&'life0 self,
peer_addr: String,
packet_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn send_stratum_v2_message_to_peer<'life0, 'async_trait>(
&'life0 self,
peer_addr: String,
message_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_module_health<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ModuleHealth>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_all_module_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, ModuleHealth)>, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn report_module_health<'life0, 'async_trait>(
&'life0 self,
health: ModuleHealth,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_block_template<'life0, 'async_trait>(
&'life0 self,
rules: Vec<String>,
coinbase_script: Option<Vec<u8>>,
coinbase_address: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<BlockTemplate, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn submit_block<'life0, 'async_trait>(
&'life0 self,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<SubmitBlockResult, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn merge_block_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_block_serve_denylist_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockServeDenylistSnapshot, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn clear_block_serve_denylist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn replace_block_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn merge_tx_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_tx_serve_denylist_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TxServeDenylistSnapshot, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn clear_tx_serve_denylist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn replace_tx_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_sync_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatus, ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn ban_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_addr: &'life1 str,
ban_duration_seconds: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn set_block_serve_maintenance_mode<'life0, 'async_trait>(
&'life0 self,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided method
fn queue_received_block_bytes<'life0, 'async_trait>(
&'life0 self,
_block_bytes: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}Expand description
Node API trait - interface for modules to query node state
This trait defines what APIs modules can call on the node. Implemented by the node side, used by modules through IPC.
Required Methods§
Sourcefn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Block>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_block<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Block>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a block by hash
Sourcefn get_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<BlockHeader>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_block_header<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<BlockHeader>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a block header by hash
Sourcefn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a transaction by hash
Sourcefn has_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn has_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Check if a transaction exists
Sourcefn get_chain_tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_chain_tip<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<[u8; 32], ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get current chain tip (highest block hash)
Sourcefn get_block_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_height<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get current block height
Sourcefn get_utxo<'life0, 'life1, 'async_trait>(
&'life0 self,
outpoint: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<Option<UTXO>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_utxo<'life0, 'life1, 'async_trait>(
&'life0 self,
outpoint: &'life1 OutPoint,
) -> Pin<Box<dyn Future<Output = Result<Option<UTXO>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get UTXO by outpoint (read-only, cannot modify)
Sourcefn subscribe_events<'life0, 'async_trait>(
&'life0 self,
event_types: Vec<EventType>,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ModuleMessage>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn subscribe_events<'life0, 'async_trait>(
&'life0 self,
event_types: Vec<EventType>,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ModuleMessage>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Subscribe to node events
Returns a receiver that will receive event messages
Sourcefn get_mempool_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<[u8; 32]>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_mempool_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<[u8; 32]>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get all transaction hashes in mempool
Sourcefn get_mempool_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_mempool_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a transaction from mempool by hash
Sourcefn get_mempool_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MempoolSize, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_mempool_size<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MempoolSize, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get mempool size information
Sourcefn get_network_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkStats, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_network_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<NetworkStats, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get network statistics
Sourcefn get_network_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_network_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get list of connected peers
Sourcefn get_chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_chain_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ChainInfo, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get chain information (tip, height, difficulty, etc.)
Sourcefn get_block_by_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Block>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_by_height<'life0, 'async_trait>(
&'life0 self,
height: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<Block>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get block by height
Sourcefn get_lightning_node_url<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_lightning_node_url<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get Lightning node connection info
Sourcefn get_lightning_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<LightningInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_lightning_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<LightningInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get Lightning node information
Sourcefn get_payment_state<'life0, 'life1, 'async_trait>(
&'life0 self,
payment_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentState>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_payment_state<'life0, 'life1, 'async_trait>(
&'life0 self,
payment_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<PaymentState>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get payment state by payment ID
Sourcefn check_transaction_in_mempool<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn check_transaction_in_mempool<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hash: &'life1 [u8; 32],
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Check if a transaction is in the mempool
Sourcefn get_fee_estimate<'life0, 'async_trait>(
&'life0 self,
target_blocks: u32,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_fee_estimate<'life0, 'async_trait>(
&'life0 self,
target_blocks: u32,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get fee estimate for target confirmation blocks Returns fee rate in satoshis per vbyte
Sourcefn register_rpc_endpoint<'life0, 'async_trait>(
&'life0 self,
method: String,
description: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn register_rpc_endpoint<'life0, 'async_trait>(
&'life0 self,
method: String,
description: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Register a JSON-RPC endpoint Method name must have module prefix (e.g., “lightning_”, “stratum_”) Cannot override core endpoints (whitelist enforced)
Sourcefn unregister_rpc_endpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn unregister_rpc_endpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Unregister an RPC endpoint (on module shutdown)
Sourcefn register_core_rpc_override<'life0, 'async_trait>(
&'life0 self,
method: String,
description: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn register_core_rpc_override<'life0, 'async_trait>(
&'life0 self,
method: String,
description: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Override a core RPC method with a module handler.
method must be listed in OVERRIDABLE_CORE_RPC_METHODS; otherwise the node rejects
the request. The description is informational (shown in getrpcinfo).
Sourcefn unregister_core_rpc_override<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn unregister_core_rpc_override<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Release a previously registered core RPC override.
Sourcefn register_timer<'life0, 'async_trait>(
&'life0 self,
interval_seconds: u64,
callback: Arc<dyn TimerCallback>,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn register_timer<'life0, 'async_trait>(
&'life0 self,
interval_seconds: u64,
callback: Arc<dyn TimerCallback>,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Register a periodic timer Returns a timer ID that can be used to cancel Callback is async and can call NodeAPI methods
Sourcefn cancel_timer<'life0, 'async_trait>(
&'life0 self,
timer_id: u64,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn cancel_timer<'life0, 'async_trait>(
&'life0 self,
timer_id: u64,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Cancel a registered timer
Sourcefn schedule_task<'life0, 'async_trait>(
&'life0 self,
delay_seconds: u64,
callback: Arc<dyn TaskCallback>,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn schedule_task<'life0, 'async_trait>(
&'life0 self,
delay_seconds: u64,
callback: Arc<dyn TaskCallback>,
) -> Pin<Box<dyn Future<Output = Result<u64, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Schedule a one-time task Callback is async and can call NodeAPI methods
Sourcefn report_metric<'life0, 'async_trait>(
&'life0 self,
metric: Metric,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn report_metric<'life0, 'async_trait>(
&'life0 self,
metric: Metric,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Report a metric to the node
Sourcefn get_module_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Metric>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_module_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Metric>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get module metrics (for RPC/metrics endpoint)
Sourcefn get_all_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Vec<Metric>>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_all_metrics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Vec<Metric>>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get aggregated metrics from all modules
Sourcefn read_file<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn read_file<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Read a file from the module’s data directory Path must be within the module’s sandboxed data directory
Sourcefn write_file<'life0, 'async_trait>(
&'life0 self,
path: String,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn write_file<'life0, 'async_trait>(
&'life0 self,
path: String,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Write data to a file in the module’s data directory Path must be within the module’s sandboxed data directory
Sourcefn delete_file<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn delete_file<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Delete a file from the module’s data directory
Sourcefn list_directory<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_directory<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
List directory contents
Sourcefn create_directory<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn create_directory<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Create a directory in the module’s data directory
Sourcefn get_file_metadata<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<FileMetadata, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_file_metadata<'life0, 'async_trait>(
&'life0 self,
path: String,
) -> Pin<Box<dyn Future<Output = Result<FileMetadata, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get file metadata (size, type, timestamps)
Sourcefn initialize_module<'life0, 'async_trait>(
&'life0 self,
module_id: String,
module_data_dir: PathBuf,
base_data_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn initialize_module<'life0, 'async_trait>(
&'life0 self,
module_id: String,
module_data_dir: PathBuf,
base_data_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Initialize filesystem and storage access for a module Called when a module connects to set up per-module sandbox and storage
Sourcefn discover_modules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModuleInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn discover_modules<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ModuleInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Discover all available modules Returns list of module information for all loaded modules
Sourcefn get_module_info<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ModuleInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_module_info<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ModuleInfo>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get information about a specific module Returns None if module is not loaded
Sourcefn is_module_available<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn is_module_available<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Check if a module is available (loaded and running)
Sourcefn publish_event<'life0, 'async_trait>(
&'life0 self,
event_type: EventType,
payload: EventPayload,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn publish_event<'life0, 'async_trait>(
&'life0 self,
event_type: EventType,
payload: EventPayload,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Publish an event (modules can publish to other modules) Event will be delivered to all modules subscribed to the event type
Sourcefn call_module<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_module_id: Option<&'life1 str>,
method: &'life2 str,
params: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn call_module<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
target_module_id: Option<&'life1 str>,
method: &'life2 str,
params: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Sourcefn register_module_api<'life0, 'async_trait>(
&'life0 self,
api: Arc<dyn ModuleAPI>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn register_module_api<'life0, 'async_trait>(
&'life0 self,
api: Arc<dyn ModuleAPI>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sourcefn unregister_module_api<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn unregister_module_api<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Unregister a module API
Sourcefn send_mesh_packet_to_module<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
packet_data: Vec<u8>,
peer_addr: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn send_mesh_packet_to_module<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
packet_data: Vec<u8>,
peer_addr: String,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send mesh packet to a module (for network layer integration) This allows the network layer to route mesh packets to the mesh module
Sourcefn send_mesh_packet_to_peer<'life0, 'async_trait>(
&'life0 self,
peer_addr: String,
packet_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_mesh_packet_to_peer<'life0, 'async_trait>(
&'life0 self,
peer_addr: String,
packet_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send mesh packet to a network peer This allows modules to send mesh packets to network peers
Sourcefn send_stratum_v2_message_to_peer<'life0, 'async_trait>(
&'life0 self,
peer_addr: String,
message_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn send_stratum_v2_message_to_peer<'life0, 'async_trait>(
&'life0 self,
peer_addr: String,
message_data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Send Stratum V2 message to peer (miner) This allows the Stratum V2 module to send messages to miners
Sourcefn get_module_health<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ModuleHealth>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_module_health<'life0, 'life1, 'async_trait>(
&'life0 self,
module_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ModuleHealth>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get health status of a module
Sourcefn get_all_module_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, ModuleHealth)>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_all_module_health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<(String, ModuleHealth)>, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get health status of all modules
Sourcefn report_module_health<'life0, 'async_trait>(
&'life0 self,
health: ModuleHealth,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn report_module_health<'life0, 'async_trait>(
&'life0 self,
health: ModuleHealth,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Report module health (for modules to self-report)
Sourcefn get_block_template<'life0, 'async_trait>(
&'life0 self,
rules: Vec<String>,
coinbase_script: Option<Vec<u8>>,
coinbase_address: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<BlockTemplate, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_template<'life0, 'async_trait>(
&'life0 self,
rules: Vec<String>,
coinbase_script: Option<Vec<u8>>,
coinbase_address: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<BlockTemplate, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Get block template (GBT equivalent)
Returns a block template suitable for mining. Uses the same formally verified consensus function as RPC getblocktemplate.
§Arguments
rules- Consensus rules to apply (e.g., [“segwit”])coinbase_script- Optional coinbase script (for custom coinbase)coinbase_address- Optional coinbase address (for custom coinbase)
§Returns
BlockTemplate with header, coinbase transaction, and selected transactions
Sourcefn submit_block<'life0, 'async_trait>(
&'life0 self,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<SubmitBlockResult, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn submit_block<'life0, 'async_trait>(
&'life0 self,
block: Block,
) -> Pin<Box<dyn Future<Output = Result<SubmitBlockResult, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sourcefn merge_block_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn merge_block_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Merge block hashes into the node’s denylist for serving full block messages on the network
(e.g. getdata). Additive; callers may include selective-sync, policy/compliance, or tests.
Peers receive notfound for these hashes instead of a full block.
Sourcefn get_block_serve_denylist_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockServeDenylistSnapshot, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_serve_denylist_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BlockServeDenylistSnapshot, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Bounded snapshot of the block serve denylist (for status and debugging).
fn clear_block_serve_denylist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn replace_block_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
block_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn merge_tx_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn merge_tx_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Merge txids into the denylist for serving full tx on getdata (additive).
fn get_tx_serve_denylist_snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<TxServeDenylistSnapshot, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn clear_tx_serve_denylist<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn replace_tx_serve_denylist<'life0, 'life1, 'async_trait>(
&'life0 self,
tx_hashes: &'life1 [[u8; 32]],
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn get_sync_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatus, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_sync_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SyncStatus, ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Sync coordinator phase and progress (requires sync coordinator on the node API).
Sourcefn ban_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_addr: &'life1 str,
ban_duration_seconds: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn ban_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_addr: &'life1 str,
ban_duration_seconds: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Ban a peer by socket address string. ban_duration_seconds: None means permanent.
Sourcefn set_block_serve_maintenance_mode<'life0, 'async_trait>(
&'life0 self,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn set_block_serve_maintenance_mode<'life0, 'async_trait>(
&'life0 self,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
When enabled, refuse all full-block getdata answers (operational maintenance).
Provided Methods§
Sourcefn queue_received_block_bytes<'life0, 'async_trait>(
&'life0 self,
_block_bytes: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn queue_received_block_bytes<'life0, 'async_trait>(
&'life0 self,
_block_bytes: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), ModuleError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Queue bincode‑serialized Block bytes for processing on the same path as P2P
BlockReceived / in‑process FIBRE (pending block queue → validation).
Loadable modules (e.g. blvm-fibre) use this for UDP‑assembled blocks. Default:
not supported (returns an error).