Skip to content

Commit caf4da5

Browse files
committed
doc: generate docs with cobra
1 parent 5b8e73f commit caf4da5

23 files changed

+669
-551
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,7 @@ fmt:
8080
lint: $(LINT_BIN)
8181
@$(call print, "Linting source.")
8282
$(LINT)
83+
84+
docs: install
85+
@$(call print, "Rendering docs.")
86+
chantools doc

README.md

Lines changed: 55 additions & 551 deletions
Large diffs are not rendered by default.

cmd/chantools/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ var rootCmd = &cobra.Command{
6464
log.Infof("chantools version v%s commit %s", version,
6565
Commit)
6666
},
67+
DisableAutoGenTag: true,
6768
}
6869

6970
func init() {
@@ -82,6 +83,7 @@ func init() {
8283
newDeriveKeyCommand(),
8384
newDumpBackupCommand(),
8485
newDumpChannelsCommand(),
86+
newDocCommand(),
8587
newFilterBackupCommand(),
8688
newFixOldBackupCommand(),
8789
newForceCloseCommand(),

doc/chantools.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## chantools
2+
3+
Chantools helps recover funds from lightning channels
4+
5+
### Synopsis
6+
7+
This tool provides helper functions that can be used rescue
8+
funds locked in lnd channels in case lnd itself cannot run
9+
properly anymore.
10+
11+
Complete documentation is available at https://github.com/guggero/chantools/.
12+
13+
### Options
14+
15+
```
16+
-h, --help help for chantools
17+
-r, --regtest Indicates if regtest parameters should be used
18+
-t, --testnet Indicates if testnet parameters should be used
19+
```
20+
21+
### SEE ALSO
22+
23+
* [chantools chanbackup](chantools_chanbackup.md) - Create a channel.backup file from a channel database
24+
* [chantools compactdb](chantools_compactdb.md) - Create a copy of a channel.db file in safe/read-only mode
25+
* [chantools derivekey](chantools_derivekey.md) - Derive a key with a specific derivation path
26+
* [chantools dumpbackup](chantools_dumpbackup.md) - Dump the content of a channel.backup file
27+
* [chantools dumpchannels](chantools_dumpchannels.md) - Dump all channel information from an lnd channel database
28+
* [chantools filterbackup](chantools_filterbackup.md) - Filter an lnd channel.backup file and remove certain channels
29+
* [chantools fixoldbackup](chantools_fixoldbackup.md) - Fixes an old channel.backup file that is affected by the lnd issue #3881 (unable to derive shachain root key)
30+
* [chantools forceclose](chantools_forceclose.md) - Force-close the last state that is in the channel.db provided
31+
* [chantools genimportscript](chantools_genimportscript.md) - Generate a script containing the on-chain keys of an lnd wallet that can be imported into other software like bitcoind
32+
* [chantools removechannel](chantools_removechannel.md) - Remove a single channel from the given channel DB
33+
* [chantools rescueclosed](chantools_rescueclosed.md) - Try finding the private keys for funds that are in outputs of remotely force-closed channels
34+
* [chantools rescuefunding](chantools_rescuefunding.md) - Rescue funds locked in a funding multisig output that never resulted in a proper channel; this is the command the initiator of the channel needs to run
35+
* [chantools showrootkey](chantools_showrootkey.md) - Extract and show the BIP32 HD root key from the 24 word lnd aezeed
36+
* [chantools signrescuefunding](chantools_signrescuefunding.md) - Rescue funds locked in a funding multisig output that never resulted in a proper channel; this is the command the remote node (the non-initiator) of the channel needs to run
37+
* [chantools summary](chantools_summary.md) - Compile a summary about the current state of channels
38+
* [chantools sweeptimelock](chantools_sweeptimelock.md) - Sweep the force-closed state after the time lock has expired
39+
* [chantools sweeptimelockmanual](chantools_sweeptimelockmanual.md) - Sweep the force-closed state of a single channel manually if only a channel backup file is available
40+
* [chantools vanitygen](chantools_vanitygen.md) - Generate a seed with a custom lnd node identity public key that starts with the given prefix
41+
* [chantools walletinfo](chantools_walletinfo.md) - Shows info about an lnd wallet.db file and optionally extracts the BIP32 HD root key
42+

doc/chantools_chanbackup.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## chantools chanbackup
2+
3+
Create a channel.backup file from a channel database
4+
5+
```
6+
chantools chanbackup [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag
13+
--channeldb string lnd channel.db file to create the backup from
14+
-h, --help help for chanbackup
15+
--multi_file string lnd channel.backup file to create
16+
--rootkey string BIP32 HD root key of the wallet to use for creating the backup; leave empty to prompt for lnd 24 word aezeed
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-r, --regtest Indicates if regtest parameters should be used
23+
-t, --testnet Indicates if testnet parameters should be used
24+
```
25+
26+
### SEE ALSO
27+
28+
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
29+

doc/chantools_compactdb.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## chantools compactdb
2+
3+
Create a copy of a channel.db file in safe/read-only mode
4+
5+
```
6+
chantools compactdb [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--destdb string new lnd channel.db file to copy the compacted database to
13+
-h, --help help for compactdb
14+
--sourcedb string lnd channel.db file to create the database backup from
15+
--txmaxsize int maximum transaction size (default 65536)
16+
```
17+
18+
### Options inherited from parent commands
19+
20+
```
21+
-r, --regtest Indicates if regtest parameters should be used
22+
-t, --testnet Indicates if testnet parameters should be used
23+
```
24+
25+
### SEE ALSO
26+
27+
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
28+

doc/chantools_derivekey.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## chantools derivekey
2+
3+
Derive a key with a specific derivation path
4+
5+
```
6+
chantools derivekey [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag
13+
-h, --help help for derivekey
14+
--neuter don't output private key(s), only public key(s)
15+
--path string BIP32 derivation path to derive; must start with "m/"
16+
--rootkey string BIP32 HD root key of the wallet to use for decrypting the backup; leave empty to prompt for lnd 24 word aezeed
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-r, --regtest Indicates if regtest parameters should be used
23+
-t, --testnet Indicates if testnet parameters should be used
24+
```
25+
26+
### SEE ALSO
27+
28+
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
29+

doc/chantools_dumpbackup.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## chantools dumpbackup
2+
3+
Dump the content of a channel.backup file
4+
5+
```
6+
chantools dumpbackup [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag
13+
-h, --help help for dumpbackup
14+
--multi_file string lnd channel.backup file to dump
15+
--rootkey string BIP32 HD root key of the wallet to use for decrypting the backup; leave empty to prompt for lnd 24 word aezeed
16+
```
17+
18+
### Options inherited from parent commands
19+
20+
```
21+
-r, --regtest Indicates if regtest parameters should be used
22+
-t, --testnet Indicates if testnet parameters should be used
23+
```
24+
25+
### SEE ALSO
26+
27+
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
28+

doc/chantools_dumpchannels.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## chantools dumpchannels
2+
3+
Dump all channel information from an lnd channel database
4+
5+
```
6+
chantools dumpchannels [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--channeldb string lnd channel.db file to dump channels from
13+
--closed dump closed channels instead of open
14+
-h, --help help for dumpchannels
15+
```
16+
17+
### Options inherited from parent commands
18+
19+
```
20+
-r, --regtest Indicates if regtest parameters should be used
21+
-t, --testnet Indicates if testnet parameters should be used
22+
```
23+
24+
### SEE ALSO
25+
26+
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
27+

doc/chantools_filterbackup.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## chantools filterbackup
2+
3+
Filter an lnd channel.backup file and remove certain channels
4+
5+
```
6+
chantools filterbackup [flags]
7+
```
8+
9+
### Options
10+
11+
```
12+
--bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag
13+
--discard string comma separated list of channel funding outpoints (format <fundingTXID>:<index>) to remove from the backup file
14+
-h, --help help for filterbackup
15+
--multi_file string lnd channel.backup file to filter
16+
--rootkey string BIP32 HD root key of the wallet to use for decrypting the backup; leave empty to prompt for lnd 24 word aezeed
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-r, --regtest Indicates if regtest parameters should be used
23+
-t, --testnet Indicates if testnet parameters should be used
24+
```
25+
26+
### SEE ALSO
27+
28+
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
29+

0 commit comments

Comments
 (0)