Skip to content

nickyharpor/Akash-NEAR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Akash-NEAR

This project contains everything you need to deploy a NEAR node on Akash network from scratch. Akash is a distributed peer-to-peer marketplace for cloud compute. NEAR is a development platform built on a layer-one blockchain. There are three different types of NEAR nodes, and you can run them all on Akash in a single set of deployment files.

Quick start

Simply use deploy.yaml as your Akash SDL file. By default, it runs a mainnet RPC node. Of course, you can change the environment variables in the file to run a different type of node. As in any other SDL file, you can change the resources and pricing as well. There are several methods to deploy on Akash (i.e. GUI, CLI, and web app). Check out the deployment guide for more information.

Configuration

If you're about to run something rather than a mainnet RPC node, you need to edit deploy.yaml to change some environment variables. There are four main variables you may change:

  • CHAIN_ID: selects the network (available options: mainnet (default) / testnet / localnet)
  • ACCOUNT_ID: your staking pool account name if this is a validator node (leave it empty otherwise)
  • DISABLE_RPC: set to true if you want to disable RPC (leave it empty otherwise)
  • ARCHIVE: set to true if this is an archive node (leave it empty otherwise)

Example configurations

Here are some example configurations to make things easier.

Mainnet archive node without RPC

CHAIN_ID=
ACCOUNT_ID=
DISABLE_RPC=true
ARCHIVE=true

Testnet validator with RPC (no archiving)

CHAIN_ID=testnet
ACCOUNT_ID=icanblowlikeelephantsdo.pool.f863973.m0
DISABLE_RPC=
ARCHIVE=

Note: You should change ACCOUNT_ID to your own staking pool. You can create a staking pool by following the official guide. You can find your validator key at /srv/near/validator_key.json inside the container. You can run akash provider lease-shell --from <key-name> --dseq <dseq-number> --provider=<provider-address> near cat /srv/near/validator_key.json with your own variables to access it. You may want to learn more about how to execute a shell command and how to access shell on Akash deployments.

Notes

  • When the container is deployed for the first time, it starts to download the huge data file for testnet/mainnet. It takes some time for the node to be ready. You can check the logs to track the progress.

  • Make sure your SDL resources configuration meets the recommended hardware specification or you might face problems.

Maintenance

When you build an image from the Dockerfile, it automatically checks for the latest stable version of NEAR core, so if NEAR is updated to a new version in future, all you have to do is to rebuild the image with docker build.

The customized run.sh script takes care of all manual node setup. Everything will be fine unless there is a big fundamental change in NEAR.