DEV Community

Cover image for Deploy a Substrate Node in Minutes using Spheron Compute
SpheronStaff for Spheron

Posted on • Originally published at blog.spheron.network on

Deploy a Substrate Node in Minutes using Spheron Compute

Substrate empowers developers to easily create custom blockchains, providing a flexible and modular foundation for blockchain applications. Deploying a Substrate Node on the Akash Network is now easier than ever, thanks to Spheron Compute.

This step-by-step guide will walk you through the process, allowing you to set up your Substrate Node within minutes. Whether you're a blockchain enthusiast, developer, or organization looking to participate in network validation, this quick deployment method will get you up and running without the hassle of manual configurations.

What is Substrate?

Substrate is a powerful blockchain framework designed for creating customized and autonomous blockchains with minimal effort. Launching a blockchain is the quickest way since developers don't need to worry about essential components like networking, data layer, transaction queue, and consensus. With Substrate, projects can be easily upgraded using modular components called pallets tailored to specific needs. This framework offers flexibility and modularity, allowing developers to choose between technical freedom and ease of development at different stages of blockchain development. Unlike some other frameworks, Substrate supports on-chain upgrades, enabling modifications to smart contracts without the restrictions faced by Ethereum's smart contracts, which cannot be changed once deployed.

What is Spheron Network?

Spheron Network is a next-generation PaaS that offers low-cost and seamless access to Web3 infrastructure across multiple chains. It is explicitly designed to serve a broader audience, including startups, developers, and organizations looking to scale their infrastructure.

Spheron Network offers a Compute Marketplace that you can use to set up useful tools like Substrate Node quickly. With Spheron, you don't have to worry about the technical stuff, and you can focus on deploying your Substrate Node with ease. In addition to compute, web hosting, and storage capabilities, Spheron offers many features to enhance productivity and enable stakeholders to reach new heights while prioritizing privacy, security, and reliability.

Why will anyone use Substrate?

1.Technical Fit and Features: Substrate provides a comprehensive set of features out of the box, including peer-to-peer networking, consensus mechanisms, governance tools, and an EVM implementation. This capability enables projects to save significant time and effort that would otherwise be spent on building these functionalities from scratch.

2.Forkless Upgrades: Substrate facilitates seamless and automatic upgrades to blockchain runtimes, allowing projects to update their rules without disrupting continuity.

3.Customization for Applications: The flexibility of Substrate allows for customization of various aspects, such as fee payment logic and transaction pools. This is particularly beneficial for projects that require tailored transaction handling.

4.EVM Support and Interoperability: Substrate's EVM pallet supports EVM & Solidity smart contracts, fostering compatibility with existing contracts and developers. Interoperability within a broader ecosystem is highlighted.

5.Multi Virtual Machines and Scalability: Substrate's support for multiple virtual machines, including WebAssembly and EVM, is crucial for the next-generation smart contract platforms, promoting interoperability between virtual machines.

6.Interoperability and Asset Expansion: Substrate enables projects to connect to various blockchain networks, expanding the range of available assets. This interconnected approach eliminates the need for users to manage liquidity across different protocols.

7.Tooling and Off-Chain Workers: Substrate's off-chain worker functionality is a valuable tool for speeding up chain processes and offloading business logic, contributing to the efficiency of decentralized applications.

8.Custom Consensus Layer without Compromising Core Functionalities: Substrate empowers the system to add a custom consensus layer to its node without impacting core functionalities like finality and block production. This customization is crucial to the system's architecture and impossible without Substrate's flexibility and capabilities.

How to deploy a Substrate Node using Spheron Compute?

You can follow these steps to deploy a Substrate Node on Spheron Compute.

Step 1: Create a Free Spheron Network Account

  1. Visit Spheron Network: https://spheron.network/

  2. On the Spheron homepage, locate and click the "Free Trial" button.

  3. You'll be directed to a login/signup page. Choose your preferred authentication method: Web2 (GitHub account, GitLab account, or Bitbucket account) or Web3 (Ethereum).

  4. Follow the provided prompts to authenticate your chosen account securely. This step ensures safe access to the Spheron Network platform.

  5. After successful authentication, you'll be guided to a confirmation page confirming the completion of your account setup.

Step 2: Creating an Organization

  1. Upon logging in, navigate to the "Compute" section using the dropdown on the top right corner.

  2. You'll be prompted to create your organization's name, username, and Avatar. Add and click Save.

  3. Next, you'll be taken to a new page. Click the "New Cluster" button.

Step 3: Deploying a Substrate Node With Spheron Platform UI

Follow these steps to deploy a Substrate Node:

  1. Choose "Compute" to use CPU-based instances for running containers.

  2. Choose the compute you need from the options under "Compute Type." You can pick the one that suits your requirements.

NOTE: Please schedule a team call to gain early access to the On Demand Type.

3.Select "Start from Marketplace App".

4.Pick "Substrate" from the marketplace. It's as easy as choosing an app you want to install.

5.Select your preferred region for deployment. The container will be deployed in any region for Spot or in the EU-east region for On Demand. Choosing a region closer to your users can improve performance and reduce latency. Spheron offers the following regions to choose from for Spot:

  • US-east

  • US-west

  • US-central

  • EU-west

  • Any

