Advanced
How to run a Node on Aion Network?
Node Set-Up
The first step to mining or building on Aion is to run your own node (unless you will be connecting with a node virtually). This will allow you to sync and interact with the main Aion blockchain.
Aion Node
The steps below will take you through a basic set-up, account creation, and sync on the Aion mainnet. You can also configure your node to:
-
run on the Aion Mastery Testnet (for development purposes)
-
run a local, private blockchain
-
debug and display additional kernel information
System Requirements
Before we begin, make sure you have the following:
-
Ubuntu 16.04 or a later version (installation tutorial here)
-
8GB RAM
-
CPU need to support SSE4.2
Get the Aion Node
Start by downloading the most recent Aion binary file aion-{version}.tar.bz2 here.
Once you have the binary file, you will need to unarchive the contents in your chosen destination using one of two methods:
-
right click the binary file and select “Extract Here”
-
or open a terminal in the same directory and run:
tar xvjf aion-{version}.tar.bz2
A folder named aion will be created in the chosen directory.
Create an Account
Account addresses are required for mining and sending transactions. An address is a hashed representation of your publicKey, prefixed with an identifier “0xa0”.
-
Go to aion directory
-
Open a terminal and run:
./aion.sh -a create
- Input your chosen password once prompted (note that your password will not appear on terminal as you are typing it)
- Copy and save the created account address shown
After account creation, an associated keystore file is generated and placed in the aion/keystore directory. Each keystore file name contains the account address and the file can be referred to in case of lost address.
Backup your keystore folder
You should backup the keystore folder to ensure you do not lose access to your accounts; there is no recovery mechanism for the lost keys.
Launch Node
Begin syncing your node with the Aion network.
-
Navigate to the aion directory
-
Open a terminal and run:
./aion.sh
Mastery Testnet
This testnet environment was released with the latest v0.3.0 Moldoveanu Peak mainnet. You may wish to to configure your Aion node here to deploy and test out smart contracts.
Suggest Edits
This is the guide for the Aion Mastery testnet.
If you don’t have an existing testnet you wish to migrate, you can:
-
Download Mastery here
-
Extract the files and navigate into the aion directory
-
Launch the testnet kernel by running:
This will begin syncing your node from genesis. Note that any changes made to config.xml requires you to re-deploy the node.
Reset Configuration Settings
If your configuration settings are broken, or if you just want to start with a fresh configuration file with the default settings, you can reset the file:
-
Remove the config.xml file
-
In terminal, execute
./aion.sh -c
This will create a new config.xml file with the default config settings. Alternatively, you can copy and paste the contents of this file.
Make sure you have the seed nodes from the above linked file in your config.xml file before starting the kernel.
Local Blockchain Network
You may wish to run your own private Aion blockchain to build and test your dApp.
Aion Node
Make sure you have already set-up your node and created an account.
Modify Configure File Names
Note that your aion/config folder contains two JSON files: genesis.json and testnet.json.
-
Rename the original genesis.json file to a different name
-
Rename the original testnet.json file to “genesis.json”
This lowers the difficulty of the network for testing & development purposes.
Configure the config.xml
-
Navigate to the aion/config folder and open config.xml
-
Delete all the seed nodes in the section:
XML
<nodes>
</nodes>
- Set to true in the section to enable internal mining:
XML
<consensus>
<mining>true</mining>
<consensus>
Get Balance into Test Account
-
Open the new genesis.json file
-
Replace one of the current addresses in the “alloc” object with your newly created account address:
JSON
{ "alloc": { "0x------------------your-account-address--------------------------": { "balance": "314159000000000000000000" }, "0xa0353561f8b6b5a8b56d535647a4ddd7278e80c2494e3314d1f0605470f56925": { "balance": "314159000000000000000000" }, "0xa0274c1858ca50576f4d4d18b719787b76bb454c33749172758a620555bf4586": { "balance": "314159000000000000000000" }, ... },
Remove any existing database
If applicable, delete the aion/database folder and re-launch the node in order for genesis to take in effect
Log System Settings
In the config.xml file, you can modify the section depending on how much information you need displayed from the kernel.
Log Levels
There are five log levels available for each of the modules (from least to most, where TRACE gets every log printout):
-
ERROR
-
WARN
-
INFO
-
DEBUG
-
TRACE
If you don’t want the log to be stored in your disk (only printed in terminal), set to false:
XML
<log> <!--Enable/Disable logback service; if disabled, output will not be logged --> <log-file>false</log-file> <!--Sets the physical location on disk where log files will be stored.--> <log-path>log</log-path> <GEN>INFO</GEN> <VM>ERROR</VM> <SYNC>INFO</SYNC> <CONS>INFO</CONS> <DB>ERROR</DB> <API>INFO</API> <P2P>INFO</P2P> <TX>INFO</TX> <TXPOOL>INFO</TXPOOL> </log>