Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow authored Sep 22, 2021
1 parent b18b2fb commit 5cc88b0
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/lnd/postgres.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Postgres support in LND

With the introduction of the `kvdb` interface, LND can support multiple database
backends. One of the supported backends is Postgres. This document
describes how it can be configured.

## Building LND with postgres support

To build LND with postgres support, include the following build tag:

```shell
⛰ make tags="kvdb_postgres"
```

## Configuring Postgres for LND

In order for LND to run on Postgres, an empty database should already exist. A
database can be created via the usual ways (psql, pgadmin, etc). A user with
access to this database is also required.

Creation of a schema and the tables is handled by LND automatically.

## Configuring LND for Postgres

LND is configured for Postgres through the following configuration options:

* `db.backend=postgres` to select the Postgres backend.
* `db.postgres.dsn=...` to set the database connection string that includes
database, user and password.
* `db.postgres.timeout=...` to set the connection timeout. If not set, no
timeout applies.
29 changes: 29 additions & 0 deletions docs/lnd/release-notes/release-notes-0.14.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ instantaneous. Read the [guide on leader
election](https://github.com/lightningnetwork/lnd/blob/master/docs/leader_election.md)
for more information.

### Postgres database support

This release adds [support for Postgres as a database
backend](https://github.com/lightningnetwork/lnd/pull/5366) to lnd. Postgres
has several advantages over the default bbolt backend:
* Better handling of large data sets.
* On-the-fly database compaction (auto vacuum).
* Database replication.
* Inspect data while lnd is running (bbolt opens the database exclusively).
* Usage of industry-standard tools to manage the stored data, get performance
metrics, etc.

Furthermore, the SQL platform opens up possibilities to improve lnd's
performance in the future. Bbolt's single-writer model is a severe performance
bottleneck, whereas Postgres offers a variety of locking models. Additionally,
structured tables reduce the need for custom serialization/deserialization code
in `lnd`, saving developer time and limiting the potential for bugs.

Instructions for enabling Postgres can be found in
[docs/postgres.md](../postgres.md).

## Protocol Extensions

### Explicit Channel Negotiation
Expand Down Expand Up @@ -79,6 +100,12 @@ proposed channel type is used.

* [Adds an option to the BakeMacaroon rpc "allow-external-permissions,"](https://github.com/lightningnetwork/lnd/pull/5304) which makes it possible to bake a macaroon with external permissions. That way, the baked macaroons can be used for services beyond LND. Also adds a new CheckMacaroonPermissions rpc that checks that the macaroon permissions and other restrictions are being followed. It can also check permissions not native to LND.

* [A new RPC middleware
interceptor](https://github.com/lightningnetwork/lnd/pull/5101) was added that
allows external tools to hook into `lnd`'s RPC server and intercept any
requests made with custom macaroons (and also the responses to those
requests).

### Batched channel funding

[Multiple channels can now be opened in a single
Expand Down Expand Up @@ -131,6 +158,8 @@ you.
* Locally force closed channels are now [kept in the channel.backup file until
their time lock has fully matured](https://github.com/lightningnetwork/lnd/pull/5528).

* [Cooperative closes optimistically shutdown the associated `link` before closing the channel.](https://github.com/lightningnetwork/lnd/pull/5618)

## Build System

* [A new pre-submit check has been
Expand Down

0 comments on commit 5cc88b0

Please sign in to comment.