Run an Akash Node
We would want our own Akash node when we want to run:
  • Akash Validator - a full Akash Node is a prerequisite step to run a validator
  • Akash Provider - a dedicated Akash Node is recommended for providers
  • Akash Production dApps - a dedicated Akash Node is best practice to eliminate reliance on public nodes when you take your distributed apps past the testing phase.
In this guide we will review the Akash Node setup.

Akash Node Setup

STEP1 - Install Akash Software

In this step we will cover Installing the Akash software on a Linux server. We will use an Ubuntu server for our examples. The commands may need to be changed slightly depending on your Linux distribution.
Download and Install Akash
  • Install the Linux unzip utility if needed
1
sudo apt install zip
Copied!
  • These commands will retrieve the latest, stable version of the Akash software, store the version in a local variable, and then install that version.
1
cd ~
2
3
AKASH_VERSION="$(curl -s "https://raw.githubusercontent.com/ovrclk/net/master/mainnet/version.txt")"
4
5
curl https://raw.githubusercontent.com/ovrclk/akash/master/godownloader.sh | sh -s -- "v$AKASH_VERSION"
Copied!

STEP2 - Add Akash Install Location in the User’s Path

Add the Akash install location to the user’s path for ease of use.
NOTE - below we provide the steps to add the Akash install directory to a user’s path on a Linux Ubuntu server. Please take a look at a guide for your operating system and how to add a directory to a user’s path.
Open the user’s path in an editor
1
vi /etc/environment
Copied!
It is always best practice to view the path within a text editor or cat it out to console prior to the update to avoid errors.
1
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
2
~
3
~
4
~
Copied!
Add the following directory, which is the Akash install location, to PATH
  • Note - this assumes Akash was installed while logged in as the root user.
1
/root/bin
Copied!
View within the text editor or console following the update
1
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/root/bin"
2
~
3
~
4
~
Copied!
Make the new path active in the current session
1
​​source /etc/environment
Copied!
Display the version of Akash software installed. This confirms the software installed and that the new user path addition worked.
1
akash version
Copied!
Expected result
  • The exact, current version displayed may be different
1
[email protected]:~# akash version
2
v0.14.0
Copied!

STEP3 - Choose a Node Moniker

We choose a "moniker" which is a readable name for your Akash Node.
  • Replace the moniker value with a name of your choice
  • NOTE - monikers can contain only ASCII characters
1
AKASH_MONIKER=<moniker>
Copied!
The moniker can be changed later, if needed, within the following file
1
~/.akash/config/config.toml
Copied!

STEP4 - Initialize New Node

