---
# System prepended metadata

title: Connecting to CLN

---

# Connecting to CLN


1. If you want to use the grpc: start the grpc-plugin and generate the bindings from the proto file for your language.
2. If you’re writing in Rust, decide which interface you want to use, then either use cln-rpc if you’re on the same machine (FS access to the socket) or use tonic-build to generate the bindings and connect over grpc (remote, no FS access).
3. If you want to write a plugin in Rust, use cln-plugin
4. If you want to write a plugin in Python, decide on whether to use grpc or JSON-RPC, then either generate the grpc bindings or use pyln-client which includes the JSON-RPC client



```mermaid
flowchart LR
  grpc-client -->|grpc+https| grpc-plugin
  grpc-plugin -->|jsonrpc+uds| CLN
  cln-rpc -->|jsonrpc+uds| CLN
  pyln-client -->|jsonrpc+uds| CLN
  glightning -->|jsonrpc+uds| CLN
  glightning <-->|plugin| CLN
  pyln-plugin <-->|plugin| CLN
  cln-plugin <-->|plugin| CLN
  c-lightning-REST -->|jsonrpc+uds| CLN
  rest-client -->|REST+https| c-lightning-REST
  RTL -->|REST+https| c-lightning-REST
  sparko -->|jsonrpc+uds| CLN
  Spark -->|jsonrpc+https| sparko
  Zeus -->|jsonrpc+https| sparko
  commando -->|jsonrpc+uds| CLN
  commando-client -->|LN proto + jsonrpc| commando
  graphql -->|jsonrpc+uds| CLN
  graphql-client -->|graphql+https| graphql
 ```
 
 Intended uses:
 
 1. `cln-rpc`: contains a JSON-RPC client, that can be used for locally running nodes from Rust
 2. `cln-plugin` contains the framework to drive a plugin through its lifetime
 3. `cln-grpc` is a utility crate that implements the translation layer between the grpc and the JSON-RPC layer (you probably don't want to use this, unless you're re-exposing the grpc interface with custom verification, e.g., greenlight)
4. `grpc-plugin` is a builtin plugin, that uses `cln-rpc` and `cln-grpc` to expose grpc, which then gets translated to JSON-RPC and back using the `cln-grpc` crate (you likely want to start this if you have any grpc clients)