Install

The Java implementation of the OAN kernel. You can interact with this kernel directly through the JSON RPC. Further documentation regarding the kernel can be found on the Aion Java Kernel GitHub repository at https://github.com/aionnetwork/aion

You can install the kernel by using:

Native Ubuntu Install

This section walks you through installing the kernel from a package. You can either generate your own package by building the kernel from source, or you can download a pre-built package from GitHub.

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.

Prerequisites

Get the Java Build

  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 the latest Aion Java kernel package to your computer if you haven't already. You can also use wget if you'd prefer:
 wget https://github.com/aionnetwork/aion/releases/download/v1.0/oan-v1.0.674e4b5-2019-11-05.tar.bz2

  1. Unzip the package:
tar xvf oan-v1.0.674e4b5-2019-11-05.tar.bz2 

Start the Node

  1. Navigate into the Aion kernel folder in the terminal from where you unzip the build:
cd oan/
  1. Launch the Java kernel with a specific network:

a. Mainnet

./aion.sh

b. Amity Testnet

 ./aion.sh -n amity

The kernel will now begin to sync with the other nodes on the network. This process can take up to 7 hours for mainnet depending on the speed of your network and the size of the database you are syncing. Everything is complete once that's finished.

You have successfully installed the Aion Java kernel on your system.

Docker Image

This section covers how to configure and run the Aion Java kernel Docker container.

Quickstart

Follow these steps to get started quickly, or skip this section if you want to learn how to run the container in more detail.

# Pull the Java kernel image.
docker pull aionnetwork/aion:latest

# Create some local storage for the container:
docker volume create aion-mainnet

# Run the container:
docker run -it -p 8545:8545 -p 8547:8547 -p 30303:30303 --mount source=aion-mainnet,destination=/aion/mainnet aionnetwork/aion:latest

Java Prerequisites

To use this Docker image your system must meet the following requirements:

  • 8GB RAM (16GB recommended)
  • 2 CPU cores
  • 1GB HDD space
  • Docker v18.0.0

The HDD space required only takes the Docker image into account. You will need a significant amount of space for storing the blockchain itself. The database is currently around 22GB in size, although this can be pruned.

Install the Java Image

  1. Pull down the latest Java Docker image.
docker pull aionnetwork/aion:latest

> latest: Pulling from aionnetwork/aion
> 6cf436f81810: Pull complete
> ...
> Status: Downloaded newer image for aionnetwork/aion:latest
  1. Create local storage for Aion image.
docker volume create aion-mainnet

> aion-mainnet
  1. Run the image.
docker run -it -p 8545:8545 -p 8547:8547 -p 30303:30303 --mount source=aion-mainnet,destination=/aion/mainnet aionnetwork/aion:latest

Take a look at the Running the Java Container section for more information on what arguments to supply with the docker run command.

  1. Press CTRL + c to shut down and exit the container.
19-03-04 10:59:01.821 INFO  GEN  [shutdown]: Starting shutdown process...
...
19-03-04 10:59:05.887 INFO  GEN  [shutdown]: ---------------------------------------------
19-03-04 10:59:05.888 INFO  GEN  [shutdown]: | Aion kernel graceful shutdown successful! |
19-03-04 10:59:05.888 INFO  GEN  [shutdown]: ---------------------------------------------

Java Arguments and Configuration

There are several arguments that you can supply with the docker run command.

Configure the Java Kernel

Once the kernel Docker image is pulled you can configure it by running the docker exec command in a separate terminal window:

docker exec -it <CONTAINER_NAME or CONTAINER_HASH> /bin/bash

A list of CONTAINER_IDs and CONTAINER_NAMEs can be found by running docker container list

This starts a standard terminal session within the container. You will need to install a text editor before you can edit any files, as the container doesn't come with one pre-installed:

sudo apt install nano

OR

sudo apt install vim

Then you can edit the config.xml file associated with the network you are running. For example, if you are running the Java kernel on Mainnet, then you should edit the mainnet/config.xml file. If you are running the Java kernel on the Testnet (amity), then you should edit the amity/config.xml file.

nano mainnet/config/config.xml
Java Networks

By default, running the image will start a node on the mainnet. To specify a network; for instance, the amity testnet, use:

docker run -it aionnetwork/aion:latest /aion/aion.sh -n amity
Java Ports

The Aion Docker image is configured to run the Java API and RPC servers, as well as allow connections from other Aion nodes. When running the Docker container, it is necessary to publish those ports if you use to wish these functionalities.

PortConnection Type
30303P2P
8545JSON-RPC
8547Java API
Java Storage

In most cases, storage should be attached so that configuration and blockchain sync state can be persisted between each time the kernel is launched. You will need a separate Docker volume for each Aion Network, so it is recommended to include the network name in the volume name. To create a volume:

docker volume create VOLUME-NAME

To start the Docker image with the volume, where VOLUME-NAME is the volume name and NETWORK is the Aion network name:

docker run -it --mount source=VOLUME-NAME,destination=/aion/NETWORK aionnetwork/aion:latest ./aion.sh -n NETWORK

For the list of network names, see:

docker run -it aionnetwork/aion:latest /aion/aion.sh -h

That's it, you're done! See the Kernel wiki pages on GitHub for more on installation and configuration.