Deploy with CLI
In this guide, we'll deploy a single-tier web application on Akash. We will run an app on Akash, Lunie Light, a non-custodial, web wallet for Akash. Lunie Light is a staking interface for proof-of-stake blockchains in the Cosmos ecosystem — built for speed, simplicity, and ease-of-use.

Before We Begin

This is a technical guide, best suited to a reader with basic Linux command line knowledge. The audience this guide is intended for includes:
    Application developers with little or no systems administration experience, wanting to deploy applications on the decentralized cloud.
    System administrators with little or no experience with infrastructure automation, wanting to learn more.
    Infrastructure automation engineers that want to explore decentralized cloud.
    Anyone who wants to get a feel for the current state of the decentralized cloud ecosystem.
We encourage to take a look at Variables guide to understand usage of environment variables as well as CLI flags.
Make sure to have Akash client installed on your workstation, check install guide for instructions.
You'll need an account with funds to pay for your deployment. See the funding guide for creating a key and funding your account.

Configure your Shell Variables

Shell variables will be used throughout these guides to make the instructions so that the commands can be used verbatim. The beginning of each guide will give a list of variables used and how to populate them.
Because of this, it is important to type the commands into a terminal where the variables have been defined. Closing or changing terminals will mean that you have to re-define the variable.
Name
Description
AKASH_NET
Akash network configuration base URL.
AKASH_VERSION
Akash version to install for your network.
AKASH_CHAIN_ID
Chain ID of the Akash network for IBC.
AKASH_NODE
Akash RPC endpoint URL and port number.
AKASH_ACCOUNT_ADDRESS
The address of your account. See here.
AKASH_KEYRING_BACKEND
Keyring backend to use for local keys. See here
AKASH_KEY_NAME
The name of the key you will be deploying from. See here if you haven't yet setup a key

Network

First configure the base URL ($AKASH_NET) for the Akash Network; copy and paste the command below:
1
AKASH_NET="https://raw.githubusercontent.com/ovrclk/net/master/mainnet"
Copied!

Version

Next configure the version of the Akash Network AKASH_VERSION; copy and paste the command below:
1
AKASH_VERSION="$(curl -s "$AKASH_NET/version.txt")"
Copied!

Chain ID

The akash CLI will recogonize AKASH_CHAIN_ID environment variable when exported to the shell.
1
export AKASH_CHAIN_ID="$(curl -s "$AKASH_NET/chain-id.txt")"
Copied!

Network Node

You need to select a node on the network to connect to, using an RPC endpoint. To configure theAKASH_NODE environment variable use this export command:
1
export AKASH_NODE="$(curl -s "$AKASH_NET/rpc-nodes.txt" | head -1)"
2
3
echo $AKASH_NODE
Copied!

API Endpoint

This command will print a random API endpoint.
1
curl -s "$AKASH_NET/api-nodes.txt" | head -1
Copied!

Key Ring Backend

Set the Key Ring Backend that you used to store your key. The default is os and will store the key in your operating system, protected by your login password.
1
AKASH_KEYRING_BACKEND=os
Copied!

Confirm your network variables are setup

Your values may differ depending on the network you're connecting to, but you should see something similar to:
http://135.181.60.250:26657 akashnet-2 os
1
echo $AKASH_NODE $AKASH_CHAIN_ID $AKASH_KEYRING_BACKEND
Copied!

Configure your Account Key

Configure the name of your key. The command below will set the name of your key to alice, run the below command and replace alice with a name of your choice:
1
AKASH_KEY_NAME=alice
Copied!
Verify you have the key set up . The below command should return the name you've used:
1
echo $AKASH_KEY_NAME
Copied!
Populate AKASH_ACCOUNT_ADDRESS from AKASH_KEY_NAME and verify:
1
export AKASH_ACCOUNT_ADDRESS="$(akash keys show $AKASH_KEY_NAME -a)"
2
3
echo $AKASH_ACCOUNT_ADDRESS
Copied!

