Skip to main content

Node

Trait Node 

Source
pub trait Node:
    Send
    + Sync
    + 'static {
    type StreamIncomingStream: Stream<Item = Result<IncomingPayment, Status>> + Send + 'static;
    type StreamLogStream: Stream<Item = Result<LogEntry, Status>> + Send + 'static;
    type StreamCustommsgStream: Stream<Item = Result<Custommsg, Status>> + Send + 'static;
    type StreamNodeEventsStream: Stream<Item = Result<NodeEvent, Status>> + Send + 'static;
    type StreamHsmRequestsStream: Stream<Item = Result<HsmRequest, Status>> + Send + 'static;

    // Required methods
    fn lsp_invoice<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LspInvoiceRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<LspInvoiceResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stream_incoming<'life0, 'async_trait>(
        &'life0 self,
        request: Request<StreamIncomingFilter>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamIncomingStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stream_log<'life0, 'async_trait>(
        &'life0 self,
        request: Request<StreamLogRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamLogStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stream_custommsg<'life0, 'async_trait>(
        &'life0 self,
        request: Request<StreamCustommsgRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamCustommsgStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stream_node_events<'life0, 'async_trait>(
        &'life0 self,
        request: Request<NodeEventsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamNodeEventsStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stream_hsm_requests<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Empty>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamHsmRequestsStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn respond_hsm_request<'life0, 'async_trait>(
        &'life0 self,
        request: Request<HsmResponse>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn configure<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GlConfig>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn trampoline_pay<'life0, 'async_trait>(
        &'life0 self,
        request: Request<TrampolinePayRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<TrampolinePayResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with NodeServer.

Required Associated Types§

Source

type StreamIncomingStream: Stream<Item = Result<IncomingPayment, Status>> + Send + 'static

Server streaming response type for the StreamIncoming method.

Source

type StreamLogStream: Stream<Item = Result<LogEntry, Status>> + Send + 'static

Server streaming response type for the StreamLog method.

Source

type StreamCustommsgStream: Stream<Item = Result<Custommsg, Status>> + Send + 'static

Server streaming response type for the StreamCustommsg method.

Source

type StreamNodeEventsStream: Stream<Item = Result<NodeEvent, Status>> + Send + 'static

Server streaming response type for the StreamNodeEvents method.

Source

type StreamHsmRequestsStream: Stream<Item = Result<HsmRequest, Status>> + Send + 'static

Server streaming response type for the StreamHsmRequests method.

Required Methods§

Source

fn lsp_invoice<'life0, 'async_trait>( &'life0 self, request: Request<LspInvoiceRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<LspInvoiceResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create an invoice to request an incoming payment. Includes LSP negotiation to open a channel on-demand when needed.

Source

fn stream_incoming<'life0, 'async_trait>( &'life0 self, request: Request<StreamIncomingFilter>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamIncomingStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream incoming payments

Currently includes off-chain payments received matching an invoice or spontaneus paymens through keysend.

Source

fn stream_log<'life0, 'async_trait>( &'life0 self, request: Request<StreamLogRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamLogStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream the logs as they are produced by the node

Mainly intended for debugging clients by tailing the log as they are written on the node. The logs start streaming from the first beginning, in order to allow inspection of events after an error occurred, That also means that the logs can be rather large, and should not be streamed onto resource-constrained devices.

Source

fn stream_custommsg<'life0, 'async_trait>( &'life0 self, request: Request<StreamCustommsgRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamCustommsgStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Listen for incoming custommsg messages from peers.

The messages are forwarded as they come in, and will not be replayed if the stream is interrupted.

Source

fn stream_node_events<'life0, 'async_trait>( &'life0 self, request: Request<NodeEventsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamNodeEventsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream node events in real-time.

This is a unified event stream that delivers various node events as they occur, including invoice updates, peer changes, channel state changes, and balance updates. Events are not persisted and will not be replayed if the stream is interrupted.

Source

fn stream_hsm_requests<'life0, 'async_trait>( &'life0 self, request: Request<Empty>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::StreamHsmRequestsStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

////////////////////////////// HSM Messages ////////////////////////

The following messages are related to communicating HSM requests back and forth. Chances are you won’t need to interact with these at all, unless you want to embed the hsmd into your client. We recommend using a standalone hsmd such as hagrid, keeper of keys, to get started.

Stream requests from the node to any key device that can respond to them.

Source

fn respond_hsm_request<'life0, 'async_trait>( &'life0 self, request: Request<HsmResponse>, ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn configure<'life0, 'async_trait>( &'life0 self, request: Request<GlConfig>, ) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn trampoline_pay<'life0, 'async_trait>( &'life0 self, request: Request<TrampolinePayRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<TrampolinePayResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§