Sol on Akash for Dummies

Chandra Station
5 min readJun 15, 2021

How to run a Solana Validator on the Akash Network the simple way

This is a multi Stage deployment guide with the aim of providing users the information to deploy and maintain a Solana Validator Node on the Akash Network with minimal friction and deployment knowledge.

  • Stage 1 consists of deploying an Ubuntu image to Akash. Think of it as a normal EC2 AWS Ubuntu instance you can install software and run commands on.
  • Stage 2 is the process of running a Solana Validator Node on that Ubuntu instance we deployed to Akash in Stage 1.

Stage 1-

Ubuntu on Akash
(Credit- CoffeeRoaster4435)

Setup an “ssh” Ubuntu image on Akash

Create the Akash-Ubuntu Deploy.yml-

(While also exposing some ports we will need for later)

---
version: "2.0"
services:
web:
image: user994455/ubuntu-base:0.2
env:
- sshport=22000
- pubkey=your-public-ssh-key-here
expose:
- port: 22000
as: 22000
to:
- global: true
- global: true
- port: 8899
as: 8899
proto: tcp
to:
- global: true
- port: 8000
as: 8000
proto: tcp
to:
- global: true
- port: 8001
as: 8001
proto: tcp
to:
- global: true
- port: 8002
as: 8002
proto: tcp
to:
- global: true
- port: 8003
as: 8003
proto: tcp
to:
- global: true
- port: 8004
as: 8004
proto: tcp
to:
- global: true
- port: 8005
as: 8005
proto: tcp
to:
- global: true
- port: 8006
as: 8006
proto: tcp
to:
- global: true
- port: 8007
as: 8007
proto: tcp
to:
- global: true
- port: 8008
as: 8008
proto: tcp
to:
- global: true
- port: 8009
as: 8009
proto: tcp
to:
- global: true
- port: 8010
as: 8009
proto: tcp
to:
- global: true
profiles:
compute:
web:
resources:
cpu:
units: 4
memory:
size: 8Gi
storage:
size: 20Gi
placement:
dcloud:
attributes:
host: akash
signedBy:
anyOf:
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
pricing:
web:
denom: uakt
amount: 20
deployment:
web:
dcloud:
profile: web
count: 1

Prepare your ssh session-

On your workstation setup an ssh public/private key pair.

$ssh-keygen -t rsa
# (a password is optional. But in most cases you don't need one).
# Note that $HOME/.ssh/id_rsa.pub is now created

Update deploy.yml-

Copy and paste the contents of $HOME/.ssh/id_rsa.pub and paste them into deploy.yml -pubkey=your-public-ssh-key-here(deploy.yml : line 8). NOTE: Make sure that you do not use any " around the pubkey as this will cause problems.

Update resources as needed. Set the amount of RAM / CPU / disk space as needed.

Ensure the steps you follow in Deploy Commands are executed in the same directory your Deploy.yml is located in.