Check your Account Balance

Check your account has sufficient balance by running:
1
akash query bank balances --node $AKASH_NODE $AKASH_ACCOUNT_ADDRESS
Copied!
You should see a response similar to:
1
balances:
2
- amount: "93000637"
3
denom: uakt
4
pagination:
5
next_key: null
6
total: "0"
Copied!
If you don't have a balance, please see the funding guide. Please note the balance indicated is denominated in uAKT (AKT x 10^-6), in the above example, the account has a balance of 93 AKT. We're now setup to deploy.
Your account must have a minimum balance of 5 AKT to create a deployment. This 5 AKT funds the escrow account associated with the deployment and is used to pay the provider for their services. It is recommended you have more than this minimum balance to pay for transaction fees. For more information on escrow accounts, see here

Create your Configuration

Create a deployment configuration deploy.yaml to deploy the ovrclk/lunie-light for Lunie Light Node app container using SDL.
You can use cURL to download the file:
1
curl -s https://raw.githubusercontent.com/ovrclk/docs/master/guides/deploy/deploy.yaml > deploy.yaml
Copied!

What's in the Configuration?

You may use the sample deployment file as-is or modify it for your own needs as desscribed in our SDL (Stack Definition Language) documentation. A typical modification would be to reference your own image instead of our demo app image.
1
## DO NOT COPY PASTE THIS INTO TERMINAL
2
cat > deploy.yaml <<EOF
3
---
4
version: "2.0"
5
6
services:
7
web:
8
image: ovrclk/lunie-light
9
expose:
10
- port: 3000
11
as: 80
12
to:
13
- global: true
14
15
profiles:
16
compute:
17
web:
18
resources:
19
cpu:
20
units: 0.1
21
memory:
22
size: 512Mi
23
storage:
24
size: 512Mi
25
placement:
26
westcoast:
27
attributes:
28
host: akash
29
signedBy:
30
anyOf:
31
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
32
pricing:
33
web:
34
denom: uakt
35
amount: 1000
36
37
deployment:
38
web:
39
westcoast:
40
profile: web
41
count: 1
42
43
EOF
Copied!

What are Audited Attributes?

Audited attributes allow users deploying applications to be more selective about which providers can run their apps. Anyone on the Akash Network can assign these attributes to Providers via an on-chain transaction.
On the akashnet-2 network, to ensure tenants have smooth and reliable service from their provider, it is recommended to use the following audited attributes in their deployment: __
1
attributes:
2
host: akash
3
signedBy:
4
anyOf:
5
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
Copied!
--or--
1
attributes:
2
datacenter: equinix-metal-ewr1
3
signedBy:
4
anyOf:
5
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
Copied!
Please note that all of the following can be substituted in the datacenter field above and should be chosen based on your needs:
Datacenter
Location
equinix-metal-ewr1
New Jersey, United States
equinix-metal-sjc1
California, United States
equinix-metal-ams1
Amsterdam, Netherlands

Create a Certificate

