Skip to main content
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.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:

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):

./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'
FlagDescription
--datadirChain data directory
--mineEnable block production
--miner.threadsNumber of mining threads (1 for PBFT)
--pbft.keystorePath to ELA keystore for PBFT signing
--pbft.keystore.passwordPath to file containing the ELA keystore password
--pbft.net.addressPublic IP for PBFT consensus network
--pbft.net.portPBFT consensus port
--rpcEnable HTTP RPC
--rpcaddrRPC bind address
--rpcapiEnabled RPC APIs
--syncmodefull or snap
--lightservPercentage of time serving light clients (non-mining only)
--wsEnable WebSocket RPC
--wsaddrWebSocket bind address
--frozen.account.listComma-separated list of frozen/blacklisted addresses

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.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":[]}'