From f00e9d6ea88909aa4ae48560db76ac99ba7d4206 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 6 Apr 2020 16:01:11 +0200 Subject: [PATCH] doc: Give an example of the supported DSN formats I was told that DSNs are not trivial to format, so this adds an example to help setup the postgres wallet backend. --- doc/lightningd-config.5 | 26 +++++++++++++++++++++++++- doc/lightningd-config.5.md | 17 +++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/doc/lightningd-config.5 b/doc/lightningd-config.5 index 16e1e84df..0bfaa18f5 100644 --- a/doc/lightningd-config.5 +++ b/doc/lightningd-config.5 @@ -227,6 +227,30 @@ name, including a scheme such as \fBsqlite3\fR or \fBpostgres\fR followed by the connection parameters\. +The default wallet corresponds to the following DSN: + +.nf +.RS +--wallet=sqlite3://$HOME/.lightning/bitcoin/lightningd.sqlite3 +.RE + +.fi + +The following is an example of a postgresql wallet DSN: + +.nf +.RS +--wallet=postgres://user:pass@localhost:5432/db_name +.RE + +.fi + +This will connect to a the DB server running on \fBlocalhost\fR port \fB5432\fR, +authenticate with username \fBuser\fR and password \fBpass\fR, and then use the +database \fBdb_name\fR\. The database must exist, but the schema will be managed +automatically by \fBlightningd\fR\. + + \fBencrypted-hsm\fR If set, you will be prompted to enter a password used to encrypt the \fBhsm_secret\fR\. Note that once you encrypt the \fBhsm_secret\fR this option will be mandatory for @@ -283,7 +307,7 @@ extremely busy node for you to even notice\. \fBlarge-channels\fR Removes capacity limits for channel creation\. Version 1\.0 of the specification -limited channel sizes to 16777216 satoshi\. With this option (which your +limited channel sizes to 16777215 satoshi\. With this option (which your node will advertize to peers), your node will accept larger incoming channels and if the peer supports it, will open larger channels\. Note: this option is spelled \fBlarge-channels\fR but it's pronounced \fBwumbo\fR\. diff --git a/doc/lightningd-config.5.md b/doc/lightningd-config.5.md index f69893735..9ddb1bb69 100644 --- a/doc/lightningd-config.5.md +++ b/doc/lightningd-config.5.md @@ -182,6 +182,23 @@ Identify the location of the wallet. This is a fully qualified data source name, including a scheme such as `sqlite3` or `postgres` followed by the connection parameters. +The default wallet corresponds to the following DSN: + +``` +--wallet=sqlite3://$HOME/.lightning/bitcoin/lightningd.sqlite3 +``` + +The following is an example of a postgresql wallet DSN: + +``` +--wallet=postgres://user:pass@localhost:5432/db_name +``` + +This will connect to a the DB server running on `localhost` port `5432`, +authenticate with username `user` and password `pass`, and then use the +database `db_name`. The database must exist, but the schema will be managed +automatically by `lightningd`. + **encrypted-hsm** If set, you will be prompted to enter a password used to encrypt the `hsm_secret`. Note that once you encrypt the `hsm_secret` this option will be mandatory for