Before you can create a deployment, a certificate must first be created. Your certificate needs to be created only once per account and can be used across all deployments.To do this, run:
1
akash tx cert create client --chain-id $AKASH_CHAIN_ID --keyring-backend $AKASH_KEYRING_BACKEND --from $AKASH_KEY_NAME --node $AKASH_NODE --fees 5000uakt
Copied!
You should see a response similar to:
1
{
2
"body": {
3
"messages": [
4
{
5
"@type": "/akash.cert.v1beta1.MsgCreateCertificate",
6
"owner": "akash1vns5ka3x69ekm3ecp8my8d5zfu8j23p5qew0w3",
7
"cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJ3RENDQVdXZ0F3SUJBZ0lJRm1pcUJWcWZDVmt3Q2dZSUtvWkl6ajBFQXdJd1NqRTFNRE1HQTFVRUF4TXMKWVd0aGMyZ3hkbTV6Tld0aE0zZzJPV1ZyYlRObFkzQTRiWGs0WkRWNlpuVTRhakl6Y0RWeFpYY3dkek14RVRBUApCZ1ZuZ1FVQ0JoTUdkakF1TUM0eE1CNFhEVEl4TURNd01qSXpNak15TmxvWERUSXlNRE13TWpJek1qTXlObG93ClNqRTFNRE1HQTFVRUF4TXNZV3RoYzJneGRtNXpOV3RoTTNnMk9XVnJiVE5sWTNBNGJYazRaRFY2Wm5VNGFqSXoKY0RWeFpYY3dkek14RVRBUEJnVm5nUVVDQmhNR2RqQXVNQzR4TUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowRApBUWNEUWdBRUtaSTlmWGVPVzRCYXRwcU1mb1VTekx2b01lWGlpbEZTMnJhZlhKdUNObUlMVjJMaWhIZW5JdjJTCjV5Uzh1Zkh5QmNMSUI5aFE1VE81THRHSUpPdzIvYU0xTURNd0RnWURWUjBQQVFIL0JBUURBZ1F3TUJNR0ExVWQKSlFRTU1Bb0dDQ3NHQVFVRkJ3TUNNQXdHQTFVZEV3RUIvd1FDTUFBd0NnWUlLb1pJemowRUF3SURTUUF3UmdJaApBSjJzQ3ZodGNzWkRXUkQ2MU03ZkVCRUk5eEt5Z0UzRkd3K2tIYVhZYXl0TUFpRUE4cUZtb3FEc1Z0ZzhPSHc1Ck5iOEljd0hiNHVkc0RpTzRxaWhoL0owNWZKaz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
8
"pubkey": "LS0tLS1CRUdJTiBFQyBQVUJMSUMgS0VZLS0tLS0KTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFS1pJOWZYZU9XNEJhdHBxTWZvVVN6THZvTWVYaQppbEZTMnJhZlhKdUNObUlMVjJMaWhIZW5JdjJTNXlTOHVmSHlCY0xJQjloUTVUTzVMdEdJSk93Mi9RPT0KLS0tLS1FTkQgRUMgUFVCTElDIEtFWS0tLS0tCg=="
9
}
10
],
11
"memo": "",
12
"timeout_height": "0",
13
"extension_options": [],
14
"non_critical_extension_options": []
15
},
16
"auth_info": {
17
"signer_infos": [],
18
"fee": {
19
"amount": [],
20
"gas_limit": "200000",
21
"payer": "",
22
"granter": ""
23
}
24
},
25
"signatures": []
26
}
Copied!

Create a Deployment

