GRPC
5 min
use grpc for generated clients, typed request and response messages, and streaming calls to the lnd node behind a node backed deployment collect the node host, the current grpc endpoint and port, compatible lnd proto files, a least privilege macaroon, and the tls credentials required by the client use configuration docid 9e9fmbsr1zz4nbvl47afl for the complete connection checklist verify connection material against the current node instead of copying a port, certificate override, or dashboard path from historical documentation generate a compatible client generate client code from lnd proto files that are compatible with the node version and the services your application uses pin the proto source and generation toolchain in the application build regenerate and retest clients deliberately when the node or lnd dependency changes do not assume that an example generated from a different lnd version exposes the same fields, methods, or service definitions authentication metadata encode the macaroon as a hex string and attach it to each call as macaroon metadata keep read only monitoring credentials separate from credentials that can create invoices, send funds, change channels, or administer the node do not log metadata or complete errors that can expose credentials tls credentials use tls credentials that validate the endpoint presented by the current node keep certificate material in protected runtime configuration and fail closed when validation does not succeed older client guidance may mention language specific cipher suite or certificate workarounds treat those instructions as version and environment specific until they are verified against the current client, lnd version, and endpoint do not disable tls verification in production first connection test begin with a read only node information request verify the node identity and bitcoin network in the response confirm that missing macaroon, invalid macaroon, tls, timeout, and unavailable service failures are handled without exposing secrets only enable payment, channel, or wallet write calls after the read only connection is stable streaming calls use explicit deadlines and cancellation for unary calls for streams, implement reconnect with bounded backoff, detect gaps or duplicate events, and reconcile state with an independent read after reconnect track connection state, stream age, reconnect count, authentication failures, tls failures, and the age of the last successfully processed event continue configuration docid 9e9fmbsr1zz4nbvl47afl for endpoint, macaroon, and tls setup rest docid\ ccwymsz2axxdlr4lyhqpd for standard http integrations node security docid\ rlda4beej5rlbld3jm2ql and macaroons docid\ gwvwanydfdd27zrsn32pc for access controls resources docid\ uldxo3 oydlivaxfda5lk for the official lnd api, repository, proto, and installation references