-
Notifications
You must be signed in to change notification settings - Fork 2
Config
Wouter den Bakker edited this page Jun 19, 2018
·
3 revisions
Example of a config file. Fill in the required parameters and change any other parameters that you wish to change. For all variables you can choose to replace them with an environment variable instead. Note that all values are prefixed with VSERVER_.
| Name | Type | Default | Description |
|---|---|---|---|
| API | string | NONE | A string for a json object with the key the api endpoint (e.g. "v1" for api.site.com/v1) and the value the path to the handler containing the api version. (e.g. "dist/basics/basichandler.js"). This to make it easy to extend on this project. |
| WSPORT | number | NONE | The port used to accept incoming websocket connections. May not be the same as the RESTPORT. Either WSPORT or RESTPORT or both should be defined. |
| RESTPORT | number | NONE | The port used to accept incoming http connections. May not be the same as the WSPORT. Either WSPORT or RESTPORT or both should be defined. |
| DBPASSWORD | string | NONE | The password used to connect to the database. |
| DBUSER | string | miner | The user used to connect to the database. |
| DBNAME | string | blockchain | The name of the database to connect to. |
| DBHOST | string | localhost | The host that runs the database. |
| DBPORT | number | 5432 | The port at which the database is accessible. |
| TLS | boolean | true | Whether to use https/wss or http/ws. If true KEYPATH and CERTPATH should also be defined. |
| KEYPATH | string | NONE | The path where the key can be found. Required if TLS is true. |
| CERTPATH | string | NONE | The path where the certificate can be found. Required if TLS is true. |
| LOGLEVEL | number 0-5 | 0 | The log level of what to print to the log. 0=debug, 1=info, 2=warn, 3=error, 4=cricital, 5=off. Any critical error will result in shutting down the miner (in some cases it may be able to restart itsself, but not always). |
| SENTRYURL | string | NONE | The url for a sentry installation to which any errors are reported if given. |
| WORKERS | number | -1 | Number of processes to spawn for accepting incoming connections. Either a positive number, or 0/a negative number for the number of CPU cores minus that number (at least 1). |
| UPDATEINTERVAL | number | 3 | How often it should check the database for new transactions that it may have to push to listeners (in seconds). |
| TIMEOUT | number | 60 | Interval for keep alive messages in websockets (in seconds). |
| MAXMEMORY | number | 256 | Maximum amount of memory each cluster worker is allowed to use (in MB), if it is higher then that it will automatically be restarted to prevent memory leaks. |
{
"VSERVER_API": "{\"v1\": \"dist/basics/basichandler.js\"}",
"VSERVER_LOGLEVEL": 0,
"VSERVER_WORKERS": 1,
"VSERVER_WSPORT": 8080,
"VSERVER_RESTPORT": 8081,
"VSERVER_UPDATEINTERVAL": 3,
"VSERVER_TIMEOUT": 60,
"VSERVER_DBUSER": "backend",
"VSERVER_DBPASSWORD": "",
"VSERVER_DBNAME": "blockchain",
"VSERVER_DBPORT": 5432,
"VSERVER_MAXMEMORY": 256,
"VSERVER_SENTRYURL": "",
"VSERVER_TLS": false,
"VSERVER_KEYPATH": ""
"VSERVER_CERTPATH": ""
}