To deploy on Akash, run:
1
akash tx deployment create deploy.yaml --from $AKASH_KEY_NAME --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID --fees 5000uakt -y
Copied!
You should see a response similar to:
1
{
2
"height":"140325",
3
"txhash":"2AF4A01B9C3DE12CC4094A95E9D0474875DFE24FD088BB443238AC06E36D98EA",
4
"codespace":"",
5
"code":0,
6
"data":"0A130A116372656174652D6465706C6F796D656E74",
7
"raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-created\"},{\"key\":\"version\",\"value\":\"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"order-created\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"create-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000000uakt\"}]}]}]",
8
"logs":[
9
{
10
"msg_index":0,
11
"log":"",
12
"events":[
13
{
14
"type":"akash.v1",
15
"attributes":[
16
{
17
"key":"module",
18
"value":"deployment"
19
},
20
{
21
"key":"action",
22
"value":"deployment-created"
23
},
24
{
25
"key":"version",
26
"value":"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e"
27
},
28
{
29
"key":"owner",
30
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
31
},
32
{
33
"key":"dseq",
34
"value":"140324"
35
},
36
{
37
"key":"module",
38
"value":"market"
39
},
40
{
41
"key":"action",
42
"value":"order-created"
43
},
44
{
45
"key":"owner",
46
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
47
},
48
{
49
"key":"dseq",
50
"value":"140324"
51
},
52
{
53
"key":"gseq",
54
"value":"1"
55
},
56
{
57
"key":"oseq",
58
"value":"1"
59
}
60
]
61
},
62
{
63
"type":"message",
64
"attributes":[
65
{
66
"key":"action",
67
"value":"create-deployment"
68
},
69
{
70
"key":"sender",
71
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
72
},
73
{
74
"key":"sender",
75
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
76
}
77
]
78
},
79
{
80
"type":"transfer",
81
"attributes":[
82
{
83
"key":"recipient",
84
"value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8"
85
},
86
{
87
"key":"sender",
88
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
89
},
90
{
91
"key":"amount",
92
"value":"5000uakt"
93
},
94
{
95
"key":"recipient",
96
"value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u"
97
},
98
{
99
"key":"sender",
100
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
101
},
102
{
103
"key":"amount",
104
"value":"5000000uakt"
105
}
106
]
107
}
108
]
109
}
110
],
111
"info":"",
112
"gas_wanted":"200000",
113
"gas_used":"94653",
114
"tx":null,
115
"timestamp":""
116
}
Copied!

Find your Deployment Sequence

Now you need to extract the values below to shell variables. Find the DSEQ, OSEQ, and GSEQ in the deployment you just created. We will be using these to reference the deployment when signing the lease.
Attribute
Value
AKASH_DSEQ
140324
AKASH_OSEQ
1
AKASH_GSEQ
1
Remember to replace the AKASH_DSEQ, AKASH_OSEQ, and AKASH_GSEQ with the numbers from your deployment and configure the shell variable. Note that if this is your first time, OSEQ and GSEQ will be 1.
1
# Remember to change these numbers to match
2
AKASH_DSEQ=1361904
3
AKASH_OSEQ=1
4
AKASH_GSEQ=1
Copied!
Verify we have the right values populated by running:
1
echo $AKASH_DSEQ $AKASH_OSEQ $AKASH_GSEQ
Copied!
In this step, you post your deployment, the Akash marketplace matches you with a provider via auction. To create a deployment use akash deployment. The syntax for the deployment is akash tx deployment create <config-path> --from <key-name>.

Verify Deployment is Open

Check that the deployment was created by running:
1
akash query deployment get --owner $AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ
Copied!
You should see a response similar to:
1
deployment:
2
created_at: "140325"
3
deployment_id:
4
dseq: "140324"
5
owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj
6
state: active
7
version: K4b3eN6Myd9BVJDvoWLFjnoMKX+6yc241sZgDtpW8X4=
8
escrow_account:
9
balance:
10
amount: "5000000"
11
denom: uakt
12
id:
13
scope: deployment
14
xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324
15
owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj
16
settled_at: "140325"
17
state: open
18
transferred:
19
amount: "0"
20
denom: uakt
21
groups:
22
- created_at: "140325"
23
group_id:
24
dseq: "140324"
25
gseq: 1
26
owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj
27
group_spec:
28
name: westcoast
29
requirements:
30
attributes:
31
- key: host
32
value: akash
33
signed_by:
34
all_of: []
35
any_of:
36
- akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63
37
resources:
38
- count: 1
39
price:
40
amount: "1000"
41
denom: uakt
42
resources:
43
cpu:
44
attributes: []
45
units:
46
val: "100"
47
endpoints:
48
- kind: SHARED_HTTP
49
memory:
50
attributes: []
51
quantity:
52
val: "536870912"
53
storage:
54
attributes: []
55
quantity:
56
val: "536870912"
57
state: open
Copied!

Verify Order is Open

After a short time, you should see an order created for this deployment with the following command:
1
akash query market order get --node $AKASH_NODE --owner $AKASH_ACCOUNT_ADDRESS --dseq $AKASH_DSEQ --oseq $AKASH_OSEQ --gseq $AKASH_GSEQ
Copied!
You should see a response similar to:
1
created_at: "140325"
2
order_id:
3
dseq: "140324"
4
gseq: 1
5
oseq: 1
6
owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj
7
spec:
8
name: westcoast
9
requirements:
10
attributes:
11
- key: host
12
value: akash
13
signed_by:
14
all_of: []
15
any_of:
16
- akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63
17
resources:
18
- count: 1
19
price:
20
amount: "1000"
21
denom: uakt
22
resources:
23
cpu:
24
attributes: []
25
units:
26
val: "100"
27
endpoints:
28
- kind: SHARED_HTTP
29
memory:
30
attributes: []
31
quantity:
32
val: "536870912"
33
storage:
34
attributes: []
35
quantity:
36
val: "536870912"
37
state: open
Copied!

View your Bids

After a short time, you should see bids from providers for this deployment with the following command:
1
akash query market bid list --owner=$AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ
Copied!
You should see a response similar to:
1
bids:
2
- bid:
3
bid_id:
4
dseq: "140324"
5
gseq: 1
6
oseq: 1
7
owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj
8
provider: akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal
9
created_at: "140326"
10
price:
11
amount: "1"
12
denom: uakt
13
state: open
14
escrow_account:
15
balance:
16
amount: "50000000"
17
denom: uakt
18
id:
19
scope: bid
20
xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324/1/1/akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal
21
owner: akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal
22
settled_at: "140326"
23
state: open
24
transferred:
25
amount: "0"
26
denom: uakt
27
- bid:
28
bid_id:
29
dseq: "140324"
30
gseq: 1
31
oseq: 1
32
owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj
33
provider: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7
34
created_at: "140326"
35
price:
36
amount: "1"
37
denom: uakt
38
state: open
39
escrow_account:
40
balance:
41
amount: "50000000"
42
denom: uakt
43
id:
44
scope: bid
45
xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324/1/1/akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7
46
owner: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7
47
settled_at: "140326"
48
state: open
49
transferred:
50
amount: "0"
51
denom: uakt
Copied!

Choose a Provider

Note that there are bids from multiple different providers. In this case, both providers happen to be willing to accept a price of 1 uAKT. This means that the lease can be created using 1 uAKT or 0.000001 AKT per block to execute the container.
For this example, we will choose akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal.
For convenience and clarity for future referencing, we can extract the below value to a shell variable that we will be using to reference the deployment:
Attribute
Value
AKASH_PROVIDER
akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal
Replace the Value with the provider you select, and then run this command to set the provider shell variable:
1
AKASH_PROVIDER=akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal
Copied!
Verify we have the right value populated by running:
1
echo $AKASH_PROVIDER
Copied!

Create a Lease

Create a lease for the bid from the chosen provider above by running:
1
akash tx market lease create --chain-id $AKASH_CHAIN_ID --node $AKASH_NODE --owner $AKASH_ACCOUNT_ADDRESS --dseq $AKASH_DSEQ --gseq $AKASH_GSEQ --oseq $AKASH_OSEQ --provider $AKASH_PROVIDER --from $AKASH_KEY_NAME --fees 5000uakt
Copied!
After confirming your transaction, if see a response similar to the following, then you were likely just too slow and need to close your deployment and create a new deployment:
1
{"height":"1361880",
2
"txhash":"554579ED6917847777B645DDEB8B338C4ABC077DFF69517C9F17D55516296832",
3
"codespace":"market","code":12,"data":""
4
,"raw_log":"failed to execute message; message index: 0: bid not open"
5
,"logs":[],"info":"","gas_wanted":"200000","gas_used":"52035"
6
,"tx":null,"timestamp":""}
Copied!

Confirm the Lease

