Aion Docs

Docker Images

Spin up an Aion node using Docker.

There are Docker images for both the Java and Rust kernels. In order to spin up one of these nodes, you need to be using an operating system capable of installing Docker. See the Docker documentation for a comprehensive list of supported operating systems and how to install Docker.

Java

This section covers how to configure and run the 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 Rust kernel image.
docker pull aionnetwork/aion

# 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

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

> 0.3.3-latest: Pulling from aionnetwork/aion-staging
> 6cf436f81810: Downloading  14.83MB/32.37MB
> ...
> Digest: sha256: efa8e77...
  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

>                     _____
>      .'.       |  .~     ~.  |..          |
>    .'   `.     | |         | |  ``..      |
>  .''''''''`.   | |         | |      ``..  |
>.'           `. |  `._____.'  |          ``|
>
>                v0.3.3.2886431
>                    mainnet
>                   using FVM
See the [Running the Java Container](#running-the-java-container) section for more information on what arguments to supply with the `docker run` command.
  1. Press CTRL + c to shutdown 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 is running you can configure it by running the docker exec command in a seperate terminal window:

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

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 Rust kernel on the Testnet (Mastery), then you should edit the mastery/config.xml file.

Java Networks

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

docker run aionnetwork/aion /aion/aion.sh -n mastery

Java Ports

The Aion Docker image is configured to run its 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.

Port Connection Type
30303 P2P
8545 JSON-RPC
8547 Java 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

For the list of network names, see:

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

Rust

This section covers how to configure and run the Rust Docker container.

Rust 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 Rust kernel image.
docker pull aionnetwork/aionr

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

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

Rust Prerequisites

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

  • 4GB RAM (8GB 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 Rust Image

  1. Pull down Aion Docker image.
docker pull aionnetwork/aionr

> 0.1.1-latest: Pulling from aionnetwork/aionr-staging
> 6cf436f81810: Downloading  14.83MB/...
> ...
> Digest: sha256: efa8e77...
  1. Create local storage for Aion image.
docker volume create aionr-mainnet

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

> 2019-03-01 21:12:54
>              _____    ____    _   _
>      /\     |_   _|  / __ \  | \ | |
>     /  \      | |   | |  | | |  \| |
>    / /\ \     | |   | |  | | | . ` |
>   / ____ \   _| |_  | |__| | | |\  |
>  /_/    \_\ |_____|  \____/  |_| \_|
>
> 2019-03-01 21:12:54 Starting Aion(R)/v0.1.1.6622125/x86_64-linux-gnu/rustc-1.28.0
> 2019-03-01 21:12:54 Configured for Mainnet using POWEquihashEngine engine
> 2019-03-01 21:12:54 Genesis hash: 30793b4ea012c6d3a58c85c5b049962669369807a98e36807c1b02116417f823
See the [Running the Java Container](#running-the-java-container) section for more information on what arguments to supply with the `docker run` command.
  1. Press CTRL + c to shutdown and exit the container.

Rust Arguments and Configuration

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

Configure the Rust Kernel

Once the kernel is running you can configure it by running the docker exec command in a seperate terminal window:

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

This starts a standard terminal session within the container, meaning you can write and edit files.

Then you can edit the .toml file associated with the network you are running. For example, if you are running the Rust kernel on Mainnet, then you should edit the mainnet/mainnet.toml file. If you are running the Rust kernel on the Testnet (Mastery), then you should edit the mastery/mastery.toml file.

Rust Networks

The Rust kernel will connect to the Mainnet network by default. You can supply ./mastery.sh as an argument to connect to the Testnet (Mastery) network.

docker run aionnetwork/aionr ./mastery.sh

This argument tells Docker to call the mastery.sh script located within the container once everything has booted.

To connect to a custom network, supply ./custom.sh as an argument.

docker run aionnetwork/aionr ./custom.sh

Rust Ports

You can map ports from your local machine to the docker container. This is necessary as certain aspects of the Rust kernel are only enabled if certain ports are available. The following ports are required for the Rust kernel:

Port Connection Type
30303 P2P
8545 JSON-RPC
8546 WebSocket
8547 Java API
8008 Stratum Protocol

Rust Storage

It is essential that you specify persistent storage when running the docker run command. If you do not, the entire blockchain database will be lost when you exit or shutdown the container.

First you need to create the volume, and then attach it to the container.

# Create the storage
docker create volume aionrdata

# Run the container with the storage attached
docker run --mount type=volume,src=aionrdata,dst=/root/.aion aionnetwork/aionr

Docker Images


Spin up an Aion node using Docker.

Suggested Edits are limited on API Reference Pages

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