Running Nodes

Complete guide for setting up, configuring, and maintaining Sonr blockchain nodes

This guide provides detailed instructions for installing the Sonr blockchain node (snrd), the Highway proxy (hway), and the Motr enclave (motr) for local development and testing.

Prerequisites

Before you begin, ensure you have the following prerequisites installed on your system:

  • Go: Version 1.18 or higher
  • Node.js: Version 16 or higher
  • Docker: For running isolated network environments
  • Git: For cloning the Sonr repository
  • Make: For running build commands

Installation from Source

Clone the Repository

Clone the official Sonr repository from GitHub:

git clone https://github.com/sonr-io/sonr.git
cd sonr

Build the Binaries

Use the provided Makefile to build the necessary binaries. This command will compile snrd, hway, and motr and place them in your $GOPATH/bin directory.

make install

Verify the Installation

Check that the binaries were installed correctly by running the version command for each component:

snrd version
hway version
motr version

Each command should output the version number of the respective component.

Running a Local Network

Once you have installed the Sonr components, you can start a local development network.

Start the Network

Use the localnet-start command to initialize and start a local network with a single validator node:

make localnet-start

This command will:

  • Initialize a new Sonr blockchain with a single validator.
  • Start the snrd node.
  • Start the hway proxy server.
  • Start the motr enclave runtime.

The local network is configured for development purposes and is not suitable for production use. It uses a single validator and has a predictable genesis state.

Stop the Network

To stop the local network, use the localnet-stop command:

make localnet-stop

This will gracefully shut down all running components.

Reset the Network

To reset the local network to its genesis state, use the localnet-reset command. This will delete all blockchain data and start fresh on the next localnet-start.

make localnet-reset

Docker Installation (Coming Soon)

We are currently working on providing Docker images for all Sonr components to simplify the installation and deployment process. This section will be updated with instructions for running Sonr with Docker once the images are available.

Next Steps

Now that you have a local Sonr network running, you can start building applications. Check out our quickstart guides to get started: