docs: Different formats for parameters (#592)

This commit is contained in:
Matthew Zipkin 2018-08-28 10:11:07 -07:00 committed by Buck Perley
parent e4f41db5ab
commit 149558072d

View File

@ -1,13 +1,29 @@
By default, the mainnet bcoin config files will reside in `~/.bcoin/bcoin.conf` and `~/.bcoin/wallet.conf`. By default, the mainnet bcoin config files will reside in `~/.bcoin/bcoin.conf` and `~/.bcoin/wallet.conf`.
Any parameter passed to bcoin at startup will have precedence over the config file. Even if you are just running `bclient` without bcoin even installed (to access a remote server, for example) the configuration files would still reside in `~/.bcoin/` Any parameter passed to bcoin at startup will have precedence over the config file.
Even if you are just running `bclient` without bcoin installed (to access a remote server, for example)
the configuration files would still reside in `~/.bcoin/`
For example: For example:
Running `bcoin --network=regtest --api-key=menace --daemon` will read the config file at `~/.bcoin/regtest/bcoin.conf` ``` bash
bcoin --network=regtest --api-key=menace --daemon
```
...will read the config file at `~/.bcoin/regtest/bcoin.conf`
and ignore any `network` or `api-key` parameters listed in that file. and ignore any `network` or `api-key` parameters listed in that file.
All bcoin configuration options work in the config file, CLI arguments, and All bcoin configuration options work in the config file, CLI arguments,
process environment (with a `BCOIN_` prefix). process environment, and in the constructor parameters when instantiating new `node` objects in JavaScript.
Each method has slightly different formatting. Note specifically the usage of hyphens and capital letters.
See the examples below:
| config file | CLI parameter | environment variable | JS object constructor |
|---|---|---|---|
| `network: testnet` | `--network=testnet` | `BCOIN_NETWORK=testnet` | `{network: 'testnet'}` |
| `log-level: debug` | `--log-level=debug` | `BCOIN_LOG_LEVEL=debug` | `{logLevel: 'debug'}` |
| `max-outbound: 8` | `--max-outbound=8` | `BCOIN_MAX_OUTBOUND=8` | `{maxOutbound: 8}`|
## Datadir/Prefix ## Datadir/Prefix