2021-10-01 10:23:45 +02:00
<!-- omit in toc -->
2022-06-08 22:33:38 +02:00
# Core Lightning on the RaspiBlitz FAQ
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
<!-- omit in toc -->
## Table of Contents
2022-06-08 22:33:38 +02:00
- [Common questions about the different Lightning Network implementations ](#common-questions-about-the-different-lightning-network-implementations )
- [Can LND and CLN nodes open channels to each other and route payments? ](#can-lnd-and-cln-nodes-open-channels-to-each-other-and-route-payments )
- [Can I run LND and CLN connected to the same node? ](#can-i-run-lnd-and-cln-connected-to-the-same-node )
- [Can I convert an LND node to CLN (or the opposite)? ](#can-i-convert-an-lnd-node-to-cln-or-the-opposite )
- [Is there a table to quickly compare LND and CLN? ](#is-there-a-table-to-quickly-compare-lnd-and-cln )
- [CLN official documentation and support channels ](#cln-official-documentation-and-support-channels )
- [Commands and aliases ](#commands-and-aliases )
- [Directories ](#directories )
- [Config file ](#config-file )
- [Default values ](#default-values )
2022-08-13 09:44:01 +02:00
- [CLN cheatsheet ](#cln-cheatsheet )
2022-06-08 22:33:38 +02:00
- [Plug-ins ](#plug-ins )
- [General info ](#general-info )
- [Directories ](#directories-1 )
- [Implemented plugins ](#implemented-plugins )
- [Add a custom plugin ](#add-a-custom-plugin )
- [CLBOSS ](#clboss )
- [Feeadjuster ](#feeadjuster )
- [Dual funded channels ](#dual-funded-channels )
- [Reading ](#reading )
- [Setting up ](#setting-up )
- [Open a dual funded channel ](#open-a-dual-funded-channel )
- [Fundchannel syntax ](#fundchannel-syntax )
- [Multifundchannel syntax ](#multifundchannel-syntax )
- [Offers ](#offers )
2022-08-13 09:44:01 +02:00
- [Poncho - hosted channels ](#poncho---hosted-channels )
- [Feature bits ](#feature-bits )
2022-06-08 22:33:38 +02:00
- [Testnets ](#testnets )
- [Backups ](#backups )
2022-07-21 16:49:40 +02:00
- [Backup strategy ](#backup-strategy )
2022-06-08 22:33:38 +02:00
- [Seed ](#seed )
2023-03-07 21:07:47 +01:00
- [How to display the hsm\_secret in a human-readable format? ](#how-to-display-the-hsm_secret-in-a-human-readable-format )
2022-06-08 22:33:38 +02:00
- [How to test the seedwords? ](#how-to-test-the-seedwords )
2023-03-07 21:07:47 +01:00
- [How to restore the hsm\_secret from text? ](#how-to-restore-the-hsm_secret-from-text )
2022-06-08 22:33:38 +02:00
- [Channel database ](#channel-database )
2023-03-07 21:07:47 +01:00
- [Recovery ](#recovery )
- [Recover from a cl-rescue file ](#recover-from-a-cl-rescue-file )
- [Recover from a seed ](#recover-from-a-seed )
- [Emergency recovery in case of lost channel states ](#emergency-recovery-in-case-of-lost-channel-states )
- [Restore a CLN node from the database backup on the SDcard ](#restore-a-cln-node-from-the-database-backup-on-the-sdcard )
- [Rescan the chain after restoring a used CLN wallet ](#rescan-the-chain-after-restoring-a-used-cln-wallet )
- [Guesstoremote to recover funds from force-closed channels ](#guesstoremote-to-recover-funds-from-force-closed-channels )
2022-06-08 22:33:38 +02:00
- [sqlite3 queries ](#sqlite3-queries )
2023-03-07 21:07:47 +01:00
- [Extract the private and public key from the hsm\_secret file ](#extract-the-private-and-public-key-from-the-hsm_secret-file )
2022-06-08 22:33:38 +02:00
- [Update ](#update )
- [Update to a new CLN release ](#update-to-a-new-cln-release )
- [Experimental update to the latest master ](#experimental-update-to-the-latest-master )
- [sqlite3 queries ](#sqlite3-queries-1 )
- [Script file help list ](#script-file-help-list )
2022-07-21 16:49:40 +02:00
- [All possible config options ](#all-possible-config-options )
2021-10-11 15:49:06 +02:00
## Common questions about the different Lightning Network implementations
2022-06-08 22:33:38 +02:00
### Can LND and CLN nodes open channels to each other and route payments?
2021-10-11 15:49:06 +02:00
* Yes, all [BOLT specification ](https://github.com/lightningnetwork/lightning-rfc ) compliant implementations can open channels to each other and route payments.
2022-06-08 22:33:38 +02:00
### Can I run LND and CLN connected to the same node?
2023-01-15 22:08:30 +01:00
* Yes, both can run parallel on a RaspiBlitz and even have channels with each other.
2021-10-11 15:49:06 +02:00
2022-06-08 22:33:38 +02:00
### Can I convert an LND node to CLN (or the opposite)?
2022-02-10 22:08:46 +01:00
* No, currently there are no tools available to convert between the databases storing the channel states.
2021-10-11 15:49:06 +02:00
The channels would need to be closed to use the same funds in an other node.
2022-06-08 22:33:38 +02:00
### Is there a table to quickly compare LND and CLN?
2021-10-11 15:49:06 +02:00
* see [github.com/openoms/lightning-node-management/blob/master/node-types/comparison.md ](https://github.com/openoms/lightning-node-management/blob/master/node-types/comparison.md )
---
2022-06-08 22:33:38 +02:00
## CLN official documentation and support channels
2021-10-01 10:23:45 +02:00
* https://lightning.readthedocs.io/
2022-02-13 23:38:44 +01:00
* https://github.com/ElementsProject/lightning
* Telegram: https://t.me/lightningd
* Discord: https://discord.gg/YGdpyj2aXj
* IRC: #c -lightning on libera.chat or https://matrix.to/#/#c-lightning:libera.chat
2021-10-01 10:23:45 +02:00
## Commands and aliases
2022-06-08 22:33:38 +02:00
* Check if the CLN daemon is running:
2021-10-01 10:23:45 +02:00
```
sudo systemctl status lightningd
```
* Follow it's system output for debugging:
```
sudo journalctl -fu lightningd
```
* The logs can be accessed in the menu `SYSTEM` - `CLLOG`
or with the alias: `cllog`
* The frequently used commands are shortened with alisases. Check them with the command `alias` :
```
alias cl='sudo -u bitcoin /usr/local/bin/lightning-cli --conf=/home/bitcoin/.lightning/config'
alias clconf='sudo nano /home/bitcoin/.lightning/config'
alias cllog='sudo tail -n 30 -f /home/bitcoin/.lightning/bitcoin/cl.log'
```
## Directories
2022-02-10 22:08:46 +01:00
* All data is stored on the disk in:
`/mnt/hdd/app-data/.lightningd`
* and symlinked to:
2021-10-01 10:23:45 +02:00
`/home/bitcoin/.lightningd`
## Config file
* Edit in the menu `SYSTEM` - `CLNCONF` or use the alias `clconf`
### Default values
* on the RaspiBlitz for mainnet
2021-11-30 12:58:06 +01:00
```
network=bitcoin
log-file=cl.log
log-level=info
plugin-dir=/home/bitcoin/cln-plugins-enabled
# Tor settings
proxy=127.0.0.1:9050
bind-addr=127.0.0.1:9736
addr=statictor:127.0.0.1:9051/torport=9736
always-use-proxy=true
```
2022-07-21 16:49:40 +02:00
* find [all the possible config options ](#all-possible-config-options ) below.
2021-10-01 10:23:45 +02:00
2022-08-13 09:44:01 +02:00
## CLN cheatsheet
< https: / / github . com / grubles / cln-cheatsheet >
2021-10-01 10:23:45 +02:00
## Plug-ins
### General info
* https://lightning.readthedocs.io/PLUGINS.html#a-day-in-the-life-of-a-plugin
* https://github.com/lightningd/plugins/
### Directories
2022-02-10 22:08:46 +01:00
* The plugins are installed to:
2021-10-01 10:23:45 +02:00
`/home/bitcoin/cl-plugins-available`
2022-02-10 22:08:46 +01:00
* and symlinked to:
2021-10-01 10:23:45 +02:00
`/home/bitcoin/cl-plugins-enabled`
* All plugins in the `/home/bitcoin/cl-plugins-enabled` directory are loaded automatically as set in the config file: `/home/bitcoin/.lightningd/config`
### Implemented plugins
* summary
* sparko
2021-11-30 12:58:06 +01:00
* [CLBOSS ](#clboss )
* [feeadjuster ](#feeadjuster )
2021-10-01 10:23:45 +02:00
### Add a custom plugin
2022-02-10 22:08:46 +01:00
* Place the plugin in the `/home/bitcoin/cl-plugins-enabled` directory
2021-10-10 10:41:40 +02:00
* Make sure it is owned by the `bitcoin` user and is executable:
```
sudo chown bitcoin:bitcoin /home/bitcoin/cl-plugins-enabled/PLUGIN_NAME
sudo chmod +x /home/bitcoin/cl-plugins-enabled/PLUGIN_NAME
```
* start with
2021-10-01 10:23:45 +02:00
```
2023-07-28 23:06:05 +02:00
lightning-cli plugin start /home/bitcoin/cl-plugins-enabled/PLUGIN_NAME
2021-10-01 10:23:45 +02:00
```
2021-10-10 10:41:40 +02:00
* or to load it automatically on restart:
2021-10-01 10:23:45 +02:00
```
sudo systemctl restart lightningd
```
2021-10-10 10:41:40 +02:00
From the directory `/home/bitcoin/cl-plugins-enabled` it will load auomatically after restarts.
2022-02-10 22:08:46 +01:00
* To just load it run it once store in (and start from):
2021-10-01 10:23:45 +02:00
`/home/bitcoin/cl-plugins-available/`
### CLBOSS
2022-02-10 22:08:46 +01:00
A plugin for automatic LN node management.
2022-06-08 22:33:38 +02:00
CLBOSS only requires to have funds deposited to the onchain wallet of CLN.
2021-10-01 10:23:45 +02:00
The recommended amount to start is ~ 10 million satoshis (0.1 BTC).
It does automatically:
* generate outbound capacity - opens channels
* generate inbound capacity - submarine swaps through the boltz.exchange API
2022-06-08 22:33:38 +02:00
* aware of onchain fees and mempool through CLN and makes transactions when fees are low
2021-10-01 10:23:45 +02:00
* manages rebalancing - performs probing
* closes bad channels (inactive or low traffic) - this function needs to activated manually
Overall it is a tool which makes users able to send and receive lightning payments with minimal interaction, basically setting up a routing node by itself.
The transactions made by CLBOSS does cost money and running it requires a fair amount of trust in the (fully open-source - MIT) code.
2023-07-28 23:06:05 +02:00
Neither the CLBOSS nor the RaspiBlitz developers can take responsibility for lost sats, use at your own discretion!
2021-10-01 10:23:45 +02:00
* Activate it in the menu - `SETTINGS` - `-CL CLBOSS`
* Discussion: https://github.com/rootzoll/raspiblitz/issues/2490
* Advanced usage
2022-02-10 22:08:46 +01:00
https://github.com/ZmnSCPxj/clboss#clboss-status
2021-10-01 10:23:45 +02:00
* Stopping CLBOSS will leave the node in the last state. No channels will be closed or funds removed when CLBOSS is uninstalled.
2022-03-14 16:37:44 +01:00
* Check the running version:
```
/home/bitcoin/cl-plugins-enabled/clboss --version
```
2021-10-01 10:23:45 +02:00
### Feeadjuster
* Install:
2022-01-08 20:04:36 +01:00
`config.scripts/cl-plugin.feeadjuster.sh on`
2021-10-01 10:23:45 +02:00
2022-06-08 22:33:38 +02:00
* to set the default fees add to the CLN config file (`clconf`)
2021-11-30 12:58:06 +01:00
```
fee-base=BASEFEE_IN_MILLISATS
fee-per-satoshi=PPM_FEE_IN_SATS
```
2022-06-08 22:33:38 +02:00
* example feeadjuster options
```
fee-base=0
fee-per-satoshi=200
feeadjuster-imbalance=0.2
feeadjuster-threshold=0.10
feeadjuster-threshold-abs=0.01btc
feeadjuster-enough-liquidity=1000000000msat
feeadjuster-deactivate-fee-update
feeadjuster-adjustment-method=hard
```
* effect displayed in the logs (`cllog`)
```
plugin-feeadjuster.py:
Plugin feeadjuster initialized (0 base / 200 ppm) with an imbalance of 20%/80%,
update_threshold: 10%, update_threshold_abs: 1000000000msat,
enough_liquidity: 1000000000msat, deactivate_fuzz: None,
forward_event_subscription: False, adjustment_method: get_ratio_hard,
fee_strategy: get_fees_global, listchannels_by_dst: True
2021-10-01 10:23:45 +02:00
```
2022-06-08 22:33:38 +02:00
* more options for the feeadjuster to be set in the CLN config can be seen in the [code ](https://github.com/lightningd/plugins/blob/master/feeadjuster/feeadjuster.py#L323 )
2021-10-01 10:23:45 +02:00
* start the feeadjuster
```
cl plugin start /home/bitcoin/cl-plugins-available/plugins/feeadjuster/feeadjuster.py
```
* stop (best to run only periodically)
```
cl plugin stop /home/bitcoin/cl-plugins-available/plugins/feeadjuster/feeadjuster.py
```
* Can use menu - `CL` - `SUEZ` to visualize the channel balances and fee settings
* check the list of base fees
```
cl listpeers | grep fee_base_msat
```
* check the list of proportional fees
```
cl listpeers | grep fee_proportional_millionths
```
* set the fees to the defaults
```
cl setchannelfee all
```
### Dual funded channels
#### Reading
2022-02-10 22:08:46 +01:00
* https://medium.com/blockstream/c-lightning-opens-first-dual-funded-mainnet-lightning-channel-ada6b32a527c
* https://medium.com/blockstream/setting-up-liquidity-ads-in-c-lightning-54e4c59c091d
* https://twitter.com/niftynei/status/1389328732377255938
2021-10-01 10:23:45 +02:00
* lightning-rfc PR: https://github.com/lightningnetwork/lightning-rfc/pull/851/files
* represented by the feature bits 28/29
#### Setting up
2022-02-10 22:08:46 +01:00
* activate the feature on your node:
Type: `clconf` or use the menu `SYSTEM` - `CLCONF` .
2021-10-01 10:23:45 +02:00
Add the line:
```
2022-02-10 22:08:46 +01:00
experimental-dual-fund
2021-10-01 10:23:45 +02:00
```
2022-06-08 22:33:38 +02:00
Save and restart CLN.
2021-10-01 10:23:45 +02:00
* set up a liquidity ad:
```
lightning-cli funderupdate -k policy=match policy_mod=100
```
or set in the config for example - see the meaning of each line in https://medium.com/blockstream/setting-up-liquidity-ads-in-c-lightning-54e4c59c091d :
```
experimental-dual-fund
funder-policy=match
funder-policy-mod=100
lease-fee-base-msat=500sat
lease-fee-basis=50
channel-fee-max-base-msat=100sat
channel-fee-max-proportional-thousandths=2
```
* check the settings used currently on your node:
```
lightning-cli funderupdate
```
* check your advertised settings (needs some minutes to appear):
```
lightning-cli listnodes $(lightning-cli getinfo | jq .id)
```
#### Open a dual funded channel
* check if a node has onchain liquidity on offer:
```
lightning-cli listnodes nodeid
```
Example:
2022-02-10 22:08:46 +01:00
```
2021-10-01 10:23:45 +02:00
lightning-cli listnodes 02cca6c5c966fcf61d121e3a70e03a1cd9eeeea024b26ea666ce974d43b242e636
```
* list all nodes known in the graph with active offers:
```
lightning-cli listnodes | grep option_will_fund -B20 -A7
```
* note the node `id` and `compact_lease`
* connect to the node
```
lightning-cli connect nodeID@IP_or.onion
```
#### Fundchannel syntax
2022-02-10 22:08:46 +01:00
* the amount is the own funds in the wallet contributed
use equal amounts to have a balanced channel from start
2021-10-01 10:23:45 +02:00
the amounts can be specified in `sat` or `btc`
```
lightning-cli fundchannel -k id=NODE_ID amount=OWN_AMOUNTsat request_amt=PEER_CONTRIBUTION_AMOUNTsat compact_lease=COMPACT_LEASE
2022-02-10 22:08:46 +01:00
```
2021-10-01 10:23:45 +02:00
It can fail if the offer changed or there are not enough funds available on either side.
2022-02-10 22:08:46 +01:00
* open a dual funded channel with a chosen utxo and miner feerate
list the utxo-s with `lightning-cli listfunds` , can list multiple
2021-10-01 10:23:45 +02:00
the feerate is in `perkb` by default, e.g. use 1000 for 1 sat/byte
```
2023-07-28 23:06:05 +02:00
lightning-cli fundchannel feerate=PERKB_FEERATE utxos='["TRANSACTION_ID:INDEX_NUMBER"]' -k id=NODE_ID amount=OWN_AMOUNTsat request_amt=PEER_CONTRIBUTION_AMOUNTsat compact_lease=COMPACT_LEASE
2021-10-01 10:23:45 +02:00
```
2022-06-08 22:33:38 +02:00
#### Multifundchannel syntax
* discussed in https://github.com/ElementsProject/lightning/issues/4642#issuecomment-1149657371
* see a good format (json autoformatting tools help - like `CTRL` +`SHIFT`+`i` in VSCode):
```
â‚¿ lightning-cli multifundchannel '[
{
"id": "nodeID1",
"amount": "amount_in_sats"
},
{
"id": "nodeID2",
"amount": "amount_in_sats"
},
{
"id": "nodeID3",
"amount": "amount_in_sats"
},
{
"id": "nodeID4",
"amount": "amount_in_sats",
}
]' 1000perkb
```
* The returned output:
```
{
"tx": "RAW............TX",
"txid": "TX................ID",
"channel_ids": [
{
"id": "nodeID1",
"channel_id": "CHANNEL_ID2",
"outnum": 3
},
{
"id": "nodeID2",
"channel_id": "CHANNEL_ID1",
"outnum": 4
},
{
"id": "nodeID3",
"channel_id": "CHANNEL_ID4",
"outnum": 1
},
{
"id": "nodeID4",
"channel_id": "CHANNEL_ID3",
"outnum": 2
}
],
"failed": []
}
```
2021-10-01 10:23:45 +02:00
### Offers
* Details at bolt12.org
2022-02-10 22:08:46 +01:00
* Create an offer to receive payments:
2021-10-01 10:23:45 +02:00
https://lightning.readthedocs.io/lightning-offer.7.html
```
lightning-cli offer amount description [vendor] [label] [quantity_min] [quantity_max] [absolute_expiry] [recurrence] [recurrence_base] [recurrence_paywindow] [recurrence_limit] [single_use]
```
2022-02-10 22:08:46 +01:00
* Example:
2021-10-01 10:23:45 +02:00
Create a reusable offer which can be paid with any amount for LN tips using a fixed string.
```
lightning-cli offer any tip
```
2022-02-10 22:08:46 +01:00
* Create an offer to send payments:
https://lightning.readthedocs.io/lightning-offerout.7.html
2021-10-01 10:23:45 +02:00
```
lightning-cli offerout amount description [vendor] [label] [absolute_expiry] [refund_for]
```
2022-02-10 22:08:46 +01:00
* Fetch an invoice to pay an offer:
https://lightning.readthedocs.io/lightning-fetchinvoice.7.html
2021-10-01 10:23:45 +02:00
Will need at least one peer which supports onion the messages. For example:
```
lightning-cli connect 024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605@128.199.202.168:9735
```
2022-02-10 22:08:46 +01:00
* Then use the command to fetch the BOLT12 invoice:
2021-10-01 10:23:45 +02:00
```
lightning-cli fetchinvoice offer [msatoshi] [quantity] [recurrence_counter] [recurrence_start] [recurrence_label] [timeout] [payer_note]
```
2022-02-10 22:08:46 +01:00
* decode a BOLT12 invoice:
2021-10-01 10:23:45 +02:00
```
lightning-cli decode bolt12_invoice
```
* pay a a BOLT12 invoice:
Will need to pay through a peer which supports the onion messages which means you need at least one channel with such a node.
```
lightning-cli pay bolt12_invoice
```
* see if there is a new invoice is paid with:
```
lightning-cli listinvoices
```
The `pay_index` will increase as the offer gets reused.
2022-08-13 09:44:01 +02:00
### Poncho - hosted channels
* < https: // github . com / fiatjaf / poncho />
* < https: // github . com / rootzoll / raspiblitz / issues / 3269 >
## Feature bits
* < https: // bitcoin . stackexchange . com / questions / 107484 / how-can-i-decode-the-feature-string-of-a-lightning-node-with-bolt-9 >
* Convert the hex number from `lightning-cli listpeers` to binary: < https: // www . binaryhexconverter . com / hex-to-binary-converter > and count the position of the bits from the right.
2021-10-01 10:23:45 +02:00
## Testnets
* for testnet and signet there are prefixes `t` and `s` used for the aliases, daemons and their own plugin directory names.
* Testnet
```
2022-02-10 22:08:46 +01:00
# alias:
2021-10-01 10:23:45 +02:00
tcl | tclconf | tcllog
2022-02-10 22:08:46 +01:00
# daemon service name:
2021-10-01 10:23:45 +02:00
tlightningd
2022-02-10 22:08:46 +01:00
2021-10-01 10:23:45 +02:00
# config file:
/home/bitcoin/.lightningd/testnet/config
2022-02-10 22:08:46 +01:00
2021-10-01 10:23:45 +02:00
# plugin directory:
/home/bitcoin/tcl-plugins-enabled
```
* Signet
```
# aliases:
scl | sclconf | scllog
2022-02-10 22:08:46 +01:00
# daemon service name:
2021-10-01 10:23:45 +02:00
slightningd
# config file:
/home/bitcoin/.lightningd/signet/config
# plugin directory:
/home/bitcoin/scl-plugins-enabled
```
## Backups
2023-03-07 21:07:47 +01:00
* < https: // lightning . readthedocs . io / FAQ . html # how-to-backup-my-wallet > >
2022-08-13 09:44:01 +02:00
* General details: < https: // lightning . readthedocs . io / BACKUP . html >
2021-10-17 21:08:32 +02:00
2022-07-21 16:49:40 +02:00
### Backup strategy
2022-08-13 09:44:01 +02:00
* discussed in < https: // github . com / rootzoll / raspiblitz / issues / 2983 >
2022-07-21 16:49:40 +02:00
* store your seed (or the `hsm_secret` HEX) as text.
* the channel database (`lightningd.sqlite3`) is replicated to the SDcard real-time.
* can make a cl-rescue file from time-to-time so you have a backup of the onchain wallet (`hsm_secret` - generated from the seed) and the channel database (`lightningd.sqlite3` - can be restored as a last resort - will trigger force closes with the peers).
* A future CLN version will have an SCB like functionality, but will be stored automatically with the peers (encrypted over LN), see the PR: [ElementsProject/lightning#5361 ](https://github.com/ElementsProject/lightning/pull/5361 )
2021-10-01 10:23:45 +02:00
### Seed
2021-10-17 21:08:32 +02:00
* By default a BIP39 wordlist compatible, 24 words seed is used to generate the `hsm_secret`
2022-02-10 22:08:46 +01:00
* If the wallet was generated or restored from seed on a RaspiBlitz the seed is stored in the disk with the option to encrypt
2021-10-17 21:08:32 +02:00
* Display the seed from the menu - `CL` - `SEED`
* The file where the seed is stored (until encrypted) is on the disk: `/home/bitcoin/.lightning/bitcoin/seedwords.info`
2022-02-10 22:08:46 +01:00
* Show manually with:
2021-10-17 21:08:32 +02:00
`sudo cat /home/bitcoin/.lightning/bitcoin/seedwords.info`
2022-06-08 22:33:38 +02:00
* If there is no such file and you have not funded the CLN wallet yet can reset the wallet and the next wallet will be created with a seed.
2022-01-17 14:34:40 +01:00
2021-10-11 15:49:06 +02:00
### How to display the hsm_secret in a human-readable format?
2023-04-03 12:56:33 +02:00
* If there is no seed available it is best to save the hsm_secret as a file with `scp` or note down the alphanumeric characters in the two line displayed with:
2022-01-17 14:34:40 +01:00
```
sudo xxd /home/bitcoin/.lightning/bitcoin/hsm_secret
```
### How to test the seedwords?
* The manual process:
2021-10-11 15:49:06 +02:00
```
2022-01-17 14:34:40 +01:00
# display the hsm_secret in hex:
sudo -u bitcoin xxd /home/bitcoin/.lightning/bitcoin/hsm_secret
# input seed and generate an hsm_secret in a temporary location:
lightning-hsmtool generatehsm /dev/shm/test_hsm_secret
# compare
xxd /dev/shm/test_hsm_secret
# delete temp file
srm /dev/shm/test_hsm_secret
```
### How to restore the hsm_secret from text?
* example from https://lightning.readthedocs.io/BACKUP.html#backing-up-your-c-lightning-node:
```
cat > hsm_secret_hex.txt < < HEX
00: 30cc f221 94e1 7f01 cd54 d68c a1ba f124
10: e1f3 1d45 d904 823c 77b7 1e18 fd93 1676
HEX
xxd -r hsm_secret_hex.txt > hsm_secret
# move in place (will overwrite! - remove the ##)
## sudo mv /home/bitcoin/.lightning/bitcoin/hsm_secret
# fix the owner and tighten permissions
sudo chown bitcoin:bitcoin /home/bitcoin/.lightning/bitcoin/hsm_secret
chmod 0400 /home/bitcoin/.lightning/bitcoin/hsm_secret
2021-10-11 15:49:06 +02:00
```
2021-11-30 12:58:06 +01:00
2021-10-01 10:23:45 +02:00
### Channel database
2021-11-30 12:58:06 +01:00
* Stored on the disk and synchronised to the SDcard with the help of the `backup` plugin.
2021-10-01 10:23:45 +02:00
2023-03-07 21:07:47 +01:00
## Recovery
2021-10-01 10:23:45 +02:00
* https://lightning.readthedocs.io/FAQ.html#database-corruption-channel-state-lost
* https://lightning.readthedocs.io/FAQ.html#loss
2023-03-07 21:07:47 +01:00
### Recover from a cl-rescue file
2021-10-12 02:26:20 +02:00
* use the `REPAIR-CL` - `FILERESTORE` option in the menu for instructions to upload
2021-11-30 12:58:06 +01:00
2023-03-07 21:07:47 +01:00
### Recover from a seed
2021-10-12 02:26:20 +02:00
* use the `REPAIR-CL` - `SEEDRESTORE` option in the menu for instructions to paste the seedwords to restore
2023-03-07 21:07:47 +01:00
* or use the manual commands
```
# stop CLN
sudo systemctl stop lightningd
2021-11-30 12:58:06 +01:00
2023-03-07 21:07:47 +01:00
# change to the bitcoin user
sudo su - bitcoin
# generate the hsm_secret in temporary directory from your CLN seed words (follow the instructions)
lightning-hsmtool generatehsm /dev/shm/hsm_secret
# backup your old hsm_secret and channel database
mkdir /home/bitcoin/.lightning/bitcoin/old_node
mv /home/bitcoin/.lightning/bitcoin/** /home/bitcoin/.lightning/bitcoin/old_node/
# move the new hsm_secret in place
mv /dev/shm/hsm_secret /home/bitcoin/.lightning/bitcoin/
# back to admin
exit
# start lightningd
sudo systemctl start lightningd
# show the logs
cllog
```
### Emergency recovery in case of lost channel states
* blogpost: < https: // blog . blockstream . com / core-lightning-v0-12-0 />
* demo video: https://youtu.be/zBmEieZuS8Q
* manpage: < https: // lightning . readthedocs . io / lightning-emergencyrecover . 7 . html >
```
lightning-cli help emergencyrecover
```
1. [Restore the hsm_secret (onchain wallet keys) from seed ](#recover-from-a-seed ) (or hex).
* There is no need to wait for the (few hours) rescan to finish, but can follow it any time with:
```
cllog
```
1. Upload and copy the emergency.recover file in place
* upload the file with scp:
```
scp hsm_secret emergency.recover admin@RASPIBLITZ_IP:~/
```
* copy it from `/home/admin/` :
```
sudo cp /home/admin/emergency.recover /home/bitcoin/.lightning/bitcoin/
sudo chown bitcoin:bitcoin /home/bitcoin/.lightning/bitcoin/emergency.recover
```
1. Recover
2022-07-21 16:49:40 +02:00
2023-03-07 21:07:47 +01:00
* run (as admin or bitcoin user):
```
lightning-cli emergencyrecover
```
* a list of channelID-s should be returned if it worked:
```
{
"stubs": [
"................",
]
}
```
1. See more data about the recovered funds and channels
```
lightning-cli listfunds
lightning-cli listpeers
```
* List the funding txid-s:
```
lightning-cli listfunds | jq -r '.channels[] | .funding_txid'
```
Can check the txid-s in a mempool explorer. If one is spent that channel is already closed.
### Restore a CLN node from the database backup on the SDcard
* https://gist.github.com/openoms/3516cd8f393d69d52f858c3d47c9e469
2022-01-25 12:07:11 +01:00
2023-03-07 21:07:47 +01:00
### Rescan the chain after restoring a used CLN wallet
* automatically done when using `SEEDRESTORE`
* controlled by the entry in the cln config file
2022-01-25 12:07:11 +01:00
* can use the `menu` -> `REPAIR` -> `REPAIR-CL` -> `RESCAN` option
2022-02-10 22:08:46 +01:00
* or follow the manual process:
2022-01-25 12:07:11 +01:00
< https: / / lightning . readthedocs . io / FAQ . html # rescanning-the-block-chain-for-lost-utxos >
2022-02-10 22:08:46 +01:00
```
2022-01-25 12:07:11 +01:00
# stop `lightningd` :
2021-10-12 02:26:20 +02:00
sudo systemctl stop lightningd
2022-01-25 12:07:11 +01:00
# the ungraceful method:
2021-12-18 03:34:24 +01:00
sudo killall ligthningd
2022-02-10 22:08:46 +01:00
2022-01-25 12:07:11 +01:00
# Rescan from the block 700000
2021-12-18 03:34:24 +01:00
sudo -u bitcoin lightningd --rescan -700000 --log-level debug
2022-01-25 12:07:11 +01:00
# Rescan the last 1000 blocks:
2021-12-18 03:34:24 +01:00
sudo -u bitcoin lightningd --rescan 1000 --log-level debug
```
* can monitor in a new window using the shortcut:
```
cllog
2021-10-12 02:26:20 +02:00
```
2021-10-01 10:23:45 +02:00
2023-03-07 21:07:47 +01:00
### Guesstoremote to recover funds from force-closed channels
2022-01-25 12:07:11 +01:00
* < https: // lightning . readthedocs . io / lightning-hsmtool . 8 . html >
```
$ man lightning-hsmtool
guesstoremote p2wpkh node_id max_channel_dbid hsm_secret [password]
Brute-force the private key to our funds from a remote unilateral close of a channel, in a case where we have lost all database data except for our hsm_secret. The peer must be the one to close the channel (and the funds will remain unrecoverable until the channel is closed). max_channel_dbid is your own guess on what the channel_dbid was, or at least the maximum possible value, and is usually no greater than the number of channels that the node has ever had. Specify password if the hsm_secret is encrypted.
```
* Usage on the RaspiBlitz (example for mainnet):
```
sudo -u bitcoin lightning-hsmtool guesstoremote p2wpkh-ADDRESS-bc1... PEER_NODE_ID 5000 /home/bitcoin/.lightning/bitcoin/hsm_secret
```
* The `p2wpkh-ADDRESS-bc1...` must a be a non-timelocked output. Shows with `OP_PUSHBYTES_20` in block explorers.
* The `max_channel_dbid` = 5000 is usually plenty, can set any higher number
* If the `hsm_secret` is encrypted give the password on the end
* Output if unsuccessful (the private key is not known):
```
2023-07-28 23:06:05 +02:00
Could not find any basepoint matching the provided witness programme.
2022-01-25 12:07:11 +01:00
Are you sure that the channel used `option_static_remotekey` ?
** * stack smashing detected ** *: terminated
Aborted
```
* Output if successful:
```
bech32 : bc1q......................................
pubkey hash : 0123456789abcdef0123456789abcdef01234567
2022-02-10 22:08:46 +01:00
pubkey : 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef01
privkey : 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
2022-01-25 12:07:11 +01:00
```
* To import the private key of the address in Electrum Wallet will need to convert to base58
```
git clone https://github.com/matja/bitcoin-tool
cd bitcoin-tool
make test
./bitcoin-tool \
--network bitcoin \
--input-type private-key \
--input-format hex \
--input PASTE_THE_privkey_HERE \
--output-type private-key-wif \
--output-format base58check \
--public-key-compression compressed
```
* Example output:
```
KwFvTne98E1t3mTNAr8pKx67eUzFJWdSNPqPSfxMEtrueW7PcQzL
```
2023-07-28 23:06:05 +02:00
* To import to the Electrum Wallet use the `p2wpkh:` prefix:
2022-01-25 12:07:11 +01:00
< https: / / bitcoinelectrum . com / importing-your-private-keys-into-electrum / >
```
p2wpkh:KxacygL6usxP8T9cFSM2SRW5QsEg66bUQUEn997UWwCZANEe7NLT
```
2022-02-19 23:41:48 +01:00
## sqlite3 queries
* Query the reasons for force closes
```
sudo -u bitcoin sqlite3 /home/bitcoin/.lightning/bitcoin/lightningd.sqlite3 'select short_channel_id, timestamp, cause, message from channel_state_changes inner join channels on channel_id = id where new_state = 7 order by timestamp'
```
* Query the reasons for cooperative channel closes
```
sudo -u bitcoin sqlite3 /home/bitcoin/.lightning/bitcoin/lightningd.sqlite3 'select short_channel_id, timestamp, cause, message from channel_state_changes inner join channels on channel_id = id where new_state = 4 order by timestamp'
```
2022-01-25 12:07:11 +01:00
2022-08-13 09:44:01 +02:00
## Extract the private and public key from the hsm_secret file
< https: / / gist . github . com / openoms / 0844cf2db807b85fbcffacf1a3fb53bd # file-readme-md >
2021-10-17 10:52:57 +02:00
## Update
2022-06-08 22:33:38 +02:00
### Update to a new CLN release
* See the tagged releases by the CLN team: [github.com/ElementsProject/lightning/releases ](https://github.com/ElementsProject/lightning/releases )
2021-10-17 10:52:57 +02:00
* Will be able to update to new releases from the menu - `UPDATE` - `CL`
* Since downgrading the lightning database is not allowed the updated version will persist if the SDcard is reflashed.
2021-10-01 10:23:45 +02:00
2021-10-17 10:52:57 +02:00
### Experimental update to the latest master
2022-02-10 22:08:46 +01:00
* this won't persist in case the SDcard is reflashed so will need to manually update again.
2023-07-28 23:06:05 +02:00
* the command to use the built-in script to update to the last commit in the default branch is:
2021-10-17 10:52:57 +02:00
```
config.scripts/cl.install.sh update
```
* if the database version is not compatible with the default version after a downgrade there will be an error message in `sudo journalctl -u lightningd` similar to:
```
Refusing to migrate down from version 178 to 176
```
* in this case update to the next release from the menu or the latest master again with:
```
config.scripts/cl.install.sh update
```
2021-11-30 12:43:52 +01:00
## sqlite3 queries
* Query the reasons for force closes
```
sudo -u bitcoin sqlite3 /home/bitcoin/.lightning/bitcoin/lightningd.sqlite3 'select short_channel_id, timestamp, cause, message from channel_state_changes inner join channels on channel_id = id where new_state = 7 order by timestamp'
```
* Query the reasons for cooperative channel closes
```
sudo -u bitcoin sqlite3 /home/bitcoin/.lightning/bitcoin/lightningd.sqlite3 'select short_channel_id, timestamp, cause, message from channel_state_changes inner join channels on channel_id = id where new_state = 4 order by timestamp'
```
2021-10-17 10:52:57 +02:00
## Script file help list
2021-10-12 02:26:20 +02:00
* generate a list of the help texts on a RaspiBlitz:
```
cd /home/admin/config.scripts/
ls cl*.sh > clScriptList.txt
sed -i 's#^#./#g' clScriptList.txt
sed -i 's#.sh#.sh -h#g' clScriptList.txt
bash -x clScriptList.txt
rm clScriptList.txt
```
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
```
+ ./cl.backup.sh -h
---------------------------------------------------
CL RESCUE FILE (tar.gz of complete cl directory)
---------------------------------------------------
cl.backup.sh cl-export
cl.backup.sh cl-export-gui
cl.backup.sh cl-import [file]
cl.backup.sh cl-import-gui [setup|production] [?resultfile]
---------------------------------------------------
SEED WORDS
---------------------------------------------------
cl.backup.sh seed-export-gui [clseeddata]
cl.backup.sh seed-import-gui [resultfile]
---------------------------------------------------
RECOVERY
---------------------------------------------------
cl.backup.sh [mainnet|signet|testnet] recoverymode [on|off|status] < -rescanbockheight | rescandepth >
+ ./cl.check.sh -h
# script to check CL states
# cl.check.sh basic-setup
# cl.check.sh prestart [mainnet|testnet|signet]
+ ./cl.hsmtool.sh -h
Create new wallet or import seed
Unlock/lock, encrypt, decrypt, set autounlock or change password for the hsm_secret
2021-10-12 02:26:20 +02:00
2022-07-21 16:49:40 +02:00
Usage:
Create new wallet:
cl.hsmtool.sh [new] [mainnet|testnet|signet] [?seedpassword]
cl.hsmtool.sh [new-force] [mainnet|testnet|signet] [?seedpassword]
There will be no seedpassword(passphrase) used by default
new-force will backup the old wallet and will work without interaction
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
cl.hsmtool.sh [seed] [mainnet|testnet|signet] ["space-separated-seed-words"] [?seedpassword]
cl.hsmtool.sh [seed-force] [mainnet|testnet|signet] ["space-separated-seed-words"] [?seedpassword]
The new hsm_secret will be not encrypted if no NewPassword is given
seed-force will delete any old wallet and will work without dialog
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
cl.hsmtool.sh [unlock] < mainnet | testnet | signet > < password >
2023-03-07 21:07:47 +01:00
success: exit 0
wrong password: exit 2
fail to unlock after 1 minute + show logs: exit 3
2022-07-21 16:49:40 +02:00
cl.hsmtool.sh [lock] < mainnet | testnet | signet >
cl.hsmtool.sh [encrypt|decrypt] < mainnet | testnet | signet >
cl.hsmtool.sh [autounlock-on|autounlock-off] < mainnet | testnet | signet >
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
cl.hsmtool.sh [change-password] < mainnet | testnet | signet > < NewPassword >
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl.install-service.sh -h
2021-10-01 10:23:45 +02:00
2022-07-27 08:37:36 +02:00
Script to set up or update the Core Lightning systemd service
2022-07-21 16:49:40 +02:00
Usage:
/home/admin/config.scripts/cl.install-service.sh < mainnet | testnet | signet >
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl.install.sh -h
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
Core Lightning install script
2023-03-07 21:07:47 +01:00
The default version is: v22.11.1
2022-07-21 16:49:40 +02:00
mainnet / testnet / signet instances can run parallel
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
Usage:
cl.install.sh install - called by build_sdcard.sh
cl.install.sh on < mainnet | testnet | signet >
cl.install.sh off < mainnet | testnet | signet > < purge >
cl.install.sh [update < version > |testPR < PRnumber > ]
cl.install.sh display-seed < mainnet | testnet | signet >
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl.monitor.sh -h
monitor and troubleshot the c-lightning network
cl.monitor.sh [mainnet|testnet|signet] status
cl.monitor.sh [mainnet|testnet|signet] config
cl.monitor.sh [mainnet|testnet|signet] info
cl.monitor.sh [mainnet|testnet|signet] wallet
+ ./cl-plugin.backup.sh -h
2021-10-01 10:23:45 +02:00
2022-07-27 08:37:36 +02:00
Install the backup plugin for Core Lightning
2022-07-21 16:49:40 +02:00
Replicates the lightningd.sqlite3 database on the SDcard
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
Usage:
cl-plugin.backup.sh [on|off] [testnet|mainnet|signet]
cl-plugin.backup.sh [restore] [testnet|mainnet|signet] [force]
cl-plugin.backup.sh [backup-compact] [testnet|mainnet|signet]
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
https://github.com/lightningd/plugins/tree/master/backup
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl-plugin.clboss.sh -h
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
Install or remove the CLBOSS Core Lightning plugin
version: v0.13A
Usage:
cl-plugin.clboss.sh [on|off] [testnet|mainnet|signet]
cl-plugin.clboss.sh [info]
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl-plugin.cln-grpc.sh -h
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
Install the cln-grpc plugin for CLN
Usage:
cl-plugin.cln-grpc.sh install - called by build_sdcard.sh
cl-plugin.cln-grpc.sh on < testnet | mainnet | signet >
cl-plugin.cln-grpc.sh off < testnet | mainnet | signet > < purge >
cl-plugin.cln-grpc.sh status < testnet | mainnet | signet >
cl-plugin.cln-grpc.sh update < source >
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl-plugin.feeadjuster.sh -h
2021-10-12 02:26:20 +02:00
2022-07-27 08:37:36 +02:00
Install the feeadjuster plugin for Core Lightning
2022-07-21 16:49:40 +02:00
Usage:
cl-plugin.feeadjuster.sh [on|off] < testnet | mainnet | signet >
2021-10-12 02:26:20 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl-plugin.http.sh -h
2021-10-12 02:26:20 +02:00
2022-07-21 16:49:40 +02:00
Install, remove, connect the c-lightning-http-plugin
version: 1dbb6537e0ec5fb9b8edde10db6b4cc613ccdb19
Implemented for mainnet only.
Usage:
cl-plugin.http.sh [on|off|connect] < norestart >
2021-10-12 02:26:20 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl-plugin.sparko.sh -h
2021-10-01 10:23:45 +02:00
2022-07-27 08:37:36 +02:00
Install, remove, connect or get info about the Sparko plugin for Core Lightning
2022-07-21 16:49:40 +02:00
version: v2.8
Usage:
cl-plugin.sparko.sh [on|off|menu|connect] [testnet|mainnet|signet] [norestart]
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl-plugin.standard-python.sh -h
2021-10-01 10:23:45 +02:00
2022-07-27 08:37:36 +02:00
Install and show the output of the chosen plugin for Core Lightning
2022-07-21 16:49:40 +02:00
Usage:
cl-plugin.standard-python.sh on [plugin-name] < testnet | mainnet | signet > < persist | runonce >
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
tested plugins:
summary | helpme | feeadjuster | paytest
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
find more at:
https://github.com/lightningd/plugins
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl-plugin.summary.sh -h
2021-10-01 10:23:45 +02:00
2023-03-07 21:07:47 +01:00
Install and show the output if the summary plugin forCore Lightning
2022-07-21 16:49:40 +02:00
Usage:
cl-plugin.summary.sh [testnet|mainnet|signet] [runonce]
2021-10-01 10:23:45 +02:00
2023-03-07 21:07:47 +01:00
+ ./cl-plugin.watchtower-client.sh -h
Install the rust-teos watchtower-client plugin for CLN
Usage:
cl-plugin.watchtower-client.sh on < testnet | mainnet | signet >
cl-plugin.watchtower-client.sh off < testnet | mainnet | signet > < purge >
cl-plugin.watchtower-client.sh info
2022-07-21 16:49:40 +02:00
+ ./cl.rest.sh -h
2021-10-01 10:23:45 +02:00
2023-03-07 21:07:47 +01:00
Core-Lightning-REST install script
The default version is: v0.9.0
2022-07-21 16:49:40 +02:00
mainnet | testnet | signet instances can run parallel
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
Usage:
cl.rest.sh [on|off|connect] < mainnet | testnet | signet > [?key-value]
2021-10-01 10:23:45 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl.setname.sh -h
2021-10-01 10:23:45 +02:00
2022-07-27 08:37:36 +02:00
Config script to set the alias of the Core Lightning node
2022-07-21 16:49:40 +02:00
cl.setname.sh [mainnet|testnet|signet] [?newName]
2021-10-12 02:26:20 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl.spark.sh -h
2021-10-12 02:26:20 +02:00
2022-07-27 08:37:36 +02:00
Install, remove or get info about the Spark Wallet for Core Lightning
2022-07-21 16:49:40 +02:00
version: v0.3.1
Usage:
2023-03-07 21:07:47 +01:00
cl.spark.sh [on|off|menu] < testnet | mainnet | signet >
2021-10-12 02:26:20 +02:00
2022-07-21 16:49:40 +02:00
+ ./cl.update.sh -h
2021-10-12 02:26:20 +02:00
2022-07-27 08:37:36 +02:00
Interim optional Core Lightning updates between RaspiBlitz releases.
2022-07-21 16:49:40 +02:00
cl.update.sh [info|verified|reckless]
info -> get actual state and possible actions
verified -> only do recommended updates by RaspiBlitz team
2023-03-07 21:07:47 +01:00
binary will be checked by signature and checksum
2022-07-21 16:49:40 +02:00
reckless -> if you just want to update to the latest release
2023-03-07 21:07:47 +01:00
published on Core Lightning GitHub releases (RC or final) without any
testing or security checks.
2022-07-21 16:49:40 +02:00
```
2021-10-12 02:26:20 +02:00
2022-07-21 16:49:40 +02:00
## All possible config options
* can be shown by running:
`lightningd --help`
2023-07-28 23:06:05 +02:00
* To persist the settings place the options in the config file without the `--` and restart lightningd
2022-07-21 16:49:40 +02:00
```
Usage: lightningd
A bitcoin lightning daemon (default values shown for network: bitcoin).
--conf=< file > Specify configuration file
--lightning-dir=< dir > Set base directory: network-specific subdirectory is under here (default: "/home/admin/.lightning")
--network < arg > Select the network parameters (bitcoin, testnet, signet, regtest, litecoin or litecoin-testnet) (default: bitcoin)
--mainnet Alias for --network=bitcoin
--testnet Alias for --network=testnet
--signet Alias for --network=signet
--allow-deprecated-apis < arg > Enable deprecated options, JSONRPC commands, fields, etc. (default: true)
--rpc-file < arg > Set JSON-RPC socket (or /dev/tty) (default: "lightning-rpc")
--plugin < arg > Add a plugin to be run (can be used multiple times)
--plugin-dir < arg > Add a directory to load plugins from (can be used multiple times)
--clear-plugins Remove all plugins added before this option
--disable-plugin < arg > Disable a particular plugin by filename/name
--important-plugin < arg > Add an important plugin to be run (can be used multiple times). Die if the plugin dies.
--always-use-proxy < arg > Use the proxy always (default: false)
--daemon Run in the background, suppress stdout/stderr
--wallet < arg > Location of the wallet database.
--large-channels|--wumbo Allow channels larger than 0.16777215 BTC
--experimental-dual-fund experimental: Advertise dual-funding and allow peers to establish channels via v2 channel open protocol.
2023-03-07 21:07:47 +01:00
--experimental-onion-messages EXPERIMENTAL: enable send, receive and relay of onion messages and blinded payments
2022-07-21 16:49:40 +02:00
--experimental-offers EXPERIMENTAL: enable send and receive of offers (also sets experimental-onion-messages)
--experimental-shutdown-wrong-funding EXPERIMENTAL: allow shutdown with alternate txids
2023-03-07 21:07:47 +01:00
--announce-addr-dns < arg > Use DNS entries in --announce-addr and --addr (not widely supported!) (default: false)
2022-07-21 16:49:40 +02:00
--help|-h Print this message.
--rgb < arg > RRGGBB hex color for node
--alias < arg > Up to 32-byte alias for node
--pid-file=< file > Specify pid file (default: "/home/admin/.lightning/lightningd-bitcoin.pid")
--ignore-fee-limits < arg > (DANGEROUS) allow peer to set any feerate (default: false)
--watchtime-blocks < arg > Blocks before peer can unilaterally spend funds (default: 144)
--max-locktime-blocks < arg > Maximum blocks funds may be locked for (default: 2016)
--funding-confirms < arg > Confirmations required for funding transaction (default: 3)
--cltv-delta < arg > Number of blocks for cltv_expiry_delta (default: 34)
--cltv-final < arg > Number of blocks for final cltv_expiry (default: 18)
2023-07-28 23:06:05 +02:00
--commit-time=< milliseconds > Time after changes before sending out COMMIT (default: 10)
2022-07-21 16:49:40 +02:00
--fee-base < arg > Millisatoshi minimum to charge for HTLC (default: 1000)
--rescan < arg > Number of blocks to rescan from the current head, or absolute blockheight if negative (default: 15)
--fee-per-satoshi < arg > Microsatoshi fee for every satoshi in HTLC (default: 10)
--htlc-minimum-msat < arg > The default minimal value an HTLC must carry in order to be forwardable for new channels
--htlc-maximum-msat < arg > The default maximal value an HTLC must carry in order to be forwardable for new channel
--max-concurrent-htlcs < arg > Number of HTLCs one channel can handle concurrently. Should be between 1 and 483 (default: 30)
--max-dust-htlc-exposure-msat < arg > Max HTLC amount that can be trimmed
--min-capacity-sat < arg > Minimum capacity in satoshis for accepting channels (default: 10000)
--addr < arg > Set an IP address (v4 or v6) to listen on and announce to the network for incoming connections
--bind-addr < arg > Set an IP address (v4 or v6) to listen on, but not announce
--announce-addr < arg > Set an IP address (v4 or v6) or .onion v3 to announce, but not listen on
--disable-ip-discovery Turn off announcement of discovered public IPs
--offline Start in offline-mode (do not automatically reconnect and do not accept incoming connections)
--autolisten < arg > If true, listen on default port and announce if it seems to be a public interface (default: true)
2023-03-07 21:07:47 +01:00
--dev-allowdustreserve < arg > If true, we allow the `fundchannel` RPC command and the `openchannel` plugin hook to set a reserve that is below the dust limit.
(default: false)
2022-07-21 16:49:40 +02:00
--proxy < arg > Set a socks v5 proxy IP address and port
--tor-service-password < arg > Set a Tor hidden service password
2023-03-07 21:07:47 +01:00
--accept-htlc-tlv-types < arg > Comma separated list of extra HTLC TLV types to accept.
2022-07-21 16:49:40 +02:00
--disable-dns Disable DNS lookups of peers
--encrypted-hsm Set the password to encrypt hsm_secret with. If no password is passed through command line, you will be prompted to enter it.
--rpc-file-mode < arg > Set the file mode (permissions) for the JSON-RPC socket (default: "0600")
2023-03-07 21:07:47 +01:00
--force-feerates < arg > Set testnet/regtest feerates in sats perkw, opening/mutual_close/unlateral_close/delayed_to_us/htlc_resolution/penalty: if fewer
specified, last number applies to remainder
--subdaemon < arg > Arg specified as SUBDAEMON:PATH. Specifies an alternate subdaemon binary. If the supplied path is relative the subdaemon binary is
found in the working directory. This option may be specified multiple times. For example, --subdaemon=hsmd:remote_signer would use
a hypothetical remote signing subdaemon.
2022-07-21 16:49:40 +02:00
--experimental-websocket-port < arg > experimental: alternate port for peers to connect using WebSockets (RFC6455)
2023-03-07 21:07:47 +01:00
--database-upgrade < arg > Set to true to allow database upgrades even on non-final releases (WARNING: you won't be able to downgrade!)
2022-07-21 16:49:40 +02:00
--log-level < arg > log level (io, debug, info, unusual, broken) [:prefix] (default: info)
--log-timestamps < arg > prefix log messages with timestamp (default: true)
2023-03-07 21:07:47 +01:00
--log-prefix < arg > log prefix (default: )
--log-file=< file > Also log to file (- for stdout)
2022-07-21 16:49:40 +02:00
--version|-V Print version and exit
2023-03-07 21:07:47 +01:00
--fetchinvoice-noconnect Don't try to connect directly to fetch an invoice.
2022-07-21 16:49:40 +02:00
--autocleaninvoice-cycle < arg > Perform cleanup of expired invoices every given seconds, or do not autoclean if 0
--autocleaninvoice-expired-by < arg > If expired invoice autoclean enabled, invoices that have expired for at least this given seconds are cleaned
2023-03-07 21:07:47 +01:00
--autoclean-cycle < arg > Perform cleanup every given seconds
--autoclean-succeededforwards-age < arg > How old do successful forwards have to be before deletion (0 = never)
--autoclean-failedforwards-age < arg > How old do failed forwards have to be before deletion (0 = never)
--autoclean-succeededpays-age < arg > How old do successful pays have to be before deletion (0 = never)
--autoclean-failedpays-age < arg > How old do failed pays have to be before deletion (0 = never)
--autoclean-paidinvoices-age < arg > How old do paid invoices have to be before deletion (0 = never)
--autoclean-expiredinvoices-age < arg > How old do expired invoices have to be before deletion (0 = never)
2022-07-21 16:49:40 +02:00
--bitcoin-datadir < arg > -datadir arg for bitcoin-cli
--bitcoin-cli < arg > bitcoin-cli pathname
--bitcoin-rpcuser < arg > bitcoind RPC username
--bitcoin-rpcpassword < arg > bitcoind RPC password
--bitcoin-rpcconnect < arg > bitcoind RPC host to connect to
--bitcoin-rpcport < arg > bitcoind RPC host's port
--bitcoin-retry-timeout < arg > how long to keep retrying to contact bitcoind before fatally exiting
--commit-fee < arg > Percentage of fee to request for their commitment
2023-03-07 21:07:47 +01:00
--disable-mpp Disable multi-part payments.
2022-07-21 16:49:40 +02:00
--funder-policy < arg > Policy to use for dual-funding requests. [match, available, fixed]
--funder-policy-mod < arg > Percent to apply policy at (match/available); or amount to fund (fixed)
--funder-min-their-funding < arg > Minimum funding peer must open with to activate our policy
--funder-max-their-funding < arg > Maximum funding peer may open with to activate our policy
--funder-per-channel-min < arg > Minimum funding we'll add to a channel. If we can't meet this, we don't fund
--funder-per-channel-max < arg > Maximum funding we'll add to a channel. We cap all contributions to this
--funder-reserve-tank < arg > Amount of funds we'll always leave available.
--funder-fuzz-percent < arg > Percent to fuzz the policy contribution by. Defaults to 0%. Max is 100%
--funder-fund-probability < arg > Percent of requests to consider. Defaults to 100%. Setting to 0% will disable dual-funding
--funder-lease-requests-only < arg > Only fund lease requests. Defaults to true if channel lease rates are being advertised
--lease-fee-base-sat < arg > Channel lease rates, base fee for leased funds, in satoshi.
--lease-fee-base-msat < arg > Channel lease rates, base fee for leased funds, in satoshi.
--lease-fee-basis < arg > Channel lease rates, basis charged for leased funds (per 10,000 satoshi.)
--lease-funding-weight < arg > Channel lease rates, weight we'll ask opening peer to pay for in funding transaction
--channel-fee-max-base-msat < arg > Channel lease rates, maximum channel fee base we'll charge for funds routed through a leased channel.
2023-03-07 21:07:47 +01:00
--channel-fee-max-proportional-thousandths < arg > Channel lease rates, maximum proportional fee (in thousandths, or ppt) we'll charge for funds routed through a leased channel.
Note: 1ppt = 1,000ppm
--bookkeeper-dir < arg > Location for bookkeeper records.
--bookkeeper-db < arg > Location of the bookkeeper database
2022-07-21 16:49:40 +02:00
```