Install
The Rust implementation of the Aion kernel. You can interact with this kernel directly through the JSON RPC layer. Further documentation regarding the kernel can be found on the Aion Rust Kernel GitHub repository at https://github.com/aionnetwork/aionr
You can install the kernel by using:
Native Ubuntu Install
Follow these steps to install an Aion Rust node as a native Ubuntu application.
Prerequisites
Your node must have the following specifications.
- Ubuntu 16.04 or Ubuntu 18.04
- Open JDK 11 or up
4GB
RAM- 24GB Hard Drive Space (Mainnet DB about 12GB)
- 2 core CPU
Follow these steps to install all the necessary prerequisites.
- Update your system and install the build dependencies:
sudo apt-get update
sudo apt install g++ gcc libjsoncpp-dev python-dev libudev-dev llvm-4.0-dev cmake wget curl git pkg-config lsb-release -y
- Install Rust
v1.28.0
:
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.28.0 --default-host x86_64-unknown-linux-gnu
Select option 1
when prompted.
- Initialize the Rust install and check that it is working:
source $HOME/.cargo/env
cargo --version
> cargo 1.28.0 (96a2c7d16 2018-07-13)
- Install Boost
v1.65.1
# Ubuntu 16.04:
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.bz2
tar xvf boost_1_65_1.tar.bz2
cd boost_1_65_1
./bootstrap.sh --libdir=/usr/lib/x86_64-linux-gnu/
./b2
./b2 install
# OR
# Ubuntu 18.04
sudo apt-get install libboost-all-dev -y
- Install Java JDK 11:
sudo apt install openjdk-11-jdk
- Install Apache Ant:
sudo apt install ant -y
- Set Environment Variables:
export JAVA_HOME=<jdk_directory_location>
export ANT_HOME=<apache_ant_directory>
export LIBRARY_PATH=$JAVA_HOME/lib/server
export PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin
export LD_LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
Get the Rust Build
- Download the latest Aion Rust kernel package to your computer if you haven't already. You can also use wget if you'd prefer:
wget https://github.com/aionnetwork/aionr/releases/download/v1.0/oanr-v1.0.0.706f7dc-2019-11-05.tar.gz
Build from Source
If you want to build the Rust kernel from source, make sure you follow the steps here.
- If you are going to be connecting to your node over SSH, you need to copy this package to the node using SCP:
scp ~/Downloads/PACKAGE_NAME USER@NODE_IP_ADDRESS:~/
For example:
scp ~/Downloads/oanr-v1.0.0.706f7dc-2019-11-05 [email protected]:~/
- Unzip the package:
cd ~/
tar xvf PACKAGE_NAME
Start the Rust Node
- Navigate to where you just unzipped the package.
cd UNZIPPED_FOLDER_NAME
- Launch the Rust kernel with a specific network:
a. Mainnet
./mainnet.sh
b. Amity Testnet
./amity.sh
3. Make sure your network is fully synced! Your kernel will stop syncing once you are fully synced and your block number should be the same one as your peers' block number.
### Configuration
#### RPC
Check if the RPC connection is open to enable getting the transactions later!
```bash
cat amity/amity.toml
...
> [http]
> disable = false
> port = 8545
...
Docker Image
This section covers how to configure and run the Aion Rust kernel Docker container.
Quickstart
Follow these steps to get started quickly for Mainnet network
twit, or skip this section if you want to learn how to run the container in more detail.
# Pull the kernel image.
docker pull aionnetwork/aionr:latest
# Create some local storage for the container:
$ docker volume create aionr-mainnet
# Run the container:
$ docker run -it -p 8545:8545 -p 8546:8546 -p 30303:30303 --mount source=aionr-mainnet,destination=/aionr/mainnet aionnetwork/aionr ./mainnet.sh
Rust 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.
Installation
- Pull down the latest Docker image.
docker pull aionnetwork/aionr:latest
> latest: Pulling from aionnetwork/aionr
> f476d66f5408: Pull complete
> ...
> Status: Downloaded newer image for aionnetwork/aionr:latest
- Create local storage for Aion image.
docker volume create aionr-mainnet
> aionr-mainnet
- Run the image.
docker run -it -p 8545:8545 -p 8546:8546 -p 30303:30303 --mount source=aionr-mainnet,destination=/aionr/mainnet aionnetwork/aionr:latest
> _____ ____ _ _
> /\ |_ _| / __ \ | \ | |
> / \ | | | | | | | \| |
> / /\ \ | | | | | | | . ` |
> / ____ \ _| |_ | |__| | | |\ |
> /_/ \_\ |_____| \____/ |_| \_|
>
>
>2019-07-12 17:14:11 Starting Aion(R)/v0.2.5.a60ae38/x86_64-linux-gnu/rustc-1.28.0
- Press
CTRL
+c
to shut down and exit the container.
Arguments and Configuration
There are several arguments that you can supply with the docker run
command.
Configure the Rust 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_ID> /bin/bash
A list of CONTAINER_ID
s and CONTAINER_NAME
s can be found by using the command: $ 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:
apt install nano
OR
apt install vim
The configuration file locations will be printed upon starting the node:
2019-07-12 17:41:08 Config path /aionr/mainnet/mainnet.toml
2019-07-12 17:41:08 Genesis spec path /aionr/mainnet/mainnet.json
2019-07-12 17:41:08 Keys path /root/.aion/keys/mainnet
2019-07-12 17:41:08 DB path /root/.aion/chains/mainnet/db/a98e36807c1b0211
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 (amity), then you should edit the amity/amity.toml
file.
nano mainnet/mainnet.toml
Rust 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/aionr:latest /aionr/amity.sh
Rust Ports
The Aion Docker image is configured to run the Rust WebSocket 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 |
8546 | WebSocket |
Rust 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 (mainnet
, amity
, custom
, etc.):
docker run -it --mount source=<VOLUME-NAME>,destination=/aionr/<NETWORK> aionnetwork/aionr:latest ./<Network>.sh
That’s it, you’re done! See the aionr repository and Kernel wiki pages on GitHub for more on installation and configuration.
Updated about 5 years ago