In this step we will initialize our new Akash Node. In the background several configuration files will be created which can be edited later as needed.
Before starting the node, we specify the Akash network and chain ID
1
AKASH_NET="https://raw.githubusercontent.com/ovrclk/net/master/mainnet"
2
3
export AKASH_CHAIN_ID="$(curl -s "$AKASH_NET/chain-id.txt")"
Copied!
Start the node
1
akash init --chain-id "$AKASH_CHAIN_ID" "$AKASH_MONIKER"
Copied!
Example/Expected Result
1
{"app_message":{"audit":{"attributes":[]},"auth":{"accounts":[],"params":{"max_memo_characters":"256","sig_verify_cost_ed25519":"590","sig_verify_cost
2
3
<output truncated>
4
5
},"upgrade":{},"vesting":{}},"chain_id":"akashnet-2","gentxs_dir":"","moniker":"chainzero","node_id":"2f4491952df08e69fd988c6f5d6ed21e25318fbc"}
6
Copied!

STEP5 - Set Minimum Gas Price

Your node keeps unconfirmed transactions in its mempool. In order to protect the node from spam, it is best to set a minimum gas price that the transaction must meet in order to be accepted into the mempool.
This setting can be found in the following file and we will change the default value which is blank.
1
~/.akash/config/app.toml
Copied!
The initial recommended min-gas-prices is 0.025uakt but you might want to change it later.
1
# This is a TOML config file.
2
# For more information, see https://github.com/toml-lang/toml
3
4
##### main base config options #####
5
6
# The minimum gas prices a validator is willing to accept for processing a
7
# transaction. A transaction's fees must meet the minimum of any denomination
8
# specified in this config (e.g. 10uatom).
9
10
minimum-gas-prices = "0.025uakt"
Copied!

STEP6 - Copy the Genesis File

Akash nodes need the Genesis file for the blockchain. In this step we will gather the genesis.json file and make sure it is valid.
Copy the Genesis File
1
curl -s "$AKASH_NET/genesis.json" > $HOME/.akash/config/genesis.json
Copied!
Verify the Genesis File
1
akash validate-genesis
Copied!
Expected Output of Validate Genesis
1
[email protected]:~# akash validate-genesis
2
3
File at /root/.akash/config/genesis.json is a valid genesis file
Copied!

STEP7 - Add Seed Nodes

A seed node is used as an initial peer on the network. The seed node will provide a list of peers which can be used going forward. In this step we will configure a seed node to connect with.
List Current Seed Nodes
1
curl -s "$AKASH_NET/seed-nodes.txt" | paste -d, -s
Copied!
Expected Output of Seed Node List
1
[email protected]:~# curl -s "$AKASH_NET/seed-nodes.txt" | paste -d, -s
2
3
[email protected]:26656,8e2f56098f182ffe2f6fb09[email protected]:26656,[email protected]:26656
Copied!
Include the Peer Nodes in Config File
  • Open the config.toml file in an editor
1
vi $HOME/.akash/config/config.toml
Copied!
  • Within the editor find the seeds field as shown at the bottom of this output
1
#######################################################
2
### P2P Configuration Options ###
3
#######################################################
4
[p2p]
5
6
# Address to listen for incoming connections
7
laddr = "tcp://0.0.0.0:26656"
8
9
# Address to advertise to peers for them to dial
10
# If empty, will use the same port as the laddr,
11
# and will introspect on the listener or use UPnP
12
# to figure out the address.
13
external_address = ""
14
15
# Comma separated list of seed nodes to connect to
16
seeds = ""
Copied!
  • Copy and paste the seed nodes returned via the “List Current Seed Nodes” part of this section
  • Following update the seeds field should appear like this:
1
# Comma separated list of seed nodes to connect to
Copied!

STEP8 - Fast Sync

Fast Sync means nodes can catch up quickly by downloading blocks in bulk.
Fast Sync settings can be found in the following file
1
~/.akash/config/config.toml
Copied!
Verify Fast Sync Settings
  • Most likely no changes will be necessary to config.toml and the default settings will be fine. But we will make sure.
  • Verify the fast_sync field is set to true
1
# If this node is many blocks behind the tip of the chain, FastSync
2
# allows them to catchup quickly by downloading blocks in parallel
3
# and verifying their commits
4
fast_sync = true
Copied!
  • Verify the Fast Sync version is set to v0.
  • While version 0 is said to be the “legacy” version, in our experience this version works better.
1
#######################################################
2
### Fast Sync Configuration Connections ###
3
#######################################################
4
[fastsync]
5
6
# Fast Sync version to use:
7
# 1) "v0" (default) - the legacy fast sync implementation
8
# 2) "v1" - refactor of v0 version for better testability
9
# 2) "v2" - complete redesign of v0, optimized for testability & readability
10
version = "v0"
Copied!

STEP9 - Blockchain Snapshot Use

We could let our node catch up to the current block but this would take a very long time. Instead we will download a snapshot of the blockchain before starting our node.
NOTE - at the time of this writing the snapshot is 200GB and could take some time to pull down.
Remove Existing Data
1
rm -rf ~/.akash/data; \
2
mkdir -p ~/.akash/data; \
3
cd ~/.akash/data
Copied!
Download Snapshot
1
SNAP_NAME=$(curl -s http://135.181.60.250/akash/ | egrep -o ">akashnet-2.*tar" | tr -d ">"); \
2
wget -O - http://135.181.60.250/akash/${SNAP_NAME} | tar xf -
Copied!

STEP10 - Start the Akash Node

Start the node
1
akash start
Copied!
Check the status of the node
  • At first the node will show it is catching up.
  • Eventually the node will show the height of the latest block.
  • The latest block number can be found on the following website for comparison.
1
akash status
Copied!

Additional Information

Config Files

Akash Node configurations are found within these files:
Cosmos specific configuration
1
~/.akash/config/app.toml
Copied!
Tendermint specific configuration
1
~/.akash/config/config.toml
Copied!

Akash Networks

Within this guide the Akash mainnet is used and as specified in the AKASH_NET value. To launch a node on the testnet or edgenet and for additional network information, use this guide:
GitHub - ovrclk/net: genesis and configuration files for various akash networks
GitHub

State Pruning

There are several strategies for pruning state, please be aware that this is only for state and not for block storage:
  1. 1.
    default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals
  2. 2.
    nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
  3. 3.
    everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals
  4. 4.
    custom: allow pruning options to be manually specified through pruning-keep-recent, pruning-keep-every, and pruning-interval
You can configure the node's pruning strategy at start time with the --pruning or by configuring the app.toml file.
Validator Node Pruning Note - please do not use --pruning everything on validator nodes as it is known to cause issues. Instead use --pruning default.
Last modified 18d ago