Configuration¶
This page explains the possible ways to configure an Aergo node.
There are three common modes of operation for aergo server:
- BP Node - Block provider node, which mines and propagates blocks
- Agent Node - Node to improve security and block propagation of BP node, added since Aergo v2.0
- Watcher Node - Node to get and validate all blocks, previously named to Full Node before Aergo v2.0
- Single Node - BP Node without peer, which uses to something like test.
We describe only single node configuration in this. More will updated for the BP Node and full node.
Single Aergo Server¶
We will show default configuration file next. You can check the each fields’ meaning in here
# aergo TOML Configuration File (https://github.com/toml-lang/toml)
# base configurations
datadir = ".aergo/data"
enableprofile = false
profileport = 6060
enablerest = false
enabletestmode = false
authdir = ".aergo/auth"
[rpc]
netserviceaddr = "127.0.0.1"
netserviceport = 7845
nstls = false
nscacert = ""
nscert = ""
nskey = ""
nsallowcors = false
[rest]
restport = "8080"
[p2p]
# Set address and port to which the inbound peers connect, and don't set loopback address or private network unless used in local network
netprotocoladdr = ""
netprotocolport = 7846
npbindaddr = ""
npbindport = -1
# Set file path of key file
npkey = ""
npaddpeers = [
]
nphiddenpeers = [
]
npmaxpeers = 100
nppeerpool = 100
npexposeself = true
npusepolaris = true
npaddpolarises = [
]
[blockchain]
# blockchain configurations
maxblocksize = 1048576
[mempool]
showmetrics = false
dumpfilepath = ".aergo/mempool.dump"
[consensus]
enablebp = true
Testmode¶
To enable testmode, either pass the command line option --testmode
to aergosvr or set enabletestmode = true
in the configuration.
In testmode, all new accounts are assigned a high number of Aergo tokens by default, basically circumventing balance checks. This means you can send any transaction without first pre-funding hard-coded accounts using a genesis block.
Testmode MUST NOT be used in production.
Reference¶
Module | Property name | Meaning |
---|---|---|
(default) | datadir | data files' base path |
enableprofile | whether use profie | |
profileport | profile port | |
enablerest | whether use REST API | |
enabletestmode | whether test mode | |
personal | enable personal account API | |
rpc | netserviceaddr | rpc hostname or address |
netserviceport | rpc port number | |
nstls | whether applying tls to rpc | |
nscacert | ca certificate file path for rpc tls | |
nscert | certificate file path for rpc tls | |
nskey | key file path for rpc tls | |
nsallowcors | whether allows CORS | |
rest | restport | port number for REST API |
p2p | netprotocoladdr | ip address or domain name to which other peers connect |
netprotocolport | port number for connect | |
npbindaddr | listener binding address | |
npbindport | listener binding port | |
npkey | key file path for p2p tls | |
npaddpeers | initial peer list on start-up | |
nphiddenpeers | peerid list which will not inform to other peers | |
npexposeself | whether to advertise node to Polaris <../tools/polaris.html> __ or other peers. |
|
npdiscoverpeers | whether to discover unknown peers and try connect to them | |
npusepolaris | whether to connect Polaris for finding other peers | |
npaddpolarises | list of addresses of custom polaris | |
peerrole | role of peer. producer, agent or watcher | |
producers | list of peer ids of block producers, valid for agent only | |
internalzones | address ranges of internal zone, valid for agent only | |
agent | peerid of agent, valid for block producer only | |
blockchain | maxblocksize | maximum block size |
coinbaseaccount | address where is send rewards for mining | |
mempool | showmetrics | whether if turn periodic log on |
dumpfilepath | file path for recording mempool at process termination | |
verifiers | number of concurrency for sign verifying | |
consensus | enablebp | whether this node is BP |
Logging options¶
It is possible to customize the log output format of all Aergo CLI tools using a file called arglog.toml
placed in the current working directory.
This file is specified here.
level = "info" # default log level
formatter = "json" # format: console, console_no_color, json
caller = true # enabling source file and line printer
timefieldformat = "RFC3339"
[chain]
level = "info" # optional, log level for 'chain' module
[dpos]
level = "info"
[p2p]
level = "info"
[consensus]
level = "info"
[mempool]
level = "info"
[contract]
level = "info"
[syncer]
level = "info"
[bp]
level = "info"