Skip to main content
HOW-TO
ALL CHAINS

Node Configuration Reference

Global Configuration

File: ~/.config/elastos/node.json

{
"chain-type": "mainnet"
}
FieldValuesDescription
chain-typemainnet, testnetDetermines 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:

ParameterDefaultDescription
DPoSConfiguration.EnableArbitertrueEnable BPoS consensus participation
DPoSConfiguration.IPAddressAuto-detectedYour server's public IP address
EnableRPCtrueEnable JSON-RPC interface
RpcConfiguration.UserRandom 32-charRPC authentication username
RpcConfiguration.PassRandom 32-charRPC authentication password
RpcConfiguration.WhiteIPList["127.0.0.1"]IP addresses allowed to access RPC
HttpRestPort20334RESTful API port
HttpJsonPort20336JSON-RPC port
NodePort20338P2P network port
PrintLevel1Log verbosity (0=debug, 1=info, 2=warn, 3=error, 4=fatal)
MinCrossChainTxFee10000Minimum cross-chain transaction fee in sela (1 ELA = 10^8 sela)
PowConfiguration.PayToAddrEmptyAuxPoW mining reward address
PowConfiguration.AutoMiningfalseEnable solo mining (not for merged mining)

TestNet additions:

{
"Configuration": {
"ActiveNet": "testnet",
"Magic": 2018101
}
}

BPoS-specific parameters (in full config):

ParameterDescription
DPoSConfiguration.MagicBPoS network magic number
DPoSConfiguration.DPoSPortBPoS consensus port (default 20339)
CRCArbitersList of Elastos Council arbiter public keys
CheckAddressHeightBlock height at which address format checking activates
VoteStartHeightBlock height at which voting becomes active
CRCOnlyDPOSHeightBlock height for Elastos Council-only BPoS transition
NewCrossChainStartHeightBlock 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 '*'
FlagDescription
--datadirChain data directory
--mine, --miner.threadsBlock production (mining mode only; PBFT uses 1 thread)
--pbft.keystore[.password]ELA keystore + password file for PBFT signing
--pbft.net.addressConsensus address — $(extip), auto-detected (not hardcoded)
--pbft.net.portPBFT consensus port (20639)
--rpcaddr / --wsaddrRPC/WS bind — $(evm_rpc_bind), 127.0.0.1 by default (see below)
--rpcapiRPC namespaces — eth,net,web3,txpool (+ pbft mining-only). admin, db, personal are never enabled.
--rpcvhosts / --wsoriginsAccepted Host / Origin headers (*)
--syncmode fullMining mode only; the RPC branch passes no --syncmode
--lightservLight-client serving budget (RPC / non-mining only)
--frozen.account.listProtocol 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:

ParameterMainNetTestNet
Chain ID2021
RPC Port2063621636
WS Port2063221632
P2P Port2063821638
PBFT Port2063921639

EID Configuration

Identical structure to ESC with different ports and chain ID:

ParameterMainNetTestNet
Chain ID2223
RPC Port2064621646
WS Port2064221642
P2P Port2064821648
PBFT Port2064921649

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
}
}
ParameterDescription
MainNode.RpcConnection details for the ELA main chain node
SideNodeList[].NameSidechain identifier
SideNodeList[].Rpc.HttpJsonPortSidechain oracle/RPC port
SideNodeList[].SyncStartHeightBlock height to start syncing from (optimization)
SideNodeList[].ExchangeRateCross-chain exchange rate (always 1.0 for ELA)
SideNodeList[].SupportQuickRechargeEnable fast deposits
SideNodeList[].SupportInvalidDepositHandle invalid deposit recovery
SideNodeList[].SupportNFTEnable NFT cross-chain transfers
SideNodeList[].PowChainWhether 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/:

FileContentsUsed By
node.jsonNetwork type (mainnet/testnet)All components
ela.txtELA keystore passwordELA, Arbiter, ESC/EID PBFT signing
esc.txtESC keystore passwordESC mining mode
eid.txtEID keystore passwordEID mining mode
pg.txtPG keystore passwordPG 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":[]}'