Skip to content

liathoffman/local-testnet

 
 

Repository files navigation

Spacemesh logo

A programmable Cryptocurrency

Spacemesh Local Testnet (Localnet)

This repo contains the framework for running a 6 nodes 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 .

Prerequisites

OS X setup

  • Install docker
  • Install brew
  • Run the following from the terminal:
brew install git
brew install go
brew install python
brew install docker
sudo easy_install pip
pip install virtualenv

Building from Source Code

  1. Clone this repo to your computer

  2. From the shell run:

setup.sh
  1. Create virtual environment for running the testnet
virtualenv --python=python3 venv
  1. Activate virtual env and install requirements
source venv/bin/activate
pip install -r requirements.txt

Running

python testnet.py

Logs are available in the logs directory.

Executing Transactions

  1. Navigate to CLIWallet directory in your go src directory.
cd $GOPATH/src/github.com/spacemeshos/CLIWallet
  1. Run
./CLIWallet
  1. You should see a list of accounts. Choose one. e.g. enter anton
  2. Enter account to view anton's account balance
  3. Enter transfer coins to transfer coin to another account and follow the on-screen instructions

Working with the Localnet

Please follow the steps in our localnet guide.

Troubleshooting

  • Docker cannot run without sudo: please refer to this guide
  • Fluentd container does not boot: make sure logs dir exists and has {user} rw permissions
  • 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

About

A local testnet of go-spacemesh full nodes running the Spacemesh protocol and a functional CLI wallet. 💾⏰

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages