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.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.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):
./esc \
--allow-insecure-unlock \
--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 '203.0.113.50' \
--pbft.net.port 20639 \
--rpc --rpcaddr '0.0.0.0' \
--rpcapi 'db,eth,net,pbft,personal,txpool,web3' \
--syncmode full \
--unlock '0xYOUR_ADDRESS' \
--ws --wsaddr '0.0.0.0' \
--frozen.account.list '0xD365...,0xA1B2...'
Non-mining mode (RPC node):
./esc \
--datadir data \
--lightserv 10 \
--rpc --rpcaddr '0.0.0.0' \
--rpcapi 'admin,eth,net,txpool,web3' \
--ws --wsaddr '0.0.0.0'
| Flag | Description |
|---|---|
--datadir | Chain data directory |
--mine | Enable block production |
--miner.threads | Number of mining threads (1 for PBFT) |
--pbft.keystore | Path to ELA keystore for PBFT signing |
--pbft.keystore.password | Path to file containing the ELA keystore password |
--pbft.net.address | Public IP for PBFT consensus network |
--pbft.net.port | PBFT consensus port |
--rpc | Enable HTTP RPC |
--rpcaddr | RPC bind address |
--rpcapi | Enabled RPC APIs |
--syncmode | full or snap |
--lightserv | Percentage of time serving light clients (non-mining only) |
--ws | Enable WebSocket RPC |
--wsaddr | WebSocket bind address |
--frozen.account.list | Comma-separated list of frozen/blacklisted addresses |
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.sh ela jsonrpc getcurrentheight
node.sh ela jsonrpc getbestblockhash
node.sh ela jsonrpc "getblockhash 100000"
node.sh ela jsonrpc "getblock HASH 2"
node.sh ela jsonrpc getblockcount
# Network
node.sh ela jsonrpc getconnectioncount
node.sh ela jsonrpc nodestate
node.sh ela jsonrpc getneighbors
# Mempool
node.sh ela jsonrpc getrawmempool
# Wallet
node.sh ela jsonrpc listunspent
# Producer info
node.sh ela jsonrpc listproducers
node.sh ela jsonrpc getdpospeersinfo
# Mining (AuxPoW)
node.sh ela jsonrpc "createauxblock PAYOUT_ADDRESS"
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":[]}'