Skip to content

Standardise and Document Connection URLs for CLN Tools/Plugins #8394

@ShahanaFarooqui

Description

@ShahanaFarooqui

Current Implementation

The existing connection URLs for interacting with a CLN node (Commando, CLN REST, and CLN gRPC) are:

ln-message://<ip>:<ws-port>?rune=<rune>
cln-grpc://<protocol>://<ip>:<grpc-port>?clientKey=<client-key>&clientCert=<client-cert>&caCert=<ca-cert>
clnrest://<protocol>://<ip>:<rest-port>?rune=<rune>&clientKey=<client-key>&clientCert=<client-cert>&caCert=<ca-cert>

Issues with Current Implementation

  • Inconsistent structure across different connection types.
  • proto://transport:// repeats ://, making parsing ambiguous.
  • Client key, client cert, and CA cert are passed separately;

Proposed standardised URL formats:

commando+<protocol>://<cln-host>:<ws-port>?pubkey=<pubkey>&rune=<rune>&invoiceRune=<invoice-rune>&certs=<combined-base64-encoded-clientkey-clientcert-cacert>
clnrest+<protocol>://<rest-host>:<rest-port>?rune=<rune>&certs=<combined-base64-encoded-clientkey-clientcert-cacert>
clngrpc://<grpc-host>:<grpc-port>?pubkey=<pubkey>&protoPath=<path-to-proto>&certs=<combined-base64-encoded-clientkey-clientcert-cacert>

Key Improvements:

  • Cleaner protocol syntax by replacing proto://transport:// with proto+transport://
  • Consolidated TLS credentials into a single base64-encoded certs parameter
  • Consistent naming scheme (commando, clnrest, clngrpc)
  • Changed ln-message to commando for future tools connecting via commando
  • Include protocol & certs for commando via wss-proxy
  • Add protoPath to support self-contained gRPC stub generation
  • Add pubkey for clngrpc for GL's gRPC proxy server
  • Remove protocol from clngrpc as it is always https

Thanks to @cdecker for his valuable advice on this :).

Metadata

Metadata

Labels

Status::AssignedThe issue has been given to a team member for resolution.docs

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions