Node Configuration Reference
Global Configuration
File: ~/.config/elastos/node.json
{
"chain-type": "mainnet"
}
| Field | Values | Description |
|---|---|---|
chain-type | mainnet, testnet | Determines which network to connect to. Set during ~/node/node.sh init. Affects port ranges, seed nodes, genesis blocks, and download URLs. |
This file is created by init_config() the first time you run ~/node/node.sh init. Changing it after initialization has no effect; you must reinitialize components to switch networks.
ELA Main Chain Configuration
File: ~/node/ela/config.json
Auto-generated during ela init. The structure:
{
"Configuration": {
"DPoSConfiguration": {
"EnableArbiter": true,
"IPAddress": "203.0.113.50"
},
"EnableRPC": true,
"RpcConfiguration": {
"User": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"Pass": "q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2",
"WhiteIPList": ["127.0.0.1"]
},
"HttpRestPort": 20334,
"HttpJsonPort": 20336,
"NodePort": 20338,
"PrintLevel": 1,
"MaxLogsSize": 0,
"MaxPerLogSize": 0,
"MinCrossChainTxFee": 10000,
"PowConfiguration": {
"PayToAddr": "",
"AutoMining": false,
"MinerInfo": "ELA"
}
}
}
Key parameters:
| Parameter | Default | Description |
|---|---|---|
DPoSConfiguration.EnableArbiter | true | Enable BPoS consensus participation |
DPoSConfiguration.IPAddress | Auto-detected | Your server's public IP address |
EnableRPC | true | Enable JSON-RPC interface |
RpcConfiguration.User | Random 32-char | RPC authentication username |
RpcConfiguration.Pass | Random 32-char | RPC authentication password |
RpcConfiguration.WhiteIPList | ["127.0.0.1"] | IP addresses allowed to access RPC |
HttpRestPort | 20334 | RESTful API port |
HttpJsonPort | 20336 | JSON-RPC port |
NodePort | 20338 | P2P network port |
PrintLevel | 1 | Log verbosity (0=debug, 1=info, 2=warn, 3=error, 4=fatal) |
MinCrossChainTxFee | 10000 | Minimum cross-chain transaction fee in sela (1 ELA = 10^8 sela) |
PowConfiguration.PayToAddr | Empty | AuxPoW mining reward address |
PowConfiguration.AutoMining | false | Enable solo mining (not for merged mining) |
TestNet additions:
{
"Configuration": {
"ActiveNet": "testnet",
"Magic": 2018101
}
}
BPoS-specific parameters (in full config):
| Parameter | Description |
|---|---|
DPoSConfiguration.Magic | BPoS network magic number |
DPoSConfiguration.DPoSPort | BPoS consensus port (default 20339) |
CRCArbiters | List of Elastos Council arbiter public keys |
CheckAddressHeight | Block height at which address format checking activates |
VoteStartHeight | Block height at which voting becomes active |
CRCOnlyDPOSHeight | Block height for Elastos Council-only BPoS transition |
NewCrossChainStartHeight | Block height for new cross-chain protocol |
ESC Configuration
ESC (and all sidechain geth forks) use command-line flags rather than a config file. The flags are hardcoded in node.sh.
Mining mode (BPoS supernode — when ~/.config/elastos/esc.txt exists):
./esc \
--datadir ~/node/esc/data \
--mine --miner.threads 1 \
--password ~/.config/elastos/esc.txt \
--pbft.keystore ~/node/ela/keystore.dat \
--pbft.keystore.password ~/.config/elastos/ela.txt \
--pbft.net.address "$(extip)" --pbft.net.port 20639 \
--rpc --rpcaddr "$(evm_rpc_bind)" --rpcapi 'eth,net,web3,txpool,pbft' --rpcvhosts '*' \
--ws --wsaddr "$(evm_rpc_bind)" --wsorigins '*' \
--syncmode full \
--frozen.account.list 0x... # repeated, one flag per address (protocol list)
Block sealing uses the PBFT keystore — node.sh does not pass --unlock or --allow-insecure-unlock, so no account is left unlocked for RPC. When a cold reward address is set with ~/node/node.sh reward set 0x..., node.sh additionally passes --pbft.miner.address.
Light-serve mode (RPC node — no esc.txt):
./esc \
--datadir ~/node/esc/data \
--lightserv 10 \
--rpc --rpcaddr "$(evm_rpc_bind)" --rpcapi 'eth,net,web3,txpool' --rpcvhosts '*' \
--ws --wsaddr "$(evm_rpc_bind)" --wsorigins '*'
| Flag | Description |
|---|---|
--datadir | Chain data directory |
--mine, --miner.threads | Block production (mining mode only; PBFT uses 1 thread) |
--pbft.keystore[.password] | ELA keystore + password file for PBFT signing |
--pbft.net.address | Consensus address — $(extip), auto-detected (not hardcoded) |
--pbft.net.port | PBFT consensus port (20639) |
--rpcaddr / --wsaddr | RPC/WS bind — $(evm_rpc_bind), 127.0.0.1 by default (see below) |
--rpcapi | RPC namespaces — eth,net,web3,txpool (+ pbft mining-only). admin, db, personal are never enabled. |
--rpcvhosts / --wsorigins | Accepted Host / Origin headers (*) |
--syncmode full | Mining mode only; the RPC branch passes no --syncmode |
--lightserv | Light-client serving budget (RPC / non-mining only) |
--frozen.account.list | Protocol frozen-address list — a repeated flag, one address per occurrence (not comma-separated) |
RPC binding (evm_rpc_bind)
EVM chains bind RPC/WS to evm_rpc_bind, which defaults to 127.0.0.1 (localhost only). Override it persistently via the ~/.config/elastos/evm_rpc_bind file, or for one session via the EVM_RPC_BIND env var; an invalid value fails closed to 127.0.0.1. For internet exposure, keep the loopback bind and front it with a reverse proxy — see Run an ESC RPC Node → Expose it for production.
ESC network parameters:
| Parameter | MainNet | TestNet |
|---|---|---|
| Chain ID | 20 | 21 |
| RPC Port | 20636 | 21636 |
| WS Port | 20632 | 21632 |
| P2P Port | 20638 | 21638 |
| PBFT Port | 20639 | 21639 |
EID Configuration
Identical structure to ESC with different ports and chain ID:
| Parameter | MainNet | TestNet |
|---|---|---|
| Chain ID | 22 | 23 |
| RPC Port | 20646 | 21646 |
| WS Port | 20642 | 21642 |
| P2P Port | 20648 | 21648 |
| PBFT Port | 20649 | 21649 |
Arbiter Configuration
File: ~/node/arbiter/config.json
Auto-generated during arbiter init. Requires ELA, ESC, and EID to be initialized first.
{
"Configuration": {
"MainNode": {
"Rpc": {
"IpAddress": "127.0.0.1",
"HttpJsonPort": 20336,
"User": "ela_rpc_user",
"Pass": "ela_rpc_pass"
}
},
"SideNodeList": [
{
"Name": "ESC",
"Rpc": {
"IpAddress": "127.0.0.1",
"HttpJsonPort": 20632
},
"SyncStartHeight": 17886000,
"ExchangeRate": 1.0,
"SupportQuickRecharge": true,
"SupportInvalidDeposit": true,
"SupportNFT": true,
"PowChain": false
},
{
"Name": "EID",
"Rpc": {
"IpAddress": "127.0.0.1",
"HttpJsonPort": 20642
},
"SyncStartHeight": 9611000,
"ExchangeRate": 1.0,
"SupportQuickRecharge": true,
"SupportInvalidDeposit": true,
"SupportNFT": false,
"PowChain": false
},
{
"Name": "PG",
"Rpc": {
"IpAddress": "127.0.0.1",
"HttpJsonPort": 20672
},
"SyncStartHeight": 0,
"ExchangeRate": 1.0
}
],
"RpcConfiguration": {
"User": "arbiter_rpc_user",
"Pass": "arbiter_rpc_pass",
"WhiteIPList": ["127.0.0.1"]
},
"HttpJsonPort": 20536,
"HttpRestPort": 20538
}
}
| Parameter | Description |
|---|---|
MainNode.Rpc | Connection details for the ELA main chain node |
SideNodeList[].Name | Sidechain identifier |
SideNodeList[].Rpc.HttpJsonPort | Sidechain oracle/RPC port |
SideNodeList[].SyncStartHeight | Block height to start syncing from (optimization) |
SideNodeList[].ExchangeRate | Cross-chain exchange rate (always 1.0 for ELA) |
SideNodeList[].SupportQuickRecharge | Enable fast deposits |
SideNodeList[].SupportInvalidDeposit | Handle invalid deposit recovery |
SideNodeList[].SupportNFT | Enable NFT cross-chain transfers |
SideNodeList[].PowChain | Whether the sidechain uses PoW (false for all current sidechains) |
Oracle Configuration
Oracles are Node.js processes with no separate configuration file. They read environment variables and connect to their parent sidechain:
export env=mainnet # or testnet
node crosschain_oracle.js # ESC oracle
node crosschain_eid.js # EID oracle
The oracle binaries and their npm dependencies are downloaded during init via chain_prepare_stage.
Credential Files
All credential files are stored with chmod 600 under ~/.config/elastos/:
| File | Contents | Used By |
|---|---|---|
node.json | Network type (mainnet/testnet) | All components |
ela.txt | ELA keystore password | ELA, Arbiter, ESC/EID PBFT signing |
esc.txt | ESC keystore password | ESC mining mode |
eid.txt | EID keystore password | EID mining mode |
pg.txt | PG keystore password | PG mining mode |
RPC API Quick Reference
ELA Main Chain RPC
# Blockchain queries
~/node/node.sh ela jsonrpc getcurrentheight
~/node/node.sh ela jsonrpc getbestblockhash
~/node/node.sh ela jsonrpc "getblockhash 100000"
~/node/node.sh ela jsonrpc "getblock HASH 2"
~/node/node.sh ela jsonrpc getblockcount
# Network
~/node/node.sh ela jsonrpc getconnectioncount
~/node/node.sh ela jsonrpc nodestate
~/node/node.sh ela jsonrpc getneighbors
# Mempool
~/node/node.sh ela jsonrpc getrawmempool
# Wallet
~/node/node.sh ela jsonrpc listunspent
# Producer info
~/node/node.sh ela jsonrpc listproducers
~/node/node.sh ela jsonrpc getdpospeersinfo
# Mining (AuxPoW)
~/node/node.sh ela jsonrpc "createauxblock PAYOUT_ADDRESS"
~/node/node.sh ela jsonrpc "submitauxblock HASH AUXPOW_HEX"
ESC/EID RPC (Standard Ethereum JSON-RPC)
# Block number
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
# Get balance
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xADDRESS","latest"],"id":1}'
# Send raw transaction
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xSIGNED_TX"],"id":1}'
# Get transaction receipt
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0xTX_HASH"],"id":1}'
# Gas price
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}'
# Chain ID
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}'
# Syncing status
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'
# Peer count
curl -s http://127.0.0.1:20636 \
-d '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}'
# WebSocket subscription (block headers)
wscat -c ws://127.0.0.1:20632 \
-x '{"jsonrpc":"2.0","method":"eth_subscribe","params":["newHeads"],"id":1}'
Arbiter RPC
# Query arbiter status via its RPC port
curl -s http://127.0.0.1:20536 \
-H "Content-Type: application/json" \
-d '{"method":"getinfo","params":[]}'