OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / vendor / github.com / btcsuite / btcd / docs / configure_rpc_server_listen_interfaces.md
1 btcd allows you to bind the RPC server to specific interfaces which enables you
2 to setup configurations with varying levels of complexity.  The `rpclisten`
3 parameter can be specified on the command line as shown below with the -- prefix
4 or in the configuration file without the -- prefix (as can all long command line
5 options).  The configuration file takes one entry per line.
6
7 A few things to note regarding the RPC server:
8 * The RPC server will **not** be enabled unless the `rpcuser` and `rpcpass`
9   options are specified.
10 * When the `rpcuser` and `rpcpass` and/or `rpclimituser` and `rpclimitpass`
11   options are specified, the RPC server will only listen on localhost IPv4 and
12   IPv6 interfaces by default.  You will need to override the RPC listen
13   interfaces to include external interfaces if you want to connect from a remote
14   machine.
15 * The RPC server has TLS enabled by default, even for localhost.  You may use
16   the `--notls` option to disable it, but only when all listeners are on
17   localhost interfaces.
18 * The `--rpclisten` flag can be specified multiple times to listen on multiple
19   interfaces as a couple of the examples below illustrate.
20 * The RPC server is disabled by default when using the `--regtest` and
21   `--simnet` networks.  You can override this by specifying listen interfaces.
22
23 Command Line Examples:
24
25 |Flags|Comment|
26 |----------|------------|
27 |--rpclisten=|all interfaces on default port which is changed by `--testnet`|
28 |--rpclisten=0.0.0.0|all IPv4 interfaces on default port which is changed by `--testnet`|
29 |--rpclisten=::|all IPv6 interfaces on default port which is changed by `--testnet`|
30 |--rpclisten=:8334|all interfaces on port 8334|
31 |--rpclisten=0.0.0.0:8334|all IPv4 interfaces on port 8334|
32 |--rpclisten=[::]:8334|all IPv6 interfaces on port 8334|
33 |--rpclisten=127.0.0.1:8334|only IPv4 localhost on port 8334|
34 |--rpclisten=[::1]:8334|only IPv6 localhost on port 8334|
35 |--rpclisten=:8336|all interfaces on non-standard port 8336|
36 |--rpclisten=0.0.0.0:8336|all IPv4 interfaces on non-standard port 8336|
37 |--rpclisten=[::]:8336|all IPv6 interfaces on non-standard port 8336|
38 |--rpclisten=127.0.0.1:8337 --listen=[::1]:8334|IPv4 localhost on port 8337 and IPv6 localhost on port 8334|
39 |--rpclisten=:8334 --listen=:8337|all interfaces on ports 8334 and 8337|
40
41 The following config file would configure the btcd RPC server to listen to all interfaces on the default port, including external interfaces, for both IPv4 and IPv6:
42
43 ```text
44 [Application Options]
45
46 rpclisten=
47 ```