This directory contains instructions for configuring and running GoChain with docker-compose
on the testnet
, mainnet
, a private network, or a local development instance.
Instructions for running a signing node are here.
Install docker
and docker-compose
.
Simple Install Instructions
Docker:
sudo rm /var/lib/apt/lists/*
sudo apt-get update
curl -fsSL https://get.docker.com/ | sudo sh
docker info
Docker Compose:
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
*Note: If you are moving from the testnet to the mainnet, it is best to start fresh in a new folder.
- Copy
docker-compose.yml
into your folder from either thetestnet
ormainnet
directory. - (Optional) Create a file
.env
to override the default variables: (seeexample.env
for more details)
GOCHAIN_TAG=2.1.16
GOCHAIN_CACHE=2048
- Launch
docker-compose
docker-compose up -d
- Make sure that node works.
docker logs -f node
- Start:
docker-compose up -d
- Stop:
docker-compose down
- Follow Logs:
docker logs -f --tail 100 node
- Restart Container:
docker-compose restart node
- Restart All:
docker-compose down && docker-compose up -d
- Console Attach:
docker run --rm -it -v $PWD:/gochain -w /gochain gcr.io/gochain-core/gochain gochain --datadir /gochain/node attach
- Update image:
docker-compose pull
- Enode:
admin.nodeInfo.enode
- Balance:
eth.getBalance('0xabcd')
- Coinbase Balance (rewards):
eth.getBalance(eth.coinbase)
- Send Transaction (transfer rewards):
eth.sendTransaction({from:eth.coinbase,to:'0xabcd',value:1000000000000000000})
More info on the console is available here: https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console
If you are unable to diagnose a problem, you can try these steps in escalating order:
- Repair:
docker-compose up -d
- Restart node:
docker-compose restart node
- Restart all:
docker-compose down && docker-compose up -d
- Restart docker:
service docker restart && docker-compose up -d
- Reboot machine,
docker-compose up -d