This guide will walk you through deploying a simple “Hello World” Next.JS application onto the Akash Network via The Akash CLI. This guide is beginner-friendly and requires no previous knowledge of navigating the Akash CLI or Akash Network in general.
Before Getting Started
You must have Akash CLI installed and properly configured along with some AKTs in your wallet(0.5 AKT minimum for a single deployment plus a small amount for transaction fees).
Check your account has sufficient balance by running:
You should see a response similar to:
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.
Note: Your account must have a minimum balance of 0.5 AKT to create a deployment. This 0.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
STEP 1:- Create your Configuration
Create a deployment configuration deploy.yaml to deploy the akashlytics/hello-akash-world:0.2.0 for hello-akash-world which is a simple Next.JS “Hello World” application.
You can use CURL command to download the SDL file:
The SDL file is the configuration file specifying all the needed resources like cpu, ram, storage etc. Since, this is a simple “Hello World” application so the needed resources will be very less.
STEP 2:- Create your Deployment
To deploy the sdl file that we curled in the previous step, run following command:
You should see a response similar to:
Find your Deployment
Find the Deployment Sequence (DSEQ) in the deployment you just created. For example, in the current deployment the dseq value is 140324, which you can confirm in the response above.
Then run the following command, make sure to copy paste the DSEQ value from your deployment:
Now set the Order Sequence (OSEQ) and Group Sequence (GSEQ). Note that if this is your first time deploying on Akash, OSEQ and GSEQ will be 1.
Verify we have the right values populated by running:
STEP 3:- View your Bids and choose a provider
After a short time, you should see bids from providers for this deployment with the following command:
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. You should see a response similar to:
For this example, we will choose provider akash10cl5rm0cqnpj45knzakpa4cnvn5amzwp4lhcal. Run following command to set the provider shell variable:
Verify we have the right value populated by running:
STEP 4:- Create and confirm a Lease
Create a lease for the bid from the chosen provider above by running this command:
Confirm the Lease
You can check the status of your lease by running:
Note the bids will close automatically after 5 minutes, and you may get the response:
If this happens, close your deployment and open a new deployment again. To close your deployment run this command:
If your lease was successful you should see a response that ends with:
Note: 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:
Confirm the URL
Now that the manifest is uploaded, your image is deployed. You can retrieve the access details by running the following command:
You should see a response similar to:
You can access the application by visiting the hostnames mapped to your deployment. Look for a URL/URI and copy it to your web browser.
Then you should be able to see the landing page of the “Hello World” Application”
View your logs
You can view your application logs to debug issues or watch progress like so:
STEP 5:- Close Deployment
Close the Deployment
Now, since we have learned how to deploy the ‘Hello World’ application, we will close the deployment in order to not waste any AKTs. After closing the deployment we will get the remaing balance left as a refund.
Run following command to close the deployment:
Conclusion
We deployed a simple “Hello World” Next.JS application within 5 minutes. The process of deploying any other applications is identical, just the sdl file needs to be changed accordingly with proper configuration and container image.