Trait subcoin_network::NetworkApi
source · pub trait NetworkApi: Send + Sync {
// Required methods
fn enabled(&self) -> bool;
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<NetworkStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sync_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<PeerSync>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_transaction<'life0, 'async_trait>(
&'life0 self,
txid: Txid,
) -> Pin<Box<dyn Future<Output = Option<Transaction>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction,
) -> Pin<Box<dyn Future<Output = SendTransactionResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start_block_sync(&self) -> bool;
fn is_major_syncing(&self) -> bool;
}
Expand description
Subcoin network service interface.
Required Methods§
sourcefn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<NetworkStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<NetworkStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Provides high-level status information about network.
Returns None if the NetworkProcessor
is no longer running.
sourcefn sync_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<PeerSync>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sync_peers<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<PeerSync>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the currently syncing peers.
sourcefn get_transaction<'life0, 'async_trait>(
&'life0 self,
txid: Txid,
) -> Pin<Box<dyn Future<Output = Option<Transaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_transaction<'life0, 'async_trait>(
&'life0 self,
txid: Txid,
) -> Pin<Box<dyn Future<Output = Option<Transaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a transaction by its Txid.
sourcefn send_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction,
) -> Pin<Box<dyn Future<Output = SendTransactionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_transaction<'life0, 'async_trait>(
&'life0 self,
transaction: Transaction,
) -> Pin<Box<dyn Future<Output = SendTransactionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a transaction to the network.
sourcefn start_block_sync(&self) -> bool
fn start_block_sync(&self) -> bool
Starts the block sync in chain sync component.
sourcefn is_major_syncing(&self) -> bool
fn is_major_syncing(&self) -> bool
Whether the node is actively performing a major sync.