Configuration
The configuration file locations are config.json for mainnet and test/config.json for testnet:
├── config.json
└── test
└── config.jsonYou can copy the configuration files from the default templates.
For mainnet:
shcp config.default.json config.jsonFor testnet:
shcp test/config.default.json test/config.jsonYou can learn more about testnet on the Testnet page.
Configuration Overrides
You can override specific configuration values at startup without editing config.json or test/config.json directly. Overrides are applied in this order: selected config file → each --config-overrides file in command-line order → repeated --config-set values → legacy CLI shortcuts (--port, --address, --peers, --log, --snapshot). The final resolved config is validated against the node config schema before startup.
Use --config-set for individual dot-path values:
node app.js \
--config test/config.json \
--genesis test/genesisBlock.json \
--config-set consensusActivationHeights.fairSystem=4359465 \
--config-set 'redis={ "url": "redis://127.0.0.1:6379/1", "password": null }'The same flags work through npm scripts:
npm run start -- --config-set port=36667
npm run start:testnet -- --config-set api.access.public=trueUse --config-overrides for a file with multiple overrides. Non-.json files are parsed as env-style key=value pairs (one per line):
consensusActivationHeights.fairSystem=4359465
redis={ "url": "redis://127.0.0.1:6379/1", "password": null }Files ending in .json are parsed as nested JSON partial overrides:
{
"consensusActivationHeights": {
"fairSystem": 4359465
},
"redis": {
"url": "redis://127.0.0.1:6379/1",
"password": null
}
}Values are parsed as JSON first, so numbers, booleans, null, arrays, and objects keep their types. Unknown paths, malformed values, and schema-invalid values fail before startup.
WARNING
Be careful when overriding consensusActivationHeights.*: using activation heights that do not match the selected network can make a node diverge from that network. See Consensus for details on consensus activation.
Logging
The node has three configurable log outputs: a general log, a debug log, and console output.
General Log
Configures the main log file with
generalLog:json{ "generalLog": { "enabled": true, "fileName": "logs-mainnet/adamant.log", "level": "warn", "rotate": { "enabled": true, "maxSize": "300M", "retain": 5, "rotateInterval": "0 0 0 1 *", "rotateOnRestart": true } } }enabled: Enable or disable this log output.fileName: Path to the log file. You can use.log,.txt, or any other extension.level: Minimum log level to write.rotate.enabled: Enable log rotation.rotate.maxSize: Maximum log file size before rotation (e.g.,"300M").rotate.retain: Number of rotated files to keep.rotate.rotateInterval: Cron expression for scheduled rotation.rotate.rotateOnRestart: Rotate the log file on every node restart.
Debug Log
Configures a verbose debug log file with
debugLog. Accepts the same properties asgeneralLog. Typically set tolevel: "trace"to capture all output.json{ "debugLog": { "enabled": true, "fileName": "logs-mainnet/adamant_debug.log", "level": "trace", "rotate": { "enabled": true, "maxSize": "300M", "retain": 7, "rotateInterval": "0 0 * * *", "rotateOnRestart": true } } }Console Log
Configures logging to standard output with
consoleLog:json{ "consoleLog": { "enabled": true, "level": "info" } }enabled: Enable or disable console output.level: Minimum log level to print.
Possible log levels (from least to most verbose):
fatalerrorwarninfologdebugtracenone— disables all output for that target
Server Configuration
Port
Specify the server's API port with the
portproperty:json{ "port": 36666 }Address
Define the server's listening address using the
addressproperty:json{ "address": "0.0.0.0" }Example:
0.0.0.0(binds to all network interfaces).Trust Proxy
Enable or disable trusting proxy headers using the
trustProxyproperty:json{ "trustProxy": false }Cache
Enable the in-memory Redis cache for API responses with
cacheEnabled:json{ "cacheEnabled": false }Cache is disabled by default on mainnet and enabled on testnet. Enabling it can improve API response times for high-traffic public nodes.
Top Accounts
Enable the
/api/accounts/topendpoint (returns accounts sorted by balance) withtopAccounts:json{ "topAccounts": false }This endpoint is disabled by default on mainnet. Enabling it on a high-traffic node may have a performance impact.
Database Configuration
Database Connection
Configure database connection settings with the
dbobject:json{ "db": { "host": "localhost", "port": 5432, "database": "adamant_main", "user": "adamant", "password": "password", "poolSize": 95, "poolIdleTimeout": 30000, "reapIntervalMillis": 1000, "logEvents": ["error"] } }host: Database host (e.g.,localhost).port: Database port (e.g.,5432).database: Name of the database (e.g.,adamant_main).user: Database username (e.g.,adamant).password: Database password.poolSize: Number of connections in the pool (recommended:95).poolIdleTimeout: Time (ms) before idle connections close (recommended:30000).reapIntervalMillis: Interval (ms) to clean idle connections (recommended:1000).logEvents: List of events to log (e.g.,["error"]).
Redis Configuration
Redis is used for caching. Required.
Redis Connection
Configure Redis connection settings with the
redisobject:json{ "redis": { "url": "redis://127.0.0.1:6379/0", "password": null } }url: Redis server URL (e.g.,redis://127.0.0.1:6379/0).password: Redis password (string ornull).
API Configuration
NOTE
Even when a node's Public API is disabled (including api.enabled = false, api.access.public = false), other nodes can still connect to it for block exchange — such nodes still participate in blockchain synchronization.
WARNING
Nodes with a Public API, used by applications, require more CPU since they execute many SQL queries.
API Settings
Control Public API behavior with the
apiobject:json{ "api": { "enabled": true, "access": { "public": false, "whiteList": ["127.0.0.1"] }, "options": { "limits": { "max": 0, "delayMs": 0, "delayAfter": 0, "windowMs": 60000 } } } }enabled: Enable or disable the Public API (e.g.,true).access.public: Allow public API access for any IP address (recommended:false).access.whiteList: List of allowed IP addresses ifaccess.publicisfalse(e.g.,["127.0.0.1"]).options.limits: API rate-limiting options:max: Max requests per window (e.g.,0, unlimited).delayMs: Delay (ms) before responding to requests (e.g.,0).delayAfter: Start delaying after N requests (e.g.,0).windowMs: Time window for rate limits (e.g.,60000).
Peer Configuration
Peer Settings
Configure peer connections with the
peersobject:json{ "peers": { "enabled": true, "list": [ { "ip": "95.216.114.252", "port": 36666 }, { "ip": "149.102.157.15", "port": 36666 } ], "access": { "blackList": [] }, "options": { "limits": { "max": 0, "delayMs": 0, "delayAfter": 0, "windowMs": 60000 }, "timeout": 5000 } } }enabled: Enable or disable peer connections (default:true).list: List of peer IPs and ports. See the full list in config.default.json.access.blackList: List of blocked IPs (e.g.,["222.222.222.222"]).options.limits: Peer rate-limiting options:max: Max requests per window (e.g.,0, unlimited).delayMs: Delay (ms) before responding (e.g.,0).delayAfter: Start delaying after N requests (e.g.,0).windowMs: Time window for rate limits (e.g.,60000).
options.timeout: Peer connection timeout (ms, default:5000).
Broadcast Configuration
Broadcast Settings
Control broadcast behavior with the
broadcastsobject:json{ "broadcasts": { "broadcastInterval": 1500, "broadcastLimit": 20, "parallelLimit": 20, "releaseLimit": 25, "relayLimit": 4 } }broadcastInterval: The interval (in ms) at which the node broadcasts unconfirmed transactions (recommended:1500).broadcastLimit: The number of peers a node broadcasts to per interval (recommended:20).parallelLimit: The maximum number of asynchronous requests the node can make when broadcasting (recommended:20).- Example: If
parallelLimit = 5andbroadcastLimit = 10, the node will first send transactions to 5 peers asynchronously, then process another 5.
- Example: If
releaseLimit: The number of transactions, blocks, and signatures included in each broadcast (recommended:25).- Example: If 10 transactions are waiting to be broadcast and
releaseLimit = 5, only 5 will be sent in the next broadcast.
- Example: If 10 transactions are waiting to be broadcast and
relayLimit: The maximum relay count at which a node will still broadcast an unconfirmed transaction (recommended:4).- Example: If a transaction has already been broadcast to 5 nodes and
relayLimit = 4, the node will process the transaction but will not broadcast it further.
- Example: If a transaction has already been broadcast to 5 nodes and
Transaction Configuration
Transaction Queue
Control transaction queue size with the
transactionsobject:json{ "transactions": { "maxTxsPerQueue": 1000 } }maxTxsPerQueue: Max transactions per queue (recommended:1000).
Consensus Activation Heights
The consensusActivationHeights object defines the block heights at which consensus upgrades become active:
{
"consensusActivationHeights": {
"fairSystem": 4359465,
"spaceship": 100000000
}
}fairSystem: Height at which the Fair dPoS voting system activates. On mainnet, this is4359465. See Consensus for details.spaceship: Height at which thetimestampMsfield is preserved in transactions. On mainnet, this is100000000(far future; already activated on testnet). See Consensus for details.
These values match the mainnet network. Do not change them for a mainnet node, as mismatched heights will cause the node to diverge from the network. For testnet or localnet experimentation, you can override these values using configuration overrides.
Forging Configuration
Forging Settings
Configure forging behavior with the
forgingobject:json{ "forging": { "force": false, "secret": [], "access": { "whiteList": ["127.0.0.1"] } } }force: Force forging regardless of network state (default:false).secret: List of forging passphrases.access.whiteList: Allowed forging IPs (e.g.,["127.0.0.1"]).
Loading Configuration
Loading Settings
Control blockchain rebuilding in case of invalid data in the database with the
loadingobject:json{ "loading": { "loadPerIteration": 5000 } }loadPerIteration: Max blocks to verify per iteration (recommended:5000).
SSL Configuration
SSL Settings
Configure SSL options with the
sslobject:json{ "ssl": { "enabled": false, "options": { "port": 443, "address": "0.0.0.0", "key": "./ssl/adamant.key", "cert": "./ssl/adamant.crt" } } }enabled: Enable or disable SSL (e.g.,false).options.port: SSL port (e.g.,443).options.address: Listening address for SSL (e.g.,0.0.0.0).options.key: Path to SSL key file.options.cert: Path to SSL certificate file.
DApp Configuration
DApp Settings
Control DApp settings with the
dappobject:json{ "dapp": { "masterrequired": true, "masterpassword": "", "autoexec": [] } }masterrequired: Require master password for DApp execution (recommended:true).masterpassword: Master password (e.g.,"").autoexec: List of auto-executable scripts (e.g.,[]).
WebSocket Client Configuration
WebSocket Client
Configure WebSocket client settings with the
wsClientobject:json{ "wsClient": { "enabled": true, "portWS": 36668 } }enabled: Enable or disable WebSocket client (e.g.,true).portWS: WebSocket client port (e.g.,36668for mainnet,36665for testnet).
WebSocket Node Configuration
WebSocket Node
Configure WebSocket node-to-node connection for syncing with the
wsNodeobject:json{ "wsNode": { "enabled": true, "maxBroadcastConnections": 15, "maxReceiveConnections": 25 } }enabled: Enable or disable WebSocket node-to-node communication.maxBroadcastConnections: Maximum number of outbound WebSocket connections used to broadcast data to other nodes.maxReceiveConnections: Maximum number of inbound WebSocket connections from other nodes.
Nethash Configuration
Nethash
The
nethashproperty represents the unique identifier for the blockchain network. It ensures the application connects to the correct network and prevents accidental cross-network operations (e.g., mixing transactions betweenmainnetandtestnet).Example configuration for mainnet:
json{ "nethash": "bd330166898377fb28743ceef5e43a5d9d0a3efd9b3451fb7bc53530bb0a6d64" }Example configuration for testnet:
json{ "nethash": "38f153a81332dea86751451fd992df26a9249f0834f72f58f84ac31cceb70f43" }You can find or verify the
nethashusing the genesis block (genesisBlock.jsonortest/genesisBlock.jsonbased on your blockchain network). The node derivesnethashfromgenesisBlock.payloadHash— the SHA-256 payload hash verified from the genesis block transactions. It is not a random identifier.
CORS
CORS
By default, ADAMANT Node allows any origin to make requests. You can control CORS with the
corsobject inconfig.json, which accepts the following properties:origin: Configures the Access-Control-Allow-Origin CORS header. Possible values:Boolean— setorigintotrueto reflect the request origin, or set it tofalseto disable CORS.String— setoriginto a specific origin. For example,"http://example.com"allows only requests from that origin.Array— setoriginto an array of valid origins. For example["http://example1.com", "http://example2.com/"].
methods: Configures the Access-Control-Allow-Methods CORS header. Expects a comma-delimited string (e.g.,'GET,PUT,POST') or an array (e.g.,['GET', 'PUT', 'POST']).
Example:
json{ "cors": { "origin": "http://example1.com", "methods": "GET,PUT,POST" } }