mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Merge pull request #403 from bigchaindb/revise-config-docs
Docs: Revised CLI and configuration settings docs
This commit is contained in:
commit
240d8075e2
@ -1,59 +1,74 @@
|
|||||||
# The BigchainDB Command Line Interface (CLI)
|
# The BigchainDB Command Line Interface (CLI)
|
||||||
|
|
||||||
The command to interact with BigchainDB is `bigchaindb`. This section provides an overview of the command.
|
The command-line command to interact with BigchainDB is `bigchaindb`.
|
||||||
|
|
||||||
## bigchaindb
|
|
||||||
|
|
||||||
### bigchaindb --help
|
## bigchaindb \-\-help
|
||||||
|
|
||||||
One can get basic help with the `bigchaindb` command using `bigchaindb --help` or `bigchaindb -h`.
|
Show help for the `bigchaindb` command. `bigchaindb -h` does the same thing.
|
||||||
|
|
||||||
### bigchaindb configure
|
|
||||||
|
|
||||||
This command generates a public/private keypair for the node, and writes a BigchainDB configuration file to the node's file system. It's documented in the section [Configuring a BigchainDB Node](configuration.html).
|
## bigchaindb configure
|
||||||
|
|
||||||
If you want to force-generate a new configuration file regardless of whether one already exists (i.e. skipping the yes/no prompt), then use `bigchaindb -y configure`.
|
Generate a local config file (which can be used to set some or all [BigchainDB node configuration settings](configuration.html)). It will auto-generate a public-private keypair and then ask you for the values of other configuration settings. If you press Enter for a value, it will use the default value.
|
||||||
|
|
||||||
### bigchaindb show-config
|
If you use the `-c` command-line option, it will generate the file at the specified path:
|
||||||
|
```text
|
||||||
|
bigchaindb -c path/to/new_config.json configure
|
||||||
|
```
|
||||||
|
|
||||||
This command shows the values of the configuration settings, which can come from a variety of sources. See [the section on configuring BigchainDB](configuration.html) for more details and examples.
|
If you don't use the `-c` command-line option, the file will be written to `$HOME/.bigchaindb` (the default location where BigchainDB looks for a config file, if one isn't specified).
|
||||||
|
|
||||||
### bigchaindb export-my-pubkey
|
If you use the `-y` command-line option, then there won't be any interactive prompts: it will just generate a keypair and use the default values for all the other configuration settings.
|
||||||
|
```text
|
||||||
|
bigchaindb -y configure
|
||||||
|
```
|
||||||
|
|
||||||
This command writes the node's public key (i.e. one of its configuration values) to standard output (stdout).
|
|
||||||
|
|
||||||
### bigchaindb init
|
## bigchaindb show-config
|
||||||
|
|
||||||
This command creates a RethinkDB database, two RethinkDB database tables (backlog and bigchain), various RethinkDB database indexes, and the genesis block.
|
Show the values of the [BigchainDB node configuration settings](configuration.html).
|
||||||
|
|
||||||
|
|
||||||
|
## bigchaindb export-my-pubkey
|
||||||
|
|
||||||
|
Write the node's public key (i.e. one of its configuration values) to standard output (stdout).
|
||||||
|
|
||||||
|
|
||||||
|
## bigchaindb init
|
||||||
|
|
||||||
|
Create a RethinkDB database, all RethinkDB database tables, various RethinkDB database indexes, and the genesis block.
|
||||||
|
|
||||||
Note: The `bigchaindb start` command (see below) always starts by trying a `bigchaindb init` first. If it sees that the RethinkDB database already exists, then it doesn't re-initialize the database. One doesn't have to do `bigchaindb init` before `bigchaindb start`. `bigchaindb init` is useful if you only want to initialize (but not start).
|
Note: The `bigchaindb start` command (see below) always starts by trying a `bigchaindb init` first. If it sees that the RethinkDB database already exists, then it doesn't re-initialize the database. One doesn't have to do `bigchaindb init` before `bigchaindb start`. `bigchaindb init` is useful if you only want to initialize (but not start).
|
||||||
|
|
||||||
### bigchaindb drop
|
|
||||||
|
|
||||||
This command drops (erases) the RethinkDB database. You will be prompted to make sure. If you want to force-drop the database (i.e. skipping the yes/no prompt), then use `bigchaindb -y drop`
|
## bigchaindb drop
|
||||||
|
|
||||||
### bigchaindb start
|
Drop (erase) the RethinkDB database. You will be prompted to make sure. If you want to force-drop the database (i.e. skipping the yes/no prompt), then use `bigchaindb -y drop`
|
||||||
|
|
||||||
This command starts BigchainDB. It always begins by trying a `bigchaindb init` first. See the note in the documentation for `bigchaindb init`.
|
|
||||||
|
|
||||||
|
|
||||||
### bigchaindb load
|
## bigchaindb start
|
||||||
|
|
||||||
This command is used to run benchmarking tests. You can learn more about it using:
|
Start BigchainDB. It always begins by trying a `bigchaindb init` first. See the note in the documentation for `bigchaindb init`.
|
||||||
|
|
||||||
|
|
||||||
|
## bigchaindb load
|
||||||
|
|
||||||
|
Write transactions to the backlog (for benchmarking tests). You can learn more about it using:
|
||||||
```text
|
```text
|
||||||
$ bigchaindb load -h
|
$ bigchaindb load -h
|
||||||
```
|
```
|
||||||
|
|
||||||
### bigchaindb set-shards
|
## bigchaindb set-shards
|
||||||
|
|
||||||
This command is used to set the number of shards in the underlying datastore. For example, the following command will set the number of shards to four:
|
Set the number of shards in the underlying datastore. For example, the following command will set the number of shards to four:
|
||||||
```text
|
```text
|
||||||
$ bigchaindb set-shards 4
|
$ bigchaindb set-shards 4
|
||||||
```
|
```
|
||||||
|
|
||||||
### bigchaindb set-replicas
|
## bigchaindb set-replicas
|
||||||
|
|
||||||
This command is used to set the number of replicas (of each shard) in the underlying datastore. For example, the following command will set the number of replicas to three (i.e. it will set the replication factor to three):
|
Set the number of replicas (of each shard) in the underlying datastore. For example, the following command will set the number of replicas to three (i.e. it will set the replication factor to three):
|
||||||
```text
|
```text
|
||||||
$ bigchaindb set-replicas 3
|
$ bigchaindb set-replicas 3
|
||||||
```
|
```
|
||||||
|
@ -1,236 +1,190 @@
|
|||||||
# Configuring a BigchainDB Node
|
# Node Configuration Settings
|
||||||
|
|
||||||
The BigchainDB configuration settings for a particular node are stored on that node in a configuration file at `$HOME/.bigchaindb`. That file doesn't exist by default. (It's not created when installing BigchainDB.) One could create it using a text editor, but it's easiest to use the `bigchaindb configure` command:
|
The value of each configuration setting is determined according to the following rules:
|
||||||
|
|
||||||
|
* If it's set by an environment variable, then use that value
|
||||||
|
* Otherwise, if it's set in a local config file, then use that value
|
||||||
|
* Otherwise, use the default value
|
||||||
|
|
||||||
|
For convenience, here's a list of all the relevant environment variables (documented below):
|
||||||
|
|
||||||
|
`BIGCHAINDB_KEYPAIR_PUBLIC`<br>
|
||||||
|
`BIGCHAINDB_KEYPAIR_PRIVATE`<br>
|
||||||
|
`BIGCHAINDB_KEYRING`<br>
|
||||||
|
`BIGCHAINDB_DATABASE_HOST`<br>
|
||||||
|
`BIGCHAINDB_DATABASE_PORT`<br>
|
||||||
|
`BIGCHAINDB_DATABASE_NAME`<br>
|
||||||
|
`BIGCHAINDB_SERVER_BIND`<br>
|
||||||
|
`BIGCHAINDB_SERVER_WORKERS`<br>
|
||||||
|
`BIGCHAINDB_SERVER_THREADS`<br>
|
||||||
|
`BIGCHAINDB_API_ENDPOINT`<br>
|
||||||
|
`BIGCHAINDB_CONSENSUS_PLUGIN`<br>
|
||||||
|
`BIGCHAINDB_STATSD_HOST`<br>
|
||||||
|
`BIGCHAINDB_STATSD_PORT`<br>
|
||||||
|
`BIGCHAINDB_STATSD_RATE`<br>
|
||||||
|
|
||||||
|
The local config file is `$HOME/.bigchaindb` by default (a file which might not even exist), but you can tell BigchainDB to use a different file by using the `-c` command-line option, e.g. `bigchaindb -c path/to/config_file.json start`.
|
||||||
|
|
||||||
|
You can read the current default values in the file [bigchaindb/\_\_init\_\_.py](https://github.com/bigchaindb/bigchaindb/blob/master/bigchaindb/__init__.py). (The link is to the latest version.)
|
||||||
|
|
||||||
|
Running `bigchaindb -y configure` will generate a local config file in `$HOME/.bigchaindb` with all the default values, with two exceptions: It will generate a valid private/public keypair, rather than using the default keypair (`None` and `None`).
|
||||||
|
|
||||||
|
|
||||||
|
## keypair.public & keypair.private
|
||||||
|
|
||||||
|
The [cryptographic keypair](../appendices/cryptography.html) used by the node. The public key is how the node idenifies itself to the world. The private key is used to generate cryptographic signatures. Anyone with the public key can verify that the signature was generated by whoever had the corresponding private key.
|
||||||
|
|
||||||
|
**Example using environment variables**
|
||||||
```text
|
```text
|
||||||
$ bigchaindb configure
|
export BIGCHAINDB_KEYPAIR_PUBLIC=8wHUvvraRo5yEoJAt66UTZaFq9YZ9tFFwcauKPDtjkGw
|
||||||
|
export BIGCHAINDB_KEYPAIR_PRIVATE=5C5Cknco7YxBRP9AgB1cbUVTL4FAcooxErLygw1DeG2D
|
||||||
```
|
```
|
||||||
|
|
||||||
It will ask some questions and generate a new keypair (i.e. a private key and corresponding public key for the node). See below for some additional explanation of the settings and their meanings. To accept a suggested default value, press Enter or Return. If you want to accept all the default values, use the `-y` option when running the command, that is:
|
**Example config file snippet**
|
||||||
|
```js
|
||||||
|
"keypair": {
|
||||||
|
"public": "8wHUvvraRo5yEoJAt66UTZaFq9YZ9tFFwcauKPDtjkGw",
|
||||||
|
"private": "5C5Cknco7YxBRP9AgB1cbUVTL4FAcooxErLygw1DeG2D"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Internally (i.e. in the Python code), both keys have a default value of `None`, but that's not a valid key. Therefore you can't rely on the defaults for the keypair. If you want to run BigchainDB, you must provide a valid keypair, either in the environment variables or in the local config file. You can generate a local config file with a valid keypair (and default everything else) using `bigchaindb -y configure`.
|
||||||
|
|
||||||
|
|
||||||
|
## keyring
|
||||||
|
|
||||||
|
A list of the public keys of all the nodes in the cluster, excluding the public key of this node.
|
||||||
|
|
||||||
|
**Example using an environment variable**
|
||||||
```text
|
```text
|
||||||
$ bigchaindb -y configure
|
export BIGCHAINDB_KEYRING=BnCsre9MPBeQK8QZBFznU2dJJ2GwtvnSMdemCmod2XPB:4cYQHoQrvPiut3Sjs8fVR1BMZZpJjMTC4bsMTt9V71aQ
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using a Different Path for the Configuration File
|
Note how the keys in the list are separated by colons.
|
||||||
|
|
||||||
By default, the configuration settings are stored in `$HOME/.bigchaindb`. If you want to
|
**Example config file snippet**
|
||||||
specify a different path for your configuration file, you can use the `-c` parameter.
|
```js
|
||||||
This works for every subcommand under the `bigchaindb` executable.
|
"keyring": ["BnCsre9MPBeQK8QZBFznU2dJJ2GwtvnSMdemCmod2XPB",
|
||||||
|
"4cYQHoQrvPiut3Sjs8fVR1BMZZpJjMTC4bsMTt9V71aQ"]
|
||||||
For example, if you want to **generate** a new configuration file under a
|
|
||||||
specific path, you can run:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ bigchaindb -c local.json configure
|
|
||||||
$ bigchaindb -c test.json configure
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This will create two new files named `local.json` and `test.json` in your
|
**Default value (from a config file)**
|
||||||
current working directory.
|
```js
|
||||||
|
"keyring": []
|
||||||
From now on, you can refer to those configuration files using the `-c`
|
|
||||||
parameter; for example:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ bigchaindb -c local.json show-config
|
|
||||||
```
|
|
||||||
|
|
||||||
will show the configuration for `local.json`.
|
|
||||||
|
|
||||||
If you want to **start** BigchainDB with the `test.json` configuration file, you can use:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ bigchaindb -c test.json start
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Using Environment Variables to Configure the Node
|
## database.host, database.port & database.name
|
||||||
|
|
||||||
Sometimes it's more convenient to use environment variables to configure the
|
The RethinkDB database hostname, port and name.
|
||||||
system, for example when using Docker or Heroku. In
|
|
||||||
that case you can configure the system using environment variables.
|
|
||||||
|
|
||||||
Every configuration parameter can be mapped to an environment variable. The
|
**Example using environment variables**
|
||||||
environment variables available are:
|
```text
|
||||||
|
export BIGCHAINDB_DATABASE_HOST=localhost
|
||||||
|
export BIGCHAINDB_DATABASE_PORT=28015
|
||||||
|
export BIGCHAINDB_DATABASE_NAME=bigchain
|
||||||
|
```
|
||||||
|
|
||||||
- `BIGCHAINDB_DATABASE_HOST` defines the RethinkDB database hostname to connect to.
|
**Example config file snippet**
|
||||||
- `BIGCHAINDB_DATABASE_PORT` defines the RethinkDB database port to connect to.
|
```js
|
||||||
- `BIGCHAINDB_DATABASE_NAME` defines the RethinkDB database name to use.
|
"database": {
|
||||||
- `BIGCHAINDB_KEYPAIR_PUBLIC` defines the public key of the BigchainDB node.
|
"host": "localhost",
|
||||||
- `BIGCHAINDB_KEYPAIR_PRIVATE` defines the private key of the BigchainDB node.
|
"port": 28015,
|
||||||
- `BIGCHAINDB_KEYRING` is a colon-separated list of the public keys of all _other_ nodes in the cluster.
|
"name": "bigchain"
|
||||||
- `BIGCHAINDB_STATSD_HOST` defines the hostname of the statsd server for [monitoring](../clusters-feds/monitoring.html).
|
|
||||||
- `BIGCHAINDB_STATSD_PORT` defines the port of the statsd server for monitoring.
|
|
||||||
- `BIGCHAINDB_STATSD_RATE` is a float between `0` and `1` that defines the fraction of transaction operations sampled.
|
|
||||||
- `BIGCHAINDB_API_ENDPOINT` defines the API endpoint to use (e.g. `http://localhost:9984/api/v1`).
|
|
||||||
- `BIGCHAINDB_CONSENSUS_PLUGIN` defines the name of the [consensus plugin](../appendices/consensus.html) to use.
|
|
||||||
- `BIGCHAINDB_SERVER_BIND` defines where to bind the server socket, the format is `addr:port` (e.g. `localhost:9984`).
|
|
||||||
- `BIGCHAINDB_SERVER_WORKERS` defines the [number of workers](http://docs.gunicorn.org/en/stable/settings.html#workers)
|
|
||||||
to start for the server API.
|
|
||||||
- `BIGCHAINDB_SERVER_THREADS` defines the [number of threads](http://docs.gunicorn.org/en/stable/settings.html#threads)
|
|
||||||
to start for the server API.
|
|
||||||
|
|
||||||
|
|
||||||
## Configuring the API Server
|
|
||||||
The API Server is powered by [Gunicorn](http://gunicorn.org/), a Python WSGI HTTP Server for UNIX.
|
|
||||||
If you need to tweak some settings for the API server you can manually edit your `.bigchaindb` config file:
|
|
||||||
the `server` section accepts all the options specified in the
|
|
||||||
[Gunicorn settings](http://docs.gunicorn.org/en/stable/settings.html) documentation.
|
|
||||||
|
|
||||||
|
|
||||||
## Order of Precedence in Determining Configuration Values
|
|
||||||
|
|
||||||
All configuration values start with their default values (defined in `bigchaindb.__init__`), but a default value
|
|
||||||
can be overriden by a value in a local configuration file (`$HOME/.bigchaindb` or the location specified by the
|
|
||||||
`-c` command-line option), and a value set by a local configuration file can be overriden by a value in an environment variable
|
|
||||||
|
|
||||||
In summary, there is an order of precedence in reading configuration values:
|
|
||||||
1. environment variables
|
|
||||||
2. local configuration file
|
|
||||||
3. default configuration file (defined in ``bigchaindb.__init__``)
|
|
||||||
|
|
||||||
This means that if the default configuration contains:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"database": {
|
|
||||||
"name": "bigchain",
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 28015
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
while the local file `local.json` contains:
|
**Default values (a snippet from `bigchaindb/__init__.py`)**
|
||||||
```json
|
```python
|
||||||
{
|
'database': {
|
||||||
"database": {
|
'host': os.environ.get('BIGCHAINDB_DATABASE_HOST', 'localhost'),
|
||||||
"host": "ec2-xx-xx-xxx-xxx.eu-central-1.compute.amazonaws.com",
|
'port': 28015,
|
||||||
"port": 5000
|
'name': 'bigchain',
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
and you run this command:
|
|
||||||
```
|
|
||||||
$ BIGCHAINDB_DATABASE_PORT=4242 \
|
|
||||||
BIGCHAINDB_KEYRING=pubkey0:pubkey1 \
|
|
||||||
bigchaindb -c local.json show-config
|
|
||||||
```
|
|
||||||
|
|
||||||
you will get the following values for all the configuration settings:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"api_endpoint": "http://localhost:8008/api/v1",
|
|
||||||
"consensus_plugin": "default",
|
|
||||||
"database": {
|
|
||||||
"host": "ec2-xx-xx-xxx-xxx.eu-central-1.compute.amazonaws.com",
|
|
||||||
"name": "bigchain",
|
|
||||||
"port": 4242
|
|
||||||
},
|
|
||||||
"keypair": {
|
|
||||||
"private": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
||||||
"public": "nJq6EmdUkvFjQRB5hFvDmvZtv1deb3W3RgmiAq6dyygC"
|
|
||||||
},
|
|
||||||
"keyring": [
|
|
||||||
"pubkey0",
|
|
||||||
"pubkey1"
|
|
||||||
],
|
|
||||||
"server": {
|
|
||||||
"bind": "localhost:9984",
|
|
||||||
"threads": null,
|
|
||||||
"workers": null
|
|
||||||
},
|
|
||||||
"statsd": {
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 8125,
|
|
||||||
"rate": 0.01
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Another Example
|
## server.bind, server.workers & server.threads
|
||||||
|
|
||||||
As another example, let's assume we **don't** have any configuration file stored in
|
These settings are for the [Gunicorn HTTP server](http://gunicorn.org/), which is used to serve the [HTTP client-server API](../drivers-clients/http-client-server-api.html).
|
||||||
`$HOME/.bigchaindb`. As you can see, `show-config` displays the default configuration (and a
|
|
||||||
warning):
|
`server.bind` is where to bind the Gunicorn HTTP server socket. It's a string. It can be any valid value for [Gunicorn's bind setting](http://docs.gunicorn.org/en/stable/settings.html#bind). If you want to allow IPv4 connections from anyone, on port 9984, use '0.0.0.0:9984'. `server.workers` is [the number of worker processes](http://docs.gunicorn.org/en/stable/settings.html#workers) for handling requests. If `None` (the default), the value will be (cpu_count * 2 + 1). `server.threads` is [the number of threads-per-worker](http://docs.gunicorn.org/en/stable/settings.html#threads) for handling requests. If `None` (the default), the value will be (cpu_count * 2 + 1).
|
||||||
|
|
||||||
|
The HTTP server will be able to handle `server.workers` * `server.threads` requests simultaneously.
|
||||||
|
|
||||||
|
**Example using environment variables**
|
||||||
|
```text
|
||||||
|
export BIGCHAINDB_SERVER_BIND=0.0.0.0:9984
|
||||||
|
export BIGCHAINDB_SERVER_WORKERS=5
|
||||||
|
export BIGCHAINDB_SERVER_THREADS=5
|
||||||
```
|
```
|
||||||
$ bigchaindb show-config
|
|
||||||
WARNING:bigchaindb.config_utils:Cannot find config file `/home/vrde/.bigchaindb`.
|
**Example config file snippet**
|
||||||
{
|
```js
|
||||||
"api_endpoint": "http://localhost:9984/api/v1",
|
"server": {
|
||||||
"consensus_plugin": "default",
|
"bind": "0.0.0.0:9984",
|
||||||
"database": {
|
"workers": 5,
|
||||||
"host": "localhost",
|
"threads": 5
|
||||||
"name": "bigchain",
|
|
||||||
"port": 28015
|
|
||||||
},
|
|
||||||
"keypair": {
|
|
||||||
"private": null,
|
|
||||||
"public": null
|
|
||||||
},
|
|
||||||
"keyring": [],
|
|
||||||
"server": {
|
|
||||||
"bind": "localhost:9984",
|
|
||||||
"threads": null,
|
|
||||||
"workers": null
|
|
||||||
},
|
|
||||||
"statsd": {
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 8125,
|
|
||||||
"rate": 0.01
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If we try to run the node, the command will fail:
|
**Default values (from a config file)**
|
||||||
|
```js
|
||||||
```
|
"server": {
|
||||||
$ bigchaindb start
|
"bind": "localhost:9984",
|
||||||
WARNING:bigchaindb.config_utils:Cannot find config file `/home/vrde/.bigchaindb`.
|
"workers": null,
|
||||||
Cannot start BigchainDB, no keypair found. Did you run `bigchaindb configure`?
|
"threads": null
|
||||||
```
|
|
||||||
|
|
||||||
This is failing as expected: a BigchainDB node needs at least a key pair to work.
|
|
||||||
We can pass the key pair using environment variables:
|
|
||||||
```
|
|
||||||
$ BIGCHAINDB_KEYPAIR_PUBLIC=26y9EuyGP44JXxqcvF8GbCJGqkiqFXddZzxVjLU3rWbHp \
|
|
||||||
BIGCHAINDB_KEYPAIR_PRIVATE=9PkLfHbzXnSSNnb1sSBL73C2MydzKLs5fAHoA4Q7otrG \
|
|
||||||
bigchaindb start
|
|
||||||
```
|
|
||||||
|
|
||||||
We can also run `show-config` to see how the configuration looks:
|
|
||||||
```
|
|
||||||
$ BIGCHAINDB_KEYPAIR_PUBLIC=26y9EuyGP44JXxqcvF8GbCJGqkiqFXddZzxVjLU3rWbHp \
|
|
||||||
BIGCHAINDB_KEYPAIR_PRIVATE=9PkLfHbzXnSSNnb1sSBL73C2MydzKLs5fAHoA4Q7otrG \
|
|
||||||
bigchaindb show-config
|
|
||||||
|
|
||||||
WARNING:bigchaindb.config_utils:Cannot find config file `/home/vrde/.bigchaindb`.
|
|
||||||
{
|
|
||||||
"api_endpoint": "http://localhost:9984/api/v1",
|
|
||||||
"consensus_plugin": "default",
|
|
||||||
"database": {
|
|
||||||
"host": "localhost",
|
|
||||||
"name": "bigchain",
|
|
||||||
"port": 28015
|
|
||||||
},
|
|
||||||
"keypair": {
|
|
||||||
"private": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
||||||
"public": "26y9EuyGP44JXxqcvF8GbCJGqkiqFXddZzxVjLU3rWbHp"
|
|
||||||
},
|
|
||||||
"keyring": [],
|
|
||||||
"server": {
|
|
||||||
"bind": "localhost:9984",
|
|
||||||
"threads": null,
|
|
||||||
"workers": null
|
|
||||||
},
|
|
||||||
"statsd": {
|
|
||||||
"host": "localhost",
|
|
||||||
"port": 8125,
|
|
||||||
"rate": 0.01
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## api_endpoint
|
||||||
|
|
||||||
|
`api_endpoint` is the URL where a BigchainDB client can get access to the HTTP client-server API.
|
||||||
|
|
||||||
|
**Example using an environment variable**
|
||||||
|
```text
|
||||||
|
export BIGCHAINDB_API_ENDPOINT="http://localhost:9984/api/v1"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example config file snippet**
|
||||||
|
```js
|
||||||
|
"api_endpoint": "http://webserver.blocks587.net:9984/api/v1"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Default value (from a config file)**
|
||||||
|
```js
|
||||||
|
"api_endpoint": "http://localhost:9984/api/v1"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## consensus_plugin
|
||||||
|
|
||||||
|
The [consensus plugin](../appendices/consensus.html) to use.
|
||||||
|
|
||||||
|
**Example using an environment variable**
|
||||||
|
```text
|
||||||
|
export BIGCHAINDB_CONSENSUS_PLUGIN=default
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example config file snippet: the default**
|
||||||
|
```js
|
||||||
|
"consensus_plugin": "default"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## statsd.host, statsd.port & statsd.rate
|
||||||
|
|
||||||
|
These settings are used to configure where, and how often, [StatsD](https://github.com/etsy/statsd) should send data for [cluster monitoring](../clusters-feds/monitoring.html) purposes. `statsd.host` is the hostname of the monitoring server, where StatsD should send its data. `stats.port` is the port. `statsd.rate` is the fraction of transaction operations that should be sampled. It's a float between 0.0 and 1.0.
|
||||||
|
|
||||||
|
**Example using environment variables**
|
||||||
|
```text
|
||||||
|
export BIGCHAINDB_STATSD_HOST="http://monitor.monitors-r-us.io"
|
||||||
|
export BIGCHAINDB_STATSD_PORT=8125
|
||||||
|
export BIGCHAINDB_STATSD_RATE=0.01
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example config file snippet: the default**
|
||||||
|
```js
|
||||||
|
"statsd": {"host": "localhost", "port": 8125, "rate": 0.01}
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user