NOTE: It is recommended to select any region for Spot to get a higher chance of successful deployment, as it will deploy on any providers in the network.

6.Next, Choose an instance plan that aligns with your requirements. Spheron will recommend a suitable plan according to the Substrate template, but you can customize it from available plans or choose to 'Create Custom Plans.'

7.Next, Configure storage:

You have to choose Storage from the available options. This storage will be volatile storage and is erased when the instance is restarted, redeployed, or shut down.

Additionally, you get the option to choose Persistent Storage. Persistent storage will not be erased unless the instance is closed. If choosing persistent storage, specify the type of storage (HDD, SSD, NVMe) and Add mount point.

8.For advanced configurations, feel free to explore more options. Just click here to learn more about these advanced settings.

9.Once you're all set, click "Deploy" to start the deployment process. It's as simple as that!

That's it! Your Substrate Node instance will now be deployed.

NOTE: Keep in mind that you can access the Substrate Node only after the Compute Instance is provisioned. So, allow some time for the installation to complete before you can start using it.

Connecting to Substrate Node

  • The Substrate Node can be accessed only after the Compute Instance is provisioned. Thus, you must wait for the installation to complete before you can use it.

  • As the node starts, the Instance Logs will display the operations' output. If you see messages that blocks are being proposed and finalized, you have a running node.

  ... Idle (0 peers), best: #3 (0xcc78…5cb1), finalized #1 ...
  ... Starting consensus session on top of parent ...
  ... Prepared block for proposing at 4 (0 ms) ...

Enter fullscreen mode Exit fullscreen mode
  • To interact with your Substrate Node, use the Connection URL provided by Spheron under Port Policy Info.

Interact with your Substrate Node

You can interact with your newly deployed node using the Substrate Frontend Template. This template allows you to create a front-end application that connects to a Substrate node back-end with minimal configuration. To learn about Substrate, visit the Substrate Documentation.

Prerequisites

To successfully follow this guide, you will need the following:

  • Git and yarn are installed on your local machine.

  • A text editor. You can use Visual Studio Code or your favorite text editor.

Usage

  1. Clone this repository: git clone <https://github.com/substrate-developer-hub/substrate-front-end-template.git>

  2. Install Dependencies:

cd substrate-front-end-templateyarn install
Enter fullscreen mode Exit fullscreen mode

3.Start the template: yarn start

4.Navigate to: cd src/config

5.Update PROVIDER_SOCKET in development.json to the Connection URL provided by Spheron under Port Policy Info for Port 9944 and prepend ws://.

{ "PROVIDER_SOCKET": "ws://<connection-url-for-port-9944>"}
Enter fullscreen mode Exit fullscreen mode

Now, you can view the metadata and information about your Substrate node. You can interact with the node by transferring amounts between users. Paste the user's address and the desired amount you wish to send. You can then observe the transaction details under the Events section.

Configuration

The template's configuration is stored in the src/config directory, with common.json being loaded first, then the environment-specific JSON file, and finally, environment variables, with precedence.

  • development.json affects the development environment

  • test.json affects the test environment, triggered in yarn test command.

  • production.json affects the production environment, triggered by the yarn build command.

How to Specify the WebSocket to Connect to

There are two ways to specify the websocket to connect to:

  • With PROVIDER_SOCKET in {common, development, production}.json.

  • With rpc=<ws or wss connection> query parameter after the URL. This overrides the above setting.

Benefits of Deploying Substrate Node with Spheron Compute

Deploying your Substrate Node with Spheron Compute offers many benefits, including:

  1. Simplicity and Speed: Spheron Compute's user-friendly interface and streamlined deployment process make it easy for beginners and experienced users to set up a Substrate Node quickly. You can save valuable time that would otherwise be spent on server provisioning and configuration.

  2. Cost-Efficiency: Spheron Compute provides cost-effective solutions, ensuring you get the most out of your resources. You can choose the plan that aligns with your budget and scale as needed without breaking the bank.

  3. Reliability and Performance: Spheron's infrastructure is designed for stability and high performance. Your Substrate Node will run smoothly, ensuring you can access your data when needed, without interruptions.

  4. Flexibility: With various instance plans and the ability to create custom plans, you can tailor your deployment to meet your specific requirements. This flexibility allows you to optimize your resources for the best performance.

  5. Persistent Storage: Spheron Compute offers the option to add persistent storage, ensuring your data is safe and accessible even if the instance is updated or replaced.

  6. Scalability: Whether you're starting small or planning for growth, Spheron Compute allows you to scale your Substrate Node deployment easily. You can handle increasing data volumes and growing user demands effortlessly.

  7. Support and documentation: Spheron provides comprehensive documentation and support, helping you navigate any challenges you may face during deployment and development.

Conclusion

Whether you're a blockchain enthusiast, developer, or organization seeking to harness the power of Substrate, Spheron Network offers an efficient and accessible solution. Don't miss out on the blockchain revolution. Start your Substrate Node deployment journey today and be part of the ever-expanding world of web3 innovation.

Explore the Spheron Guide to start your journey toward hassle-free deployment and development.

Resources

Spheron Substrate Node Guide: https://docs.spheron.network/marketplace-guide/substrate/

Substrate Node Documentation: https://docs.substrate.io/quick-start/start-a-node/

Top comments (0)