You can check the status of your lease by running:
1
akash query market lease list --owner $AKASH_ACCOUNT_ADDRESS --node $AKASH_NODE --dseq $AKASH_DSEQ
Copied!
You should see a response similar to:
1
leases:
2
- escrow_payment:
3
account_id:
4
scope: deployment
5
xid: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj/140324
6
balance:
7
amount: "0"
8
denom: uakt
9
owner: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7
10
payment_id: 1/1/akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7
11
rate:
12
amount: "1"
13
denom: uakt
14
state: open
15
withdrawn:
16
amount: "0"
17
denom: uakt
18
lease:
19
created_at: "141415"
20
lease_id:
21
dseq: "140324"
22
gseq: 1
23
oseq: 1
24
owner: akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj
25
provider: akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7
26
price:
27
amount: "1"
28
denom: uakt
29
state: active
Copied!
Please note that once the lease is created, the provider will begin debiting your deployment's escrow account, even if you have not completed the deployment process by uploading the manifest in the following step.

Send the Manifest

Upload the manifest using the values from above step:
1
akash provider send-manifest deploy.yaml --node $AKASH_NODE --dseq $AKASH_DSEQ --provider $AKASH_PROVIDER --home ~/.akash --from $AKASH_KEY_NAME
Copied!
You should expect no output from the above command.

Confirm the URL

Now that the manifest is uploaded, your image is deployed. You can retrieve the access details by running the below:
1
akash provider lease-status --node $AKASH_NODE --home ~/.akash --dseq $AKASH_DSEQ --from $AKASH_KEY_NAME --provider $AKASH_PROVIDER
Copied!
You should see a response similar to:
1
{
2
"services": {
3
"web": {
4
"name": "web",
5
"available": 1,
6
"total": 1,
7
"uris": [
8
"rga3h05jetf9h3p6dbk62m19ck.ingress.ewr1p0.mainnet.akashian.io"
9
],
10
"observed_generation": 1,
11
"replicas": 1,
12
"updated_replicas": 1,
13
"ready_replicas": 1,
14
"available_replicas": 1
15
}
16
},
17
"forwarded_ports": {}
18
}
Copied!
You can access the application by visiting the hostnames mapped to your deployment. In above example, its http://rga3h05jetf9h3p6dbk62m19ck.ingress.ewr1p0.mainnet.akashian.io

View your logs

You can view logs emitted from the Kubernetes pods to debug issues, watch progress, or otherwise show the state of the application with the following:
1
akash provider lease-logs --node $AKASH_NODE --from $AKASH_KEY_NAME --provider $AKASH_PROVIDER --dseq $AKASH_DSEQ
Copied!
You can view events emitted from Kubernetes, such as if a pod is failing, restarting, docker image has been pulled, etc. with the following:
1
akash provider lease-events --node $AKASH_NODE --dseq $AKASH_DSEQ --from $AKASH_KEY_NAME --provider $AKASH_PROVIDER
Copied!

Update your deployment

