How to Deploy Augur Client on Akash Network
Recently, I came upon Akash, the first decentralized cloud computing marketplace. If you’re not yet familiar with Decentralized Cloud (DeCloud) or Akash, I encourage you to check out their website, their whitepapers, their blogs, and other blogs. The project is still faily young, but their recent Akasian Challenge 3 showcases a pretty impressive preview of their deployment platform. Just as how one can deploy a containerized application on Amazon Web Services (AWS), one can in theory deploy the same containerized application on Akash.
In this guide, I’m going to show you how easy it is to deploy a containerized Augur Client on Akash in a non-custodial way using their testnet. Augur is a decentralized prediction market platform built on the Ethereum blockchain. The guide is based on the guide to deploy Serum DEX on Akash.
Initial Setup
Before we begin, you will need to:
- Install Akash.
- Choose Your Akash Network. We will be using edgenet, which is the Testnet with deployment capabilities that will reflect their next Mainnet version.
- Fund Your Account with AKT, to pay for deployment. For edgenet, Akash provides an AKT faucet to fund test deployments.
- Containerized Application you want to deploy. In this guide, we’ll be using the official Augur Docker Image instead of building our own to focus on the details (and appreciate the simplicity) of Akash deployment. In theory can you deploy your own Docker Image on Akash
Environment Setup
Set the following shell variables, using export VARNAME=…
:
AKASH_NODE
: Akash network configuration base URL. See here.AKASH_CHAIN_ID
: Chain ID of the Akash network connecting to. See here.ACCOUNT_ADDRESS
: The address of your account. See here.KEY_NAME
: The name of the key you will be deploying from. See here if you haven’t yet setup a key.
You can check your account has sufficient balance by running:
akash query bank balances --node $AKASH_NODE $ACCOUNT_ADDRESS
You should see a response similar to:
balances:
- amount: "93000637"
denom: uakt
pagination:
next_key: null
total: "0"
Please note the balance indicated is is denominated in uAKT (AKT * 10^-6), in the above example, the account has a balance of 93 AKT. We’re now setup to deploy.
Create the Deployment
Create a deployment configuration deploy.yml to deploy the Augur Docker Image using SDL:
cat > deploy.yml <<EOF
---
version: "2.0"
services:
web:
image: augurproject/augur
expose:
- port: 80
as: 80
to:
- global: true
profiles:
compute:
web:
resources:
cpu:
units: 0.1
memory:
size: 512Mi
storage:
size: 512Mi
placement:
westcoast:
attributes:
organization: ovrclk.com
signedBy:
anyOf:
- "akash1vz375dkt0c60annyp6mkzeejfq0qpyevhseu05"
pricing:
web:
denom: uakt
amount: 1000
deployment:
web:
westcoast:
profile: web
count: 1
EOF>>
Deploy!
To deploy on Akash, simply run:
akash tx deployment create deploy.yml --from $KEY_NAME --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID --fees 5000uakt -y
The above posts the deployment, and the Akash marketplace matches you with a provider via auction. You can check the status of your lease by running:
akash query market lease list --owner $ACCOUNT_ADDRESS --node $AKASH_NODE --state active
And you would see something similar as below as response:
- lease_id:
dseq: "115884"
gseq: 1
oseq: 1
owner: akash1j8s87w3fctz7nlcqtkl5clnc805r240443eksx
provider: akash1y8xhp9ekxctahvex7842h607lmwp50q0n89tw0
price:
amount: "51"
denom: uakt
state: active
pagination:
next_key: null
total: "0"
For convenience, setup the following shell variables:
PROVIDER
: akash1y8xhp9ekxctahvex7842h607lmwp50q0n89tw0DSEQ
: 115884OSEQ
: 1GSEQ
: 1
To complete the deployment, upload the manifest:
akash provider send-manifest serum.yml --node $AKASH_NODE --dseq $DSEQ --oseq $OSEQ --gseq $GSEQ --owner $ACCOUNT_ADDRESS --provider $PROVIDER
And you should see a response similar to:
{
"services": {
"web": {
"name": "web",
"available": 1,
"total": 1,
"uris": [
"15maavfe65e3j66safqh6lvfqs.provider2.akashdev.net"
],
"observed-generation": 0,
"replicas": 0,
"updated-replicas": 0,
"ready-replicas": 0,
"available-replicas": 0
}
},
"forwarded-ports": {}
}
You can then navigate to the “uris” (in this case, 15maavfe65e3j66safqh6lvfqs.provider2.akashdev.net) to view the Augur Client web app.