We would want our own Akash node when we have one of the following needs:
- 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 which includes the following steps:
- STEP1 - Install Akash Software
- STEP2 - Add Akash Install Location in the User’s Path
- STEP3 - Choose a Node Moniker
- STEP4 - Initialize New Node
- STEP5 - Set Minimum Gas Price
- STEP6 - Copy the Genesis File
- STEP7 - Add Seed Nodes
- STEP8 - Fast Sync
- STEP9 - Blockchain Snapshot Use
- STEP10 - Start the Akash Node
- Additional Information
- RPC Service
- API Service
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 Latest Stable Akash Version
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 User’s Path Settings in an Editor
View Current Path Settings
- 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.
- Example file_:_
Add the Akash Executable Path
-
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.
Post Update Path Settings
Activate New Path Settings
-
Make the new path active in the current session
Verify New Path Settings and Akash Install
-
Display the version of Akash software installed. This confirms the software installed and that the new user path addition worked.
-
Expected result (version displayed may be different)
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
Moniker Updates
-
The moniker can be changed later, if needed, within the following file:
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
Start the node
Example/Expected Result
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.
The initial recommended min-gas-prices is 0.025uakt but you might want to change it later.
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
STEP7 - Add Seed and Peer 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.
Seed Nodes
List Current Seed Nodes
Expected Output of Seed Node List
Include the Seed Nodes in Config Files
Seed Nodes
-
Open the config.toml file in an editor
-
Within the editor find the seeds field as shown at the bottom of this output
-
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:
Peer Nodes
List Current Peer Nodes
Expected Output of Peer Node List
Include the Peer Nodes in Config Files
Persistent Peers
-
Open the config.toml file in an editor
-
Within the editor find the persistent_peers field as shown at the bottom of this output
- Copy and paste the seed nodes returned via the “List Current Peer Nodes” part of this section
- Following update the persistent_peers field should appear like this:
RPC Listening Address
-
Open the config.toml file in an editor
-
Within the editor find the RPC listening address field as shown in this output
-
Update the listening address field to
"tcp://0.0.0.0:26657"
as shown -
This setting will ensure listening occurs on all interfaces
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
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
-
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.
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
Download Snapshot
The latest Akash snapshot version - made available via The Offical Akash Network Snapshot - can be found here. This snapshot is updated every hour.
Example Steps
STEP10 - Start the Akash Node
Start the Node
In this section we will create a script and a related service to start the node. The service will additionally ensure that the node is restarted following reboots.
Create Script to Start Node
- Create a script to start the Akash Node
- Make the script an executable
Create Related Service
Start the Service
Check the Status of the Node
-
Initially the node will show a status of
"catching_up":true
within the output of the status command -
Eventually the node will show the height of the latest block and should indicate
"catching_up":false
-
The latest block number can be found on the Mintscan website for comparison.
Example/Sample Output
- Status output while Node is catching up to current block
Additional Information
Config Files
Akash Node configurations are found within these files:
Cosmos Specific Configuration
Tendermint Specific Configuration
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.
State Pruning
There are several strategies for pruning state, please be aware that this is only for state and not for block storage:
- default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals
- nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
- everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals
- 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.
RPC Service
The RPC Service allows for both sending transactions to the network and for querying state from the network. It is used by the akash
command-line tool when using an akash tx
command or akash query
command.
The RPC Service is configured in the [rpc]
section of ~/.akash/config/config.toml
.
By default, the service listens on port 26657
, but this can also be changed in the [rpc]
section of config.toml
.
API Service
The API Service of a full node enables a read-only query API that is useful for many tools such as dashboards, wallets, and scripting in general.
The API Service is configured in ~/.akash/config/app.toml
and can be enabled in the [api]
section:
By default, the service listens on port 1317
, but this can also be changed in the [api]
section of app.toml
.