Updating active deployments is a two step process. First, edit your deployment YAML file with the desired changes.
Akash Groups are translated into Kubernetes Deployments, this means that only a few fields from the Akash SDL are mutable. For example image, command, args, env and exposed ports can be modified, but compute resources and placement criteria cannot.
    1.
    Update your deployment by running:
    1
    akash tx deployment update deploy.yaml --dseq $AKASH_DSEQ --from $AKASH_KEY_NAME --chain-id $AKASH_CHAIN_ID --node $AKASH_NODE --fees=5000uakt
    Copied!
    After confirming your transaction, you should see a response similar to this:
    1
    {
    2
    "height":"98503",
    3
    "txhash":"94FEF5ACB39145BB41ECB1FC224480ED5C80414D0757FC07C844B16EC246D304",
    4
    "codespace":"",
    5
    "code":0,
    6
    "data":"0A130A117570646174652D6465706C6F796D656E74",
    7
    "raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-updated\"},{\"key\":\"version\",\"value\":\"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"98199\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"update-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"}]}]}]",
    8
    "logs":[
    9
    {
    10
    "msg_index":0,
    11
    "log":"",
    12
    "events":[
    13
    {
    14
    "type":"akash.v1",
    15
    "attributes":[
    16
    {
    17
    "key":"module",
    18
    "value":"deployment"
    19
    },
    20
    {
    21
    "key":"action",
    22
    "value":"deployment-updated"
    23
    },
    24
    {
    25
    "key":"version",
    26
    "value":"2b86f778de8cc9df415490efa162c58e7a0c297fbac9cdb8d6c6600eda56f17e"
    27
    },
    28
    {
    29
    "key":"owner",
    30
    "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
    31
    },
    32
    {
    33
    "key":"dseq",
    34
    "value":"98199"
    35
    }
    36
    ]
    37
    },
    38
    {
    39
    "type":"message",
    40
    "attributes":[
    41
    {
    42
    "key":"action",
    43
    "value":"update-deployment"
    44
    },
    45
    {
    46
    "key":"sender",
    47
    "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
    48
    }
    49
    ]
    50
    },
    51
    {
    52
    "type":"transfer",
    53
    "attributes":[
    54
    {
    55
    "key":"recipient",
    56
    "value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8"
    57
    },
    58
    {
    59
    "key":"sender",
    60
    "value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
    61
    },
    62
    {
    63
    "key":"amount",
    64
    "value":"5000uakt"
    65
    }
    66
    ]
    67
    }
    68
    ]
    69
    }
    70
    ],
    71
    "info":"",
    72
    "gas_wanted":"200000",
    73
    "gas_used":"58833",
    74
    "tx":null,
    75
    "timestamp":""
    76
    }
    Copied!
    Note the code: 0 shown in the successful deployment update output above.
    2.
    Send the updated manifest by running:
    1
    akash provider send-manifest deploy.yaml --keyring-backend $AKASH_KEYRING_BACKEND --node $AKASH_NODE --from $AKASH_KEY_NAME --provider $AKASH_PROVIDER --dseq $AKASH_DSEQ --log_level info --home ~/.akash
    Copied!
Between the first and second step, the prior deployment's containers will continue to run until the new manifest file is received, validated, and new container group operational. After health checks on updated group are passing; the prior containers will be terminated - this process may take a couple minutes to complete.

Add funds to your Deployment

You will eventually need to add funds to the escrow account associated with your deployment to keep it running. If the account becomes overdrawn due to lack of funds, the deployment will permanently close and require you to complete the deploy process again. This in turn will also assign a new, random URI for the deployment.
Deposit additional funds to your escrow account by running:
1
akash tx deployment deposit --from $AKASH_KEY_NAME --chain-id $AKASH_CHAIN_ID --keyring-backend $AKASH_KEYRING_BACKEND --node $AKASH_NODE 10000uakt --dseq $AKASH_DSEQ --fees=5000uakt
Copied!
After confirming the transaction, you should see a response similar to:
1
{
2
"height":"141905",
3
"txhash":"DBB5AE97701172506B46B59C46095BC17CF4474E07AABF912D43DC36F57B1E69",
4
"codespace":"",
5
"code":0,
6
"data":"0A140A126465706F7369742D6465706C6F796D656E74",
7
"raw_log":"[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"deposit-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"10000uakt\"}]}]}]",
8
"logs":[
9
{
10
"msg_index":0,
11
"log":"",
12
"events":[
13
{
14
"type":"message",
15
"attributes":[
16
{
17
"key":"action",
18
"value":"deposit-deployment"
19
},
20
{
21
"key":"sender",
22
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
23
},
24
{
25
"key":"sender",
26
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
27
}
28
]
29
},
30
{
31
"type":"transfer",
32
"attributes":[
33
{
34
"key":"recipient",
35
"value":"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8"
36
},
37
{
38
"key":"sender",
39
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
40
},
41
{
42
"key":"amount",
43
"value":"5000uakt"
44
},
45
{
46
"key":"recipient",
47
"value":"akash14pphss726thpwws3yc458hggufynm9x77l4l2u"
48
},
49
{
50
"key":"sender",
51
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
52
},
53
{
54
"key":"amount",
55
"value":"10000uakt"
56
}
57
]
58
}
59
]
60
}
61
],
62
"info":"",
63
"gas_wanted":"200000",
64
"gas_used":"71665",
65
"tx":null,
66
"timestamp":""
67
}
Copied!

