Source repository: https://github.com/UTEXO-Protocol/rgb-lightning-nodeFull OpenAPI / Swagger reference: https://rgb-tools.github.io/rgb-lightning-node
Prerequisites
Before starting, make sure you have the following available:| Dependency | Purpose |
|---|---|
| bitcoind | Bitcoin full node the RLN daemon connects to |
| Electrum or Esplora indexer | Required for UTXO lookups |
| RGB Proxy Server | Relay for RGB state transitions (see rgb-proxy-server) |
| Rust toolchain (stable) | Needed to build from source |
| Docker*(optional)* | For the containerised setup and regtest helper scripts |
Installation
Build from Source
Clone the repository with its submodules:rgb-lightning-node binary:
Docker Image
Build the Docker image locally:Running the Node
Each RLN daemon is started withrgb-lightning-node and requires the following arguments:
| Flag | Description |
|---|---|
<data-dir> | Directory where node state is persisted |
--daemon-listening-port | Port for the REST API |
--ldk-peer-listening-port | Port for Lightning peer connections |
--network | One of regtest, testnet, testnet4 |
--disable-authentication | Skip token auth (development only) |
--root-public-key | Public key used to verify Biscuit tokens (production) |
Regtest (Local Development)
Start the required Docker services (bitcoind, electrs, proxy):Regtest Helper Commands
Regtest with Docker
To run a node inside Docker while using the shared regtest network:RLNdata1 volume. To start fresh:
Testnet3
No local Docker services needed — the node uses public infrastructure:Testnet4
Same as testnet3, with the following differences:Authentication
RLN uses Biscuit tokens for API authentication. For production deployments never use--disable-authentication.
One-Time Setup
Install the Biscuit CLI and generate a root keypair:Minting Tokens
Three built-in roles are available: Admin (full access):Using Tokens
Pass the token in theAuthorization header:
Revoking Tokens
To revoke a token before its expiry:Using the REST API
Once a daemon is running, interact with it via its REST API. Example — issue an RGB asset:Key Endpoints
| Endpoint | Method | Description |
|---|---|---|
/init | POST | Initialise and unlock the node |
/unlock | POST | Unlock a locked node |
/lock | POST | Lock the node |
/nodeinfo | GET | Return node identity and status |
/networkinfo | GET | Return network-level info |
/btcbalance | POST | Get on-chain BTC balance |
/address | POST | Generate a new Bitcoin address |
/openchannel | POST | Open an RGB payment channel |
/closechannel | POST | Close a channel |
/listchannels | GET | List all channels |
/connectpeer | POST | Connect to a Lightning peer |
/listpeers | GET | List connected peers |
/lninvoice | POST | Create a Lightning invoice |
/sendpayment | POST | Pay a Lightning invoice |
/rgbinvoice | POST | Create an RGB invoice |
/sendrgb | POST | Send RGB assets on-chain |
/issueasset | POST | Issue a new NIA RGB asset |
/issueassetcfa | POST | Issue a CFA RGB asset |
/listassets | POST | List all RGB assets |
/assetbalance | POST | Get balance of a specific asset |
/backup | POST | Create an encrypted backup |
/restore | POST | Restore from an encrypted backup |
/shutdown | POST | Gracefully stop the daemon |
The complete list of all 50+ endpoints with request/response schemas is available in the interactive Swagger UI at https://rgb-tools.github.io/rgb-lightning-node.
Running a Local Swagger UI
You can also expose the OpenAPI spec locally:http://localhost:8246 in your browser. If a daemon is running on one of the example ports you can call the APIs directly from the UI.
Running Tests
Integration tests use the same regtest services asregtest.sh (they cannot run simultaneously):
Production Checklist
Secure your private key
Store the Biscuit issuer private key in a dedicated secret manager. Never commit it to version control.
Enable authentication
Remove
--disable-authentication and pass --root-public-key when starting the daemon.Restrict network access
Expose only the daemon REST port (default
3001) to trusted clients. Firewall the LN peer port (9735) as appropriate.Persist data
Mount the node data directory on durable storage (e.g. a named Docker volume or a cloud disk) to survive container restarts.
Monitor the daemon
Poll
GET /nodeinfo and GET /networkinfo periodically to verify the node is reachable and in sync.