A programmable Cryptocurrency
Spacemesh Local Testnet (Localnet)
This repo contains the framework for running a 6 node Spacemesh testnet locally on one computer. It contains a setup script that clones and builds all the relevant repositories required for running a localnet. To learn more about the Spacemesh cryptocurrency visit https://spacemesh.io .
Warning: The local testnet is an experimental alpha software in active development. It is built for developers who are comfortable with the command line, Docker, and dev env setup. You also need a strong modern dev computer to run it such as a Macbook Pro or a strong modern dev desktop computer. That said, we have tested it to work on all supported platforms and most of the issues we see are env setup.
Watch Youtube Video Tutorial
- OS X or Linux. Windows 10 Pro support is being tested.
- go lang v1.11+
- virtualenv + pip
- Docker. Please read this guide for Ubuntu. For OS X download and install Docker Desktop from https://hub.docker.com/editions/community/docker-ce-desktop-mac
OS X setup
brew install git brew install go brew install python3 brew install docker sudo easy_install pip pip install virtualenv
Building from Source Code
The local testnet is 100% built from open source code from the Spacemesh github repos, and doesn't use any prepackaged pre-built binaries.
- Clone this repo to your computer
git clone https://github.com/spacemeshos/local-testnet.git
- From the shell run:
sudo chmod u+x setup.sh ./setup.sh
- Create virtual environment for running the testnet
virtualenv --python=python3 venv
- Activate virtual env and install requirements
source venv/bin/activate pip install -r requirements.txt
Note that the localnet includes an instance of the POET service which is a CPU intensive process. For public testnets and the mainnet, you will not need to run a local POET service instance only 1 full node instance. You need a relatively strong dev box such as a modern MBP to run the localnet.
- Activate virtual env if you are not already in a virtual env session:
- Let it rip:
The testnet logs are available in the
- Open a new Terminal window and navigate to the
CLIWalletdirectory in your go
- Run the wallet
- You should see a list of accounts. Choose one. e.g. enter
accountto view Anton's account balance
transfer coinsto transfer coin to another account and follow the on-screen instructions
Working with the Localnet
- Please follow the steps in our localnet guide.
- Docker cannot run without sudo: please refer to this guide
- Container does not boot: make sure
logsdir exists and has
- Nodes stop producing blocks after 30 min - this is an issue with dockers DNS resolving, adding custom dns address to docker config should solve this problem
Linux Setup Tips
- Follow the instructions in this guide to setup Docker desktop on Ubuntu
Questions, Comments, Feedback?
- Spacemesh dev gitter channel
Windows Setup Tips (WIP)
- You need to use Win 10 Pro - Win 10 Home is not supported because it doesn't support Docker Desktop.
- You need to enable virtualization to run Docker desktop in Windows 10 Pro.
- Use the git bash console to run things and not the command line.
- Use these guides to setup python, pip and and virtual env:
- to be added