The pegnet docker will help you get up and running for development in no time.
To be able to run PegNet you must have Docker and docker-compose, docker versions change depending on your setup.
- Docker and docker-compose installed.
- Follow instructions at https://docs.docker.com/compose/install/
- factom-cli installed in your host.
From wherever you have cloned this repo
- Create your config file from
config/defaultconfig.ini
using
cp config/defaultconfig.ini config/pegnetconfig.ini
- Edit the following values on
pegnetconfig.ini
FactomdLocation="factomd:8088"
WalletdLocation="walletd:8089"
- After you have copied and setup your config file, run
docker-compose up
docker-compose will create and run 3 services:
- factomd (factomd_container)
- walletd (walletd_container)
- pegnet (pegnet_container)
You should have factomd and walletd running at this point. You will have to start the miner separately (see below).
Now that we have factomd and walletd running, we need to buy some Entry Credits and fund the default EC address, run (not in docker)
./initialization/fundEC.sh
This will fund the EC address (requires factom-cli)
After making sure the chains are created, run
docker-compose run --rm pegnet go run initialization/main.go
Now that we have everything set up, we can run a basic validator node:
docker-compose run --rm pegnet go run pegnet.go --log=debug
Or a node with a set number of miners:
docker-compose run --rm pegnet go run pegnet.go --log=debug --miners=4
- run
docker-compose up -d
(running in daemon mode) - run
docker-compose build --no-cache pegnet
(builds the pegnet image) - run
docker-compose run --rm pegnet bash
(run a temp pegnet container with bash)
- run
docker-compose down
- run
docker volume rm factomd_volume_volume
(resets factomd data) - run
docker volume rm pegnet_walletd_volume
(resets walletd data)