lightning icon indicating copy to clipboard operation
lightning copied to clipboard

gRPC Docs

Open benthecarman opened this issue 2 years ago • 1 comments

It would be nice to have docs on how to use the new gRPC server.

Some non-obvious this I have noticied:

No default port, only enabled if port is set Not packaged with the release Various .pem files are used (needed to read the code to find these lol)

benthecarman avatar May 22 '22 00:05 benthecarman

Better documentation around the gRPC plugin would really help devs hit the ground running using c-lightning.

For other people coming across this issue, grpc-port=8001 must be present in the config file in the .lightning directory to enable the gRPC plugin.

Also, the explainers for the various .pem certificates that are created can be found here:

/// Ensure that we have a certificate authority, and child keypairs
/// and certificates for the server and the client. It'll generate
/// them in the provided `directory`. The following files are
/// included:
///
/// - `ca.pem`: The self-signed certificate of the CA
/// - `ca-key.pem`: The key used by the CA to sign certificates
/// - `server.pem`: The server certificate, signed by the CA
/// - `server-key.pem`: The server private key
/// - `client.pem`: The client certificate, signed by the CA
/// - `client-key.pem`: The client private key
///
/// The `grpc-plugin` will use the `server.pem` certificate, while a
/// client is supposed to use the `client.pem` and associated
/// keys. Notice that this isn't strictly necessary since the server
/// will accept any client that is signed by the CA. In future we
/// might add runes, making the distinction more important.
///
/// Returns the server identity and the root CA certificate.

KayBeSee avatar May 25 '22 01:05 KayBeSee