2020-12-27 01:10:02 +01:00
|
|
|
## chantools compactdb
|
|
|
|
|
|
|
|
|
|
Create a copy of a channel.db file in safe/read-only mode
|
|
|
|
|
|
2020-12-27 01:40:51 +01:00
|
|
|
### Synopsis
|
|
|
|
|
|
|
|
|
|
This command opens a database in read-only mode and tries
|
|
|
|
|
to create a copy of it to a destination file, compacting it in the process.
|
|
|
|
|
|
2020-12-27 01:10:02 +01:00
|
|
|
```
|
|
|
|
|
chantools compactdb [flags]
|
|
|
|
|
```
|
|
|
|
|
|
2020-12-27 01:40:51 +01:00
|
|
|
### Examples
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
chantools compactdb \
|
|
|
|
|
--sourcedb ~/.lnd/data/graph/mainnet/channel.db \
|
|
|
|
|
--destdb ./results/compacted.db
|
|
|
|
|
```
|
|
|
|
|
|
2020-12-27 01:10:02 +01:00
|
|
|
### Options
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
--destdb string new lnd channel.db file to copy the compacted database to
|
|
|
|
|
-h, --help help for compactdb
|
|
|
|
|
--sourcedb string lnd channel.db file to create the database backup from
|
|
|
|
|
--txmaxsize int maximum transaction size (default 65536)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Options inherited from parent commands
|
|
|
|
|
|
|
|
|
|
```
|
2025-10-21 21:27:30 +02:00
|
|
|
--nologfile If set, no log file will be created. This is useful for testing purposes where we don't want to create a log file.
|
|
|
|
|
-r, --regtest Indicates if regtest parameters should be used
|
|
|
|
|
--resultsdir string Directory where results should be stored (default "./results")
|
|
|
|
|
-s, --signet Indicates if the public signet parameters should be used
|
|
|
|
|
-t, --testnet Indicates if testnet parameters should be used
|
2026-03-04 07:01:23 +01:00
|
|
|
--testnet4 Indicates if testnet4 parameters should be used
|
2020-12-27 01:10:02 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### SEE ALSO
|
|
|
|
|
|
|
|
|
|
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
|
|
|
|
|
|