github.com/decred/dcrlnd@v0.7.6/docs/etcd.md (about)

     1  # Experimental etcd support in LND
     2  
     3  With the recent introduction of the `kvdb` interface LND can support multiple
     4  database backends allowing experimentation with the storage model as well as
     5  improving robustness trough eg. replicating essential data.
     6  
     7  Building on `kvdb` in v0.11.0 we're adding experimental [etcd](https://etcd.io)
     8  support to LND. As this is an unstable feature heavily in development, it still
     9  has *many* rough edges for the time being. It is therefore highly recommended to
    10  not use LND on `etcd` in any kind of production environment especially not
    11  on bitcoin mainnet.
    12  
    13  ## Building LND with etcd support
    14  
    15  To create a dev build of LND with etcd support use the following command:
    16  
    17  ```
    18  make tags="kvdb_etcd"
    19  ```
    20  
    21  The important tag is the `kvdb_etcd`, without which the binary is built without
    22  the etcd driver.
    23  
    24  For development it is advised to set the `GOFLAGS` environment variable to 
    25  `"-tags=test"` otherwise `gopls` won't work on code in `channeldb/kvdb/etcd`
    26  directory.
    27  
    28  ## Running a local etcd instance for testing
    29  
    30  To start your local etcd instance for testing run:
    31  
    32  ```
    33  ./etcd \
    34      --auto-tls \
    35      --advertise-client-urls=https://127.0.0.1:2379 \
    36      --listen-client-urls=https://0.0.0.0:2379 \
    37      --max-txn-ops=16384 \
    38      --max-request-bytes=104857600
    39  ```
    40  
    41  The large `max-txn-ops` and `max-request-bytes` values are currently required in
    42  case of running LND with the full graph in etcd. Upcoming versions will split
    43  the database to local and replicated parts and only essential parts will remain
    44  in the replicated database, removing the requirement for these additional 
    45  settings. These parameters have been tested to work with testnet LND.
    46  
    47  ## Configuring LND to run on etcd
    48  
    49  To run LND with etcd, additional configuration is needed, specified either
    50  through command line flags or in `lnd.conf`.
    51  
    52  Sample command line:
    53  
    54  ```
    55  ./lnd-debug \
    56      --db.backend=etcd \
    57      --db.etcd.host=127.0.0.1:2379 \
    58      --db.etcd.certfile=/home/user/etcd/bin/default.etcd/fixtures/client/cert.pem \
    59      --db.etcd.keyfile=/home/user/etcd/bin/default.etcd/fixtures/client/key.pem \
    60      --db.etcd.insecure_skip_verify
    61  ```
    62  
    63  Sample `lnd.conf` (with other setting omitted):
    64  
    65  ```
    66  [db]
    67  db.backend=etcd
    68  db.etcd.host=127.0.0.1:2379
    69  db.etcd.cerfile=/home/user/etcd/bin/default.etcd/fixtures/client/cert.pem
    70  db.etcd.keyfile=/home/user/etcd/bin/default.etcd/fixtures/client/key.pem
    71  db.etcd.insecure_skip_verify=true
    72  ```
    73  
    74  Optionally users can specifiy `db.etcd.user` and `db.etcd.pass` for db user
    75  authentication. If the database is shared, it is possible to separate our data
    76  from other users by setting `db.etcd.namespace` to an (already existing) etcd
    77  namespace. In order to test without TLS, users are able to set `db.etcd.disabletls`
    78  flag to `true`.
    79  
    80  ## Migrating existing channel.db to etcd
    81  
    82  This is currently not supported.
    83  
    84  ## Disclaimer
    85  
    86  As mentioned before this is an experimental feature, and with that your data
    87  may be lost. Use at your own risk!