Launch your dApp/app using Spheron CLI
Table of contents
Many people are interested in and find the realm of decentralised apps incredibly fascinating. However, the current state of blockchain makes it challenging to get your system to meet the minimum criteria needed to build and run a blockchain application. This is where Spheron CLI comes in handy. With it, you can quickly and easily deploy your application across any network by typing a few lines into the terminal. Yes, you heard correctly—all you need is a terminal.😎
About Spheron CLI
It is a command-line interface tool that is used for managing and deploying decentralized applications on the blockchain network. It is built on top of popular frameworks such as react native and Ethereum making it compatible with a wide range of platforms. The main goal of Spheron CLI is to remove the complexities in deploying an application on a blockchain network which it succeeds in doing with the help of commands and configurations which streamline the overall process, from development to deployment.
Getting Started with Spheron CLI
- First, we have to open a terminal, if you are a Windows user preferably use Windows Subsystem for Linux.
(Follow this link till Step 8 to install Windows Subsystem for Linux)
Paste the command given below inside the terminal.
sudo npm install -g @spheron/cli
This would install the sphere cli on your system.
Use the latest npm version for using spheron CLI.
Paste the command below to see all commands provided by Spheron.
spheron --help
Now we need to login into our Spheron account, if you haven't made an account yet go to https://spheron.network/ to sign up. After that type in the terminal the command given below.
spheron login
- You will get three options choose either of them to log in.
I chose GitHub, you can select either of the three. If you get a window like this, it means you have successfully login to Spheron CLI.
Kudos on your performance till now 🎉.
Now use the command spheron create-app
to develop a boilerplate application for the deployment on IPFS protocol using spheron CLI.
spheron create-app
Choose the default template option for now. After that choose either of the option given i.e. react js or next js. For this tutorial, we will go with the next js.
After this, you will be asked to write a name for your application, after that choose the protocol you want to upload to. After completing all these steps you will get a message like given in the picture below.Change the directory in your app using the
cd my-app
command.
You can check the file structure usingls
command and can open it up on visual studio code usingcode .
command.After that use the command
npm run build
to run your application. If it is showing some error, try it again after runningnpm install next.
After this run
npm run export
. If you want to know more about export commands refer to (https://www.freecodecamp.org/news/node-module-exports-explained-with-javascript-export-function-examples/).
After running the command you will get an output like the one shown below.After this run the command given below.
spheron publish
This would upload your code to the protocol you have chosen.
Congratulations you have understood how to deploy your application using Spheron CLI. You can make changes to the boilerplate code and use libraries such as hardhat to create a fully functional app and deploy it easily using Spheron CLI.
Conclusion
Getting your mobile app or decentralised application to the market might be challenging. However, if we utilise the Spheron CLI, the difficulty associated with deploying decentralised apps is much reduced. These technologies enable programmers and business owners to concentrate on creating cutting-edge technology rather than struggling with the challenging process of deploying an app on a blockchain network.
Give Spheron CLI a try if you want to launch your dApp or app. It is a great tool to have in your development toolbox because of its simplicity of use, interoperability with well-known frameworks, and strong deployment capabilities. Utilise Spheron CLI right away to advance your decentralised application or mobile app.
Subscribe to my newsletter
Read articles from Priyanshu Pandey directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by