Lightning Network Quick Start for c-lightning

Accepting Lightning Network payments is advanced feature for power users willing to manage their Lightning Network daemon.

Prerequisites

Understanding

  • You are expected to setup and manage your c-lightning outside of CypherpunkPay (but most likely on the same server)
  • Your c-lightning wallet and CypherpunkPay wallet are separate wallets
  • CypherpunkPay uses a small subset of c-lightning JSON-RPC API to create LN invoices and to ask for their status
  • C-lightning only offers listening on the Unix socket - this implies running on the same server as CypherpunkPay

Config

Add this to your /etc/cypherpunkpay.conf:

[lightning-network]

btc_lightning_enabled = true

# C-lightning specific. The filesystem path to the RPC socket created by lightningd daemon.
# The cypherpunkpay user must have read and write permissions to this socket.
# Also, make sure the cypherpunkpay user can access the filesystem *path* where the socket file resides.
btc_lightning_lightningd_socket_path = /home/lightning/.lightning/mainnet/lightning-rpc

Adjust path to socket file

Adjust path to socket file created by your installation of c-lightning (btc_lightning_lightningd_socket_path) in above config. If you are not sure where running lightningd daemon created the socket file, try sudo updatedb; sudo locate lightning-rpc.

Mind permissions to both lightning-rpc socket file and the path. The user CypherpunkPay runs as must be able to read/write the socket.

Restart CypherpunkPay and test

sudo systemctl restart cypherpunkpay

After restart you should be able to pick “Bitcoin (BTC) Lightning Network” on the coin selection step.

Debugging

Watch CypherpunkPay logs for specific error messages:

sudo journalctl -xe --unit cypherpunkpay.service