Aion Docs

Native Node

Build your own binary and create an Aion node locally.

Native nodes run on your local machine or server. You can either run one of the precompiled packages, or build your own

Make sure you're running Ubuntu 16.04 or higher. Currently we cannot support all Unix, however, it may be possible to run the kernel on other Linux distributions. Sadly the kernel will not work on a Mac. Take a look at the community made Docker image if you want to test things out on other systems.

Pre-compiled Packages

Use one of the pre-compiled packages to get up and running faster. We have used the latest build as an example on this page. If you want to use a different version of the Aion kernel you will need to change the commands to fit the version you are using. We do not recommend always using the latest Aion kernel version.

  1. Connect to your machine via SSH or open a terminal if you are working on a local installation.
  2. Change to your root ~ directory and update your system:
cd ~
sudo apt update -y && sudo apt upgrade -y
  1. Download and validate the latest build from Github:
wget https://github.com/aionnetwork/aion/releases/download/v0.3.3/aion-v0.3.3.22362091d-2019-03-07.tar.bz2 https://github.com/aionnetwork/aion/releases/download/v0.3.3/SHA1SUMS && sha1sum -c SHA1SUMS

If the terminal outputs aion-v0.3.3.22362091d-2019-03-07.tar.bz2: OK then the package passed the validation.

If it failed, stop here and reboot your machine - you may have been a victim to a man-in-the-middle attack. Consult your administrator to find out the next course of action.

  1. Unzip the package and move the aion directory to your home ~ directory:
tar xvjf aion-v0.3.3.22362091d-2019-03-07.tar.bz2
  1. Move to your aion directory and create an address & keystore:
cd ~/
~/aion/aion.sh -a create
  1. Enter a password. You should write this down, you'll need it later.
  2. The terminal shows an account address. Copy it down somewhere, as you'll need this later.
user@local:~$ ~/.aion/aion.sh -a create
Please enter a password:
Please re-enter your password:
A new account has been created: 0xa09...

user@local:~$ _
  1. The build script creates a keystore file in aion/keystore. Create a backup of the file:

On a Local Machine

cp ~/aion/mainnet/keystore/* ~/Documents/aion-keystore

On a Remote Machine over SSH

# exit your remote machine
exit

# copy the aion keystore to your local machine
scp user@node_ip_address:~/aion/mainnet/keystore/* ~/Desktop
  1. Reconnect to your remote machine (if you disconnected) and start syncing your node:
~/aion/aion.sh

This process can take up to 72 hours depending on the speed of your network.


Build Your Own

If you want to compile your own package, follow these steps. You do not have to do this if you have downloaded one of the pre-compiled packages from Github.

Prerequisites

Build Process

  1. Update your apt cache and install required dependencies:
sudo apt 
sudo apt-get install -y git g++ cmake wget llvm-4.0 lsb-release libjsoncpp1 libjsoncpp-dev libboost1.58-all-dev libzmq5 libstdc++6 libgcc1 libpgm-5.2-0
  1. Clone the Aion repository:
git clone --recursive https://github.com/aionnetwork/aion
  1. Move into the aion folder:
cd aion
  1. Check that your environment settings are correct:
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
export JAVA_HOME=/usr/lib/jvm/jdk-11.0.1
export ANT_HOME=$HOME/IDE/apache-ant-1.10.3
PATH="$ANT_HOME/bin:$JAVA_HOME/bin:$PATH"
  1. Link the Java executable to the JDK folder:
ln -s YOUR/JDK/INSTALLATION/PATH /usr/lib/jvm/jdk-11.0.1
  1. Load in the changes you just made to your bashrc/bash_profile file:
source ~/.bashrc
  1. Build the package:
./gradlew build
  1. Verify the code by running through the test cases:
./gradlew test -x aion_api:test
  1. Pack everything up:
./gradlew pack
  1. Inside the pack folder you should see a file similar to aion-v<KERNEL_VERSION>.<GIT_REVISION>-<BUILD_DATE>.tar.bz2:
ls pack

> aion-v0.1.12.2c5119a-2018-02-28.tar.bz2

This is your kernel build.

  1. To pack everything into a Docker image run ./gradlew packDocker.

FastVM and the Solidity Compiler

To build the FastVM and the Solidity compiler native library from source code run ant full_build before running ./gradlew build. This will take quite a while and requires Ubuntu 16.04.

Delete your Node

Soft Delete

This method of deletion doesn't really delete anything, but rather just moves the kernel to another location so you can repeat the installation process detailed above as normal:

mv ~/aion ~/aion-old

Your Aion kernel is now stored in ~/aion-old, with the database and keys still intact. Once you have decided you absolutely no longer need the old kernel, you can delete it the standard way:

rm -rf ~/aion-old

Hard Delete

Warning: this procedure is irreversible. Once the ~/aion folder has been removed, there is no way to get it back without completely re-installing the kernel.

In order to completely delete your Aion node installation, simply delete the folder containing the Aion kernel. In the examples above this is at ~/aion:

rm -rf ~/aion

Native Node


Build your own binary and create an Aion node locally.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.