(source: https://github.com/coffeeroaster/akash-ubuntu)

Deploy to Akash-

You will need an Akash wallet with at least 5 AKT in order to provide escrow to a provider for your deployment. These commands will have certain flags filled to keep the user experience as simple as possible and assume you already have an Akash wallet in your environment. If you do not follow the steps on the Akash Docs https://docs.akash.network/guides/wallet

Deploy Commands

Step 1: Create a certificate & deployment

akash tx cert create client --chain-id akashnet-2 --keyring-backend os --from <your key name> --node=tcp://135.181.60.250:26657 --fees 5000uakt
--------------------------------------------------------------------akash tx deployment create deploy.yml --from <your wallet address here> --node=tcp://135.181.60.250:26657 --chain-id akashnet-2 --fees 5000uakt -y

After you run the akash tx deployment create command your client will spit out a json string. Within the string you will be given a dseq value.

"key":"dseq","value":"140324"

Note: the dseq value given here cannot be used in order to deploy you must acquire your own.

Step 2: Export your DSEQ as an environment variable

export DSEQ=<your-dseq-value>

Step 3: Make an order and view your bids

akash query market order get --node=http://rpc.akash.forbole.com:80 --owner <your-wallet-address> --dseq $DSEQ --oseq 1 --gseq 1
--------------------------------------------------------------------akash query market bid list --owner <your-wallet-address> --node=http://rpc.akash.forbole.com:80 --dseq $DSEQ

Once you run query market bid list you will receive bids from multiple different providers.

- bid:bid_id:dseq: "140324"gseq: 1oseq: 1owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvujprovider: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7created_at: "140326"price:amount: "1"denom: uaktstate: openescrow_account:balance:amount: "50000000"denom: uaktid:scope: bidxid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324/1/1/akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7owner: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7settled_at: "140326"state: opentransferred:amount: "0"denom: uakt

Simply select a provider from the list. To make the experience easier a provider was added to the following commands.

Step 4: Create your lease & send your manifest

akash tx market lease create --chain-id akashnet-2 --node=tcp://135.181.60.250:26657 --owner <your-wallet-address> --dseq $DSEQ --gseq 1 --oseq 1 --provider akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 --from <your-key-name> --fees 5000uakt
---------------------------------------------------------------------akash query market lease list --owner <your-wallet-address> --node=tcp://135.181.60.250:26657 --dseq $DSEQ
--------------------------------------------------------------------- akash provider send-manifest deploy.yml --node=tcp://135.181.60.250:26657 --dseq $DSEQ --provider akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7 --home ~/.akash --from <your-wallet-address>

Step 5: View your status and acquire port/URL

akash provider lease-status --node=tcp://135.181.60.250:26657 --home ~/.akash --dseq $DSEQ --from <your-key-name> --provider akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7

After running akash provider lease-status you should get

{
"services": {
"web": {
"name": "web",
"available": 1,
"total": 1,
"uris": null,
"observed_generation": 1,
"replicas": 1,
"updated_replicas": 1,
"ready_replicas": 1,
"available_replicas": 1
}
},
"forwarded_ports": {
"web": [
{
"host": "cluster.ewr1p0.mainnet.akashian.io", <- your url
"port": 22000,
"externalPort": <this is your random port>,
"proto": "TCP",
"available": 1,
"name": "web"
}
]
}
}

Finally to ssh in to your Ubuntu deployment run

ssh -p <your-random-port> root@<your-url>

Stage 2-

Solana Validator Node

Step 1: Install the Solana release v1.6.10 on your machine

sh -c “$(curl -sSfL https://release.solana.com/v1.6.10/install)"

Please update your PATH environment variable to include the solana programs:

Check your version

solana --version

Step 2: Configure Solana CLI

solana config set --url http://api.devnet.solana.com

Confirm the Cluster is reachable

solana transaction-count

Confirm your installation

solana-gossip spy --entrypoint entrypoint.devnet.solana.com:8001

Step 3:

Create Identity

solana-keygen new -o ~/validator-keypair.json

Set the config path to your keypair

solana config set --keypair ~/validator-keypair.json

Airdrop some SOL

solana airdrop 1

Create Your Vote Account

solana-keygen new -o ~/vote-account-keypair.json

Step 4:

Run the Validator Node

solana-validator \
--identity ~/validator-keypair.json \
--vote-account ~/vote-account-keypair.json \
--rpc-port 8899 \
--entrypoint entrypoint.devnet.solana.com:8001 \
--limit-ledger-size \
--log ~/solana-validator.log

Optional-

Run it in the background with Systemd

[Unit]
Description=Solana Validator
After=network.target
Wants=solana-sys-tuner.service
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=sol
LimitNOFILE=700000
LogRateLimitIntervalSec=0
Environment="PATH=/bin:/usr/bin:/home/sol/.local/share/solana/install/active_release/bin"
ExecStart=/home/sol/bin/validator.sh
[Install]
WantedBy=multi-user.target

In progress-

Since the port 22 is being opened as port 80 in order to allow for ssh, you must use a load balancer/reverse proxy to expose the remainder of the ports.

--

--