7.1 Running a Devnet Locally

For testing your programs, you'll want to deploy them on a local devnet and execute test transitions there, instead of doing everything on the testnet. Here's how to run a local devnet.

Install tmux

To run a local devnet with the script, start by installing tmux.

macOS

To install tmux on macOS, you can use the Homebrew package manager. If you haven't installed Homebrew yet, you can find instructions at their website.

# Once Homebrew is installed, run:
brew install tmux
Ubuntu

On Ubuntu and other Debian-based systems, you can use the apt package manager:

sudo apt update
sudo apt install tmux
Windows

There are a couple of ways to use tmux on Windows:

Using Windows Subsystem for Linux (WSL)

  1. Once WSL is set up and you have a Linux distribution installed (e.g., Ubuntu), open your WSL terminal and install tmux as you would on a native Linux system:

sudo apt update
sudo apt install tmux

Start the Local Devnet

To start a local devnet, run:

./devnet.sh

Follow the instructions in the terminal to start the devnet, press enter to use the default parameters.

Development private keys and addresses are then printed to the terminal. You can scroll up using ctrl+b+[. Be quick because history is limited by default.

Interface

Switch Nodes (forward)

To toggle to the next node in a local devnet, run:

Ctrl+b n

Switch Nodes (backwards)

To toggle to the previous node in a local devnet, run:

Ctrl+b p

Select a Node (choose-tree)

To select a node in a local devnet, run:

Ctrl+b w

Select a Node (manually)

To select a node manually in a local devnet, run:

Ctrl+b :select-window -t {NODE_ID}

Stop the Local Devnet

To stop a local devnet, run:

Ctrl+b :kill-session

Then, press Enter.

Lightweight Alternative

Amaraleo is a lightweight version for running snarkOS with devnet.sh:

Last updated