Custom Network

This section will show you how to customize your node config and genesis file. This will allow you to create a private network for testing your dApp.


You need an installed node.

Create a Custom Network

After you install the node, navigate into aion folder, open an terminal and run:

./ -n custom

This will create you a custom network folder, which includes config, database, keystore and log for your customized network.

Customize Network Configuration

Go to your /custom/config folder, there are two files to help you custom your network, config.xml and genesis.json.


Following is the default config.xml:

<?xml version="1.0" encoding="utf-8"?>
        <!--rpc config docs:>
        <rpc active="false" ip="" port="8545">
            <!--comma-separated list, APIs available: web3,net,debug,personal,eth,stratum-->
        <java active="false" ip="" port="8547">
            <!--default NRG price used by api if oracle disabled, minimum price recommended by oracle-->
            <!--max NRG price recommended by oracle-->
            <!--enable/diable nrg-oracle service. if disabled, api returns default NRG price if asked for nrgPrice-->
        <!--requires show-status=true; comma separated list of options: [all, peer_states, requests, seeds, leeches, responses, none]-->
        <compact enabled="false" slow-import="1000" frequency="600000"></compact>
            <clamped-decay upper-bound="20000000" lower-bound="15000000"></clamped-decay>
        <!--Sets the physical location on disk where data will be stored.-->
        <!--Boolean value. Enable/disable database integrity check run at startup.-->
        <!--Data pruning behavior for the state database. Options: FULL, TOP, SPREAD.-->
        <!--FULL: the state is not pruned-->
        <!--TOP: the state is kept only for the top K blocks; limits sync to branching only within the stored blocks-->
        <!--SPREAD: the state is kept for the top K blocks and at regular block intervals-->
        <!--Database implementation used to store data; supported options: leveldb, h2, rocksdb.-->
        <!--Caution: changing implementation requires re-syncing from genesis!-->
        <!--Boolean value. Enable/disable database compression to trade storage space for execution time.-->
        <!--Enable/Disable logback service; if disabled, output will not be logged.-->
        <!--Sets the physical location on disk where log files will be stored.-->

First, enable rpc connection so that your dApp can talk to this node via Json RPC by changing active="false" to active=true.

If you want to talk to this node remotely, change ip="" to ip="".

If you are using minified aion web3.js to interact with the network, update <cors-enabled> to true.

For example, if your dApp is talking to this node remotely with minified web3.js injected in your web application, your config should looks like:

 <rpc active="true" ip="" port="8545">
        <!--comma-separated list, APIs available: web3,net,debug,personal,eth,stratum-->

Next thing you may want to update is the mining reward address. Change <miner-address> to your address, so it can get AION through mining the blocks.

Last thing you can custom is how verbose you want your logs to be in <log> section. Ranking from the least verbose to the most:ERROR < WARN < INFO < DEBUG < Trace.

Note: You need to restart your kernel if you change anything in the config file.


genesis.json defines the genesis block of your network.

Here is the default genesis file:

  "alloc": {
    "0x0000000000000000000000000000000000000000000000000000000000000000": {
      "balance": "465934586660000000000000000"
  "networkBalanceAllocs": {
    "0": {
      "balance": "465934586660000000000000000"
  "energyLimit": "15000000",
  "nonce": "0x00",
  "difficulty": "0x0010",
  "coinbase": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": "1525924800",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "chainId": "0"

Before you start the kernel for the first time, you can allocate your accounts with initial balances by add the account and the desired balance in alloc block. By doing so, you can have multiple accounts with sufficient balance, instead of only have one account and waiting for mining reward.

You can also reset the kernel by deleting the database folder for your custom network. Then restart the kernel with the new genesis file.