The only time underscores aren't special in Markdown is when they appear
in preformatted text. We have gotten away with not escaping underscores
where an asterisk-enclosed span or the paragraph ends before the next
underscore appears, but this is fragile and bad practice. Conversely,
there are many places where we have not escaped underscores but needed
to.
Escape all underscores that do not appear in preformatted blocks or
preformatted spans and are not themselves delineating emphasized spans.
The changes in this commit are exactly the result of executing the
following Bash code:
```bash
e=':x;' # begin loop
e+='s/^' # anchor match at beginning of line
e+='(' # begin capturing subexpression
e+='(' # begin list of alternatives
e+='[^`_\\]|' # any mundane character, or
e+='`([^`\\]|\\.)*`|' # backtick-enclosed span, or
e+='\b_|_\b|' # underscore at boundary, or
e+='\\.' # backslash-escaped character
e+=')*' # any number of the preceding alternatives
e+=')' # end capturing subexpression
e+='\B_\B/\1\\_/;' # escape non-formatting underscore
e+='tx' # repeat loop if we escaped an underscore
escape_underscores=(
sed
# use extended regular expressions
-E
# skip over indented blocks (following an empty line)
-e '/^$/{:i;n;/^( {4,}|\t)/bi}'
# skip over preformatted blocks
-e '/^\s*```/,/^\s*```/{p;d}'
# skip over generated sections
-e '/GENERATE-FROM-SCHEMA-START/,/GENERATE-FROM-SCHEMA-END/{p;d}'
# escape underscores
-e "${e}"
)
"${escape_underscores[@]}" -i doc/*.[0-9].md
```
Changelog-None
3.2 KiB
lightning-hsmtool -- Tool for working with software HSM secrets of lightningd
SYNOPSIS
lightning-hsmtool method [ARGUMENTS]...
DESCRIPTION
lightning-hsmtool performs various operations on the hsm_secret
file used by the software HSM component of lightningd.
This can be used to encrypt and decrypt the hsm_secret file,
as well as derive secrets used in channel commitments.
METHODS
encrypt hsm_secret password
Encrypt the hsm_secret file so that it can only be decrypted at
lightningd startup.
You must give the option --encrypted-hsm to lightningd.
The password of the hsm_secret file will be asked whenever you
start lightningd.
decrypt hsm_secret password
Decrypt the hsm_secret file that was encrypted with the encrypt
method.
dumpcommitments node_id channel_dbid depth hsm_secret [password]
Show the per-commitment secret and point of up to depth commitments,
of the specified channel with the specified peer,
identified by the channel database index.
Specify password if the hsm_secret is encrypted.
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.
generatehsm hsm_secret_path Generates a new hsm_secret using BIP39.
checkhsm hsm_secret_path Checks that hsm_secret matchs a BIP39 pass phrase.
dumponchaindescriptors hsm_secret [password] [network]
Dump output descriptors for our onchain wallet.
The descriptors can be used by external services to be able to generate
addresses for our onchain wallet. (for example on bitcoind using the
importmulti or importdescriptors RPC calls)
We need the path to the hsm_secret containing the wallet seed, and an optional
(skip using "") password if it was encrypted.
To generate descriptors using testnet master keys, you may specify testnet as
the last parameter. By default, mainnet-encoded keys are generated.
BUGS
You should report bugs on our github issues page, and maybe submit a fix to gain our eternal gratitude!
AUTHOR
ZmnSCPxj <ZmnSCPxj@protonmail.com> wrote the initial version of this man page, but many others did the hard work of actually implementing lightning-hsmtool.
SEE ALSO
lightningd(8), lightningd-config(5)
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
COPYING
Note: the modules in the ccan/ directory have their own licenses, but the rest of the code is covered by the BSD-style MIT license. Main web site: https://github.com/ElementsProject/lightning