From e6ded440e1d09dc766da1b9660125c15c9f5893f Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Wed, 9 Jul 2025 21:55:30 -0700 Subject: [PATCH] doc: App development updated with standard connection URI format Changelog-None. --- doc/developers-guide/app-development.md | 66 +++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/doc/developers-guide/app-development.md b/doc/developers-guide/app-development.md index 47ebc183bd6e..14645d447be7 100644 --- a/doc/developers-guide/app-development.md +++ b/doc/developers-guide/app-development.md @@ -4,6 +4,9 @@ slug: "app-development" excerpt: "Build a lightning application using Core Lightning APIs." hidden: false --- + +## Interacting with CLN Node + There are several ways to connect and interact with a Core Lightning node in order to build a lightning app or integrate lightning in your application. - Using **[JSON-RPC commands](doc:json-rpc)** if you're building an application in the same system as the CLN node. @@ -13,6 +16,69 @@ There are several ways to connect and interact with a Core Lightning node in ord - Using **[WSS Proxy](doc:wss-proxy)** to connect to a CLN node over web secure socket proxy. - Third-party libraries that offer **[JSON over HTTPS](doc:third-party-libraries#json-over-https)** or **[GraphQL](doc:third-party-libraries#graphql)** (deprecated) frameworks to connect to a CLN node remotely. +## CLN connection URIs + +This section outlines the standard URI formats for connecting to Core Lightning (CLN) nodes via different protocols. + +### Commando WebSocket Connection +``` +commando+://:?pubkey=&rune=&invoiceRune=&certs= +``` + +#### Parameters: +- protocol: ws or wss (WebSocket or secure WebSocket) +- cln-host: Hostname or IP address of the CLN node +- ws-port: WebSocket port +- pubkey: Node's public key (hex encoded) +- rune: Authentication rune for general commands +- invoiceRune: Specific rune for invoice creation (optional) +- certs: Base64-encoded concatenation of client key, client cert, and CA cert + +#### Example: + +``` +commando+wss://cln.local:5001?pubkey=023456789abcdef&rune=8hJ6ZKFvRune&invoiceRune=5kJ3ZKFvInvRune&certs=LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0t +``` + +### REST API Connection +``` +clnrest+://:?rune=&certs= +``` + +#### Parameters: +- protocol: http or https +- rest-host: Hostname or IP address of the REST interface +- rest-port: REST API port (typically 3010) +- rune: Authentication rune for REST API access +- certs: Base64-encoded concatenation of client key, client cert, and CA cert + +#### Example: + +``` +clnrest+https://cln.local:3010?rune=8hJ6ZKFvRune&certs=LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0t +``` + +## gRPC Connection + +``` +clngrpc://:?pubkey=&protoPath=&certs= +``` + +#### Parameters: +- grpc-host: Hostname or IP address of the gRPC interface +- grpc-port: gRPC port (typically 9736) +- pubkey: Node's public key (hex encoded) +- protoPath: Path to protocol buffer definition file (typically https://github.com/ElementsProject/lightning/tree/master/cln-grpc/proto) +- certs: Base64-encoded concatenation of client key, client cert, and CA cert + +#### Example: + +``` +clngrpc://cln.grpc:9736?pubkey=023456789abcdef&protoPath=/path/to/cln.proto&certs=LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0t +``` + +## Image of available API interfaces and transport protocols + [block:image] { "images": [