Skip to main content

init

Function init 

Source
pub async fn init<AddressBook, SyncStatus>(
    config: Config,
    network: Network,
    chain_tip_metrics_receiver: Receiver<ChainTipMetrics>,
    sync_status: SyncStatus,
    address_book: AddressBook,
) -> (JoinHandle<()>, Option<SocketAddr>)
where AddressBook: AddressBookPeers + Clone + Send + Sync + 'static, SyncStatus: ChainSyncStatus + Clone + Send + Sync + 'static,
Expand description

Starts the health server if listen_addr is configured.

Returns a task handle and the bound socket address. When disabled, returns a pending task and None for the address.

The server accepts HTTP/1.1 requests on a dedicated TCP listener and serves two endpoints: /healthy and /ready.

ยงPanics

  • If the configured listen_addr cannot be bound.