pub struct NodeClient<T> { /* private fields */ }
Expand description
The node service represents your node running on greenlight’s
infrastructure. You can use the exposed RPC methods to interact
with your node. The URI used to connect to the node depends on
where the node is being scheduled and is returned by the
Scheduler.Schedule()
RPC call.
Notice that in order to connect to the node the caller must use the
node-specific mTLS keypair returned by Scheduler.Register()
or
Scheduler.Recover()
. In particular the anonymous mTLS keypair is
rejected by the node.
Deprecated methods are being replaced by the standardized and
automatically managed cln-grpc protocol you can find in
node.proto
Implementations§
Source§impl NodeClient<Channel>
impl NodeClient<Channel>
Source§impl<T> NodeClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> NodeClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> NodeClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub async fn stream_incoming(
&mut self,
request: impl IntoRequest<StreamIncomingFilter>,
) -> Result<Response<Streaming<IncomingPayment>>, Status>
pub async fn stream_incoming( &mut self, request: impl IntoRequest<StreamIncomingFilter>, ) -> Result<Response<Streaming<IncomingPayment>>, Status>
Stream incoming payments
Currently includes off-chain payments received matching an invoice or spontaneus paymens through keysend.
Sourcepub async fn stream_log(
&mut self,
request: impl IntoRequest<StreamLogRequest>,
) -> Result<Response<Streaming<LogEntry>>, Status>
pub async fn stream_log( &mut self, request: impl IntoRequest<StreamLogRequest>, ) -> Result<Response<Streaming<LogEntry>>, Status>
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.
Sourcepub async fn stream_custommsg(
&mut self,
request: impl IntoRequest<StreamCustommsgRequest>,
) -> Result<Response<Streaming<Custommsg>>, Status>
pub async fn stream_custommsg( &mut self, request: impl IntoRequest<StreamCustommsgRequest>, ) -> Result<Response<Streaming<Custommsg>>, Status>
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.
Sourcepub async fn stream_hsm_requests(
&mut self,
request: impl IntoRequest<Empty>,
) -> Result<Response<Streaming<HsmRequest>>, Status>
pub async fn stream_hsm_requests( &mut self, request: impl IntoRequest<Empty>, ) -> Result<Response<Streaming<HsmRequest>>, Status>
////////////////////////////// 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.
pub async fn respond_hsm_request( &mut self, request: impl IntoRequest<HsmResponse>, ) -> Result<Response<Empty>, Status>
pub async fn configure( &mut self, request: impl IntoRequest<GlConfig>, ) -> Result<Response<Empty>, Status>
pub async fn trampoline_pay( &mut self, request: impl IntoRequest<TrampolinePayRequest>, ) -> Result<Response<TrampolinePayResponse>, Status>
Trait Implementations§
Source§impl<T: Clone> Clone for NodeClient<T>
impl<T: Clone> Clone for NodeClient<T>
Source§fn clone(&self) -> NodeClient<T>
fn clone(&self) -> NodeClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for NodeClient<T>
impl<T> RefUnwindSafe for NodeClient<T>where
T: RefUnwindSafe,
impl<T> Send for NodeClient<T>where
T: Send,
impl<T> Sync for NodeClient<T>where
T: Sync,
impl<T> Unpin for NodeClient<T>where
T: Unpin,
impl<T> UnwindSafe for NodeClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request