Skip to content

Commit

Permalink
doc: Give an example of the supported DSN formats
Browse files Browse the repository at this point in the history
I was told that DSNs are not trivial to format, so this adds an example to
help setup the postgres wallet backend.
  • Loading branch information
cdecker committed Apr 10, 2020
1 parent d249e1a commit 17686ae
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
26 changes: 25 additions & 1 deletion doc/lightningd-config.5
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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\.
Expand Down
17 changes: 17 additions & 0 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 17686ae

Please sign in to comment.