Find deployments

The following commands will filter the full deployment list (requires jq to be installed)
1
akash query deployment list -o json | jq '[.deployments[] | .deployment | select(.state == "closed") | .deployment_id]'
2
akash query deployment list -o json | jq '[.deployments[] | .deployment | select(.state == "active") | .deployment_id]'
Copied!

Close your deployment

When you are done with your application, close the deployment. This will deprovision your container and stop the token transfer.
Close deployment using deployment by creating a deployment-close transaction:
1
akash tx deployment close --node $AKASH_NODE --chain-id $AKASH_CHAIN_ID --dseq $AKASH_DSEQ --owner $AKASH_ACCOUNT_ADDRESS --from $AKASH_KEY_NAME --keyring-backend $AKASH_KEYRING_BACKEND -y --fees 5000uakt
Copied!
You should see a response similar to below as a confirmation your deployment is closed:
1
{
2
"height":"141928",
3
"txhash":"406B359910E4AD0944DA3C00D66B79179849B1A894C73A8CAA3CA0D93E44A1AA",
4
"codespace":"",
5
"code":0,
6
"data":"0A120A10636C6F73652D6465706C6F796D656E74",
7
"raw_log":"[{\"events\":[{\"type\":\"akash.v1\",\"attributes\":[{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"deployment-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"module\",\"value\":\"deployment\"},{\"key\":\"action\",\"value\":\"group-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"order-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"bid-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"provider\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"price-denom\",\"value\":\"uakt\"},{\"key\":\"price-amount\",\"value\":\"1\"},{\"key\":\"module\",\"value\":\"market\"},{\"key\":\"action\",\"value\":\"lease-closed\"},{\"key\":\"owner\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"dseq\",\"value\":\"140324\"},{\"key\":\"gseq\",\"value\":\"1\"},{\"key\":\"oseq\",\"value\":\"1\"},{\"key\":\"provider\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"price-denom\",\"value\":\"uakt\"},{\"key\":\"price-amount\",\"value\":\"1\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"close-deployment\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"akash17xpfvakm2amg962yls6f84z3kell8c5lazw8j8\"},{\"key\":\"sender\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"amount\",\"value\":\"5000uakt\"},{\"key\":\"recipient\",\"value\":\"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"5009487uakt\"},{\"key\":\"recipient\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"513uakt\"},{\"key\":\"recipient\",\"value\":\"akash1f6gmtjpx4r8qda9nxjwq26fp5mcjyqmaq5m6j7\"},{\"key\":\"sender\",\"value\":\"akash14pphss726thpwws3yc458hggufynm9x77l4l2u\"},{\"key\":\"amount\",\"value\":\"50000000uakt\"}]}]}]",
8
"logs":[
9
{
10
"msg_index":0,
11
"log":"",
12
"events":[
13
{
14
"type":"akash.v1",
15
"attributes":[
16
{
17
"key":"module",
18
"value":"deployment"
19
},
20
{
21
"key":"action",
22
"value":"deployment-closed"
23
},
24
{
25
"key":"owner",
26
"value":"akash1vn06ycjjnvsvl639fet9lajjctuturrtx7fvuj"
27
},
28
{
29
"key":"dseq",
30
"value":"140324"
31