github.com/lbryio/lbcd@v0.22.119/docs/configuration.md (about)

     1  # Configuration
     2  
     3  lbcd has a number of configuration
     4  options, which can be viewed by running: `$ lbcd --help`.
     5  
     6  ## Peer server listen interface
     7  
     8  lbcd allows you to bind to specific interfaces which enables you to setup
     9  configurations with varying levels of complexity.  The listen parameter can be
    10  specified on the command line as shown below with the -- prefix or in the
    11  configuration file without the -- prefix (as can all long command line options).
    12  The configuration file takes one entry per line.
    13  
    14  **NOTE:** The listen flag can be specified multiple times to listen on multiple
    15  interfaces as a couple of the examples below illustrate.
    16  
    17  Command Line Examples:
    18  
    19  | Flags                                       | Comment                                                                                      |
    20  | ------------------------------------------- | -------------------------------------------------------------------------------------------- |
    21  | --listen=                                   | all interfaces on default port which is changed by `--testnet` and `--regtest` (**default**) |
    22  | --listen=0.0.0.0                            | all IPv4 interfaces on default port which is changed by `--testnet` and `--regtest`          |
    23  | --listen=::                                 | all IPv6 interfaces on default port which is changed by `--testnet` and `--regtest`          |
    24  | --listen=:9246                              | all interfaces on port 9246                                                                  |
    25  | --listen=0.0.0.0:9246                       | all IPv4 interfaces on port 9246                                                             |
    26  | --listen=[::]:9246                          | all IPv6 interfaces on port 9246                                                             |
    27  | --listen=127.0.0.1:9246                     | only IPv4 localhost on port 9246                                                             |
    28  | --listen=[::1]:9246                         | only IPv6 localhost on port 9246                                                             |
    29  | --listen=:9247                              | all interfaces on non-standard port 9247                                                     |
    30  | --listen=0.0.0.0:9247                       | all IPv4 interfaces on non-standard port 9247                                                |
    31  | --listen=[::]:9247                          | all IPv6 interfaces on non-standard port 9247                                                |
    32  | --listen=127.0.0.1:9248 --listen=[::1]:9246 | IPv4 localhost on port 9248 and IPv6 localhost on port 9246                                  |
    33  | --listen=:9246 --listen=:9248               | all interfaces on ports 9246 and 9248                                                        |
    34  
    35  The following config file would configure lbcd to only listen on localhost for both IPv4 and IPv6:
    36  
    37  ```text
    38  [Application Options]
    39  
    40  listen=127.0.0.1:9246
    41  listen=[::1]:9246
    42  ```
    43  
    44  In addition, if you are starting lbcd with TLS and want to make it
    45  available via a hostname, then you will need to generate the TLS
    46  certificates for that host. For example,
    47  
    48  ```
    49  gencerts --host=myhostname.example.com --directory=/home/me/.lbcd/
    50  ```
    51  
    52  ## RPC server listen interface
    53  
    54  lbcd allows you to bind the RPC server to specific interfaces which enables you
    55  to setup configurations with varying levels of complexity.  The `rpclisten`
    56  parameter can be specified on the command line as shown below with the -- prefix
    57  or in the configuration file without the -- prefix (as can all long command line
    58  options).  The configuration file takes one entry per line.
    59  
    60  A few things to note regarding the RPC server:
    61  
    62  * The RPC server will **not** be enabled unless the `rpcuser` and `rpcpass`
    63    options are specified.
    64  * When the `rpcuser` and `rpcpass` and/or `rpclimituser` and `rpclimitpass`
    65    options are specified, the RPC server will only listen on localhost IPv4 and
    66    IPv6 interfaces by default.  You will need to override the RPC listen
    67    interfaces to include external interfaces if you want to connect from a remote
    68    machine.
    69  * The RPC server has TLS enabled by default, even for localhost.  You may use
    70    the `--notls` option to disable it, but only when all listeners are on
    71    localhost interfaces.
    72  * The `--rpclisten` flag can be specified multiple times to listen on multiple
    73    interfaces as a couple of the examples below illustrate.
    74  * The RPC server is disabled by default when using the `--regtest` and
    75    `--simnet` networks.  You can override this by specifying listen interfaces.
    76  
    77  Command Line Examples:
    78  
    79  | Flags                                          | Comment                                                             |
    80  | ---------------------------------------------- | ------------------------------------------------------------------- |
    81  | --rpclisten=                                   | all interfaces on default port which is changed by `--testnet`      |
    82  | --rpclisten=0.0.0.0                            | all IPv4 interfaces on default port which is changed by `--testnet` |
    83  | --rpclisten=::                                 | all IPv6 interfaces on default port which is changed by `--testnet` |
    84  | --rpclisten=:9245                              | all interfaces on port 9245                                         |
    85  | --rpclisten=0.0.0.0:9245                       | all IPv4 interfaces on port 9245                                    |
    86  | --rpclisten=[::]:9245                          | all IPv6 interfaces on port 9245                                    |
    87  | --rpclisten=127.0.0.1:9245                     | only IPv4 localhost on port 9245                                    |
    88  | --rpclisten=[::1]:9245                         | only IPv6 localhost on port 9245                                    |
    89  | --rpclisten=:9247                              | all interfaces on non-standard port 9247                            |
    90  | --rpclisten=0.0.0.0:9247                       | all IPv4 interfaces on non-standard port 9247                       |
    91  | --rpclisten=[::]:9247                          | all IPv6 interfaces on non-standard port 9247                       |
    92  | --rpclisten=127.0.0.1:9248 --listen=[::1]:9245 | IPv4 localhost on port 9248 and IPv6 localhost on port 9245         |
    93  | --rpclisten=:9245 --listen=:9248               | all interfaces on ports 9245 and 9248                               |
    94  
    95  The following config file would configure the lbcd RPC server to listen to all interfaces on the default port, including external interfaces, for both IPv4 and IPv6:
    96  
    97  ```text
    98  [Application Options]
    99  
   100  rpclisten=
   101  ```
   102  
   103  ## Default ports
   104  
   105  While lbcd is highly configurable when it comes to the network configuration,
   106  the following is intended to be a quick reference for the default ports used so
   107  port forwarding can be configured as required.
   108  
   109  lbcd by default will automatically map the
   110  peer-to-peer listening port if your router supports UPnP.  If your router does
   111  not support UPnP, or you don't wish to use it, please note that only the
   112  peer-to-peer port should be forwarded unless you specifically want to allow RPC
   113  access to your lbcd from external sources such as in more advanced network
   114  configurations. You can disable UPnP with the `--noupnp` daemon option.
   115  
   116  | Name                      | Port     |
   117  | ------------------------- | -------- |
   118  | Default peer-to-peer port | TCP 9246 |
   119  | Default RPC port          | TCP 9245 |
   120  
   121  ## Using bootstrap.dat
   122  
   123  ### What is bootstrap.dat?
   124  
   125  It is a flat, binary file containing bitcoin blockchain data starting from the
   126  genesis block and continuing through a relatively recent block height depending
   127  on the last time it was updated.
   128  
   129  See [this](https://bitcointalk.org/index.php?topic=145386.0) thread on
   130  bitcointalk for more details.
   131  
   132  **NOTE:** Using bootstrap.dat is entirely optional.  lbcd will download the
   133  block chain from other peers through the Bitcoin protocol with no extra
   134  configuration needed.
   135  
   136  ### What are the pros and cons of using bootstrap.dat?
   137  
   138  Pros:
   139  
   140  * Typically accelerates the initial process of bringing up a new node as it
   141    downloads from public P2P nodes and generally is able to achieve faster
   142    download speeds
   143  * It is particularly beneficial when bringing up multiple nodes as you only need
   144    to download the data once
   145  
   146  Cons:
   147  
   148  * Requires you to setup and configure a torrent client if you don't already have
   149    one available
   150  * Requires roughly twice as much disk space since you'll need the flat file as
   151    well as the imported database
   152  
   153  ### Where do I get bootstrap.dat?
   154  
   155  The bootstrap.dat file is made available via a torrent.  See
   156  [this](https://bitcointalk.org/index.php?topic=145386.0) thread on bitcointalk
   157  for the torrent download details.
   158  
   159  ### How do I know I can trust the bootstrap.dat I downloaded?
   160  
   161  You don't need to trust the file as the `addblock` utility verifies every block
   162  using the same rules that are used when downloading the block chain normally
   163  through the Bitcoin protocol.  Additionally, the chain rules contain hard-coded
   164  checkpoints for the known-good block chain at periodic intervals.  This ensures
   165  that not only is it a valid chain, but it is the same chain that everyone else
   166  is using.
   167  
   168  ### How do I use bootstrap.dat with lbcd?
   169  
   170  lbcd comes with a separate utility named `addblock` which can be used to import
   171  `bootstrap.dat`.  This approach is used since the import is a one-time operation
   172  and we prefer to keep the daemon itself as lightweight as possible.
   173  
   174  1. Stop lbcd if it is already running.  This is required since addblock needs to
   175     access the database used by lbcd and it will be locked if lbcd is using it.
   176  2. Note the path to the downloaded bootstrap.dat file.
   177  3. Run the addblock utility with the `-i` argument pointing to the location of
   178     boostrap.dat:
   179  
   180  **Windows:**
   181  
   182  ```bat
   183  "%PROGRAMFILES%\lbcd Suite\lbcd\addblock" -i C:\Path\To\bootstrap.dat
   184  ```
   185  
   186  **Linux/Unix/BSD/POSIX:**
   187  
   188  ```bash
   189  $GOPATH/bin/addblock -i /path/to/bootstrap.dat
   190  ```