-
Notifications
You must be signed in to change notification settings - Fork 1
Config
Wouter den Bakker edited this page Nov 28, 2019
·
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 VNODE_
| Name | Type | Default | Description |
|---|---|---|---|
| ENCRYPTIONKEY | string | NONE | The encryption key used to communicate between nodes. If used only those who have the key can see what data is in the blockchain and who is participating. As processor choose a random length 64 hex string. |
| DBPASSWORD | string | NONE | The password used to connect to the database. |
| DBUSER | string | processor | 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. |
| 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 processor (in some cases it may be able to restart itsself, but not always). |
| LOGFORMAT | string | The format used for logging. Defaults to '$color$timestamp: $message: $error'. Option $severity is also available.' | |
| SENTRYURL | string | NONE | The url for a sentry installation to which any errors are reported if given. |
| LISTENPORT | number | NONE | If given it will listen on this port for incoming connections from other nodes. Otherwise a random available port is used. |
| MAXMEMORYNODE | number | 512 | The maximum amount of memory the node is allowed to use (in MB) for verifying blocks. If it exceeds this number it will automatically restart itsself. |
| MAXMEMORYNETWORK | number | 512 | The maximum amount of memory the node is allowed to use (in MB) for downloading and sharing blocks. If it exceeds this number it will automatically restart itsself. |
| MAXPEERS | number | 20 | The maximum number of peers it will connect to at once. A higher number can increase the download speed, but will also increase how much is uploaded. |
| PEERTIMEOUT | number | 60 | How long (in seconds) to wait after disconnecting from a peer (e.g. due to problems with connection) before we will try again. |
If the node is the processor node:
| Name | Type | Default | Description |
|---|---|---|---|
| ISPROCESSOR | boolean | false | Whether this node is the processor node or not. Set this to true! |
| SIGNPREFIX | string | NONE | The prefix used to ensure a message is never valid on multiple blockchains. |
| TLS | boolean | true | Whether to use https/wss instead of http/ws. If you use a reverse proxy set this to false. |
| CERTPATH | string | NONE | In case TLS is true this is required. Set this to the path where the certificate can be found. |
| KEYPATH | string | NONE | In case TLS is true this is required. Set this to the path where the key can be found. |
| PROCESSORPORT | number | 443 | The port on which this nodes listens to requests for other nodes about information. |
| NODEVERSION | string | 12 | The version of nodejs that is required when running the node. If no minor or patch version is defined (or it is x) it will ignore that when determining whether it is equal or not. The node requires at least 7.6 to run. The processor and nodes should all run the same version. |
| REMEMBERPEER | number | 168 | The number of hours it should remember a node that requests information. When a new node requests information it will only give nodes that it still remembers, that are currently connected or itsself. |
| BLOCKINTERVAL | number | 65 | How often the processor processes a new block (in seconds). |
| MAXBLOCKSIZE | number | 1 000 000 | The maximum size of a block (in bytes). |
| LATESTEXISTINGBLOCK | number | -1 | The id of the last existing block. If a higher blocks if found in the database it will use that number instead, but if you are certain there are more blocks (e.g. due to data lose they are no longer in the database) you can increase this number. |
If the node is NOT the processor node:
| Name | Type | Default | Description |
|---|---|---|---|
| ISPROCESSOR | boolean | false | Whether this node is the processor node or not. Set this to false. |
| PUBLICKEY | string | NONE | The public key of the processor. Used to validate whether a block is signed by the processor. Should be provided by the processor. |
| PROCESSORHOST | string | NONE | The host where the processor node is running. Should be provided by the processor. |
| PROCESSORPORT | number | 443 | The port on which the processor node is running. Should be provided by the processor. |
| TLS | boolean | true | Whether to use https/wss instead of http/ws. Should be provided by the processor, though it is safe to assume it is true. |
| MAXOUTSTANDINGBLOCKS | number | 500 | The maximum number of blocks it will try to download before pausing till they are finished downloading and stored in the database. Increases memory usage so be sure to increase MAXMEMORYNETWORK as well. |
| MINDOWNLOADSPEED | number | 10 | The minimum download speed other peers should have (in KB/s), otherwise we drop this peer. |
| MINPEERS | number | 5 | The minimum number of peers it tries to maintain. |
{
"VNODE_ENCRYPTIONKEY": "",
"VNODE_DBPASSWORD": "",
"VNODE_DBNAME": "blockchain_node",
"VNODE_DBHOST": "localhost",
"VNODE_DBPORT": 5432,
"VNODE_SENTRYURL": "",
"VNODE_LOGLEVEL": 0,
"VNODE_LOGFORMAT": "$color$timestamp: $message: $error",
"VNODE_MAXMEMORYNODE": 512,
"VNODE_MAXMEMORYNETWORK": 512,
"VNODE_LISTENPORT": 0,
"VNODE_MINPEERS": 5,
"VNODE_MAXPEERS": 20,
"VNODE_PEERTIMEOUT": 60,
"VNODE_REMEMBERPEER": 168,
"VNODE_LATESTEXISTINGBLOCK": -1,
"VNODE_BLOCKINTERVAL": 65,
"VNODE_MAXBLOCKSIZE": 1000000,
"VNODE_ISPROCESSOR": false,
"VNODE_TLS": true,
"VNODE_PUBLICKEY": "",
"VNODE_PROCESSORHOST": "",
"VNODE_PROCESSORPORT": 443,
"VNODE_SIGNPREFIX": "",
"VNODE_MAXOUTSTANDINGBLOCKS": 500,
"VNODE_MINDOWNLOADSPEED": 10
}