FIO Docker installation

(Thanks to blockpane for the original version of these scripts.)

Warning: These images always use the latest published builds, which might include release-candidates, check the FIO Github to see what this will be downloading

These are simple docker-compose configs for bringing up a FIO node. There are two configs for each network (mainnet and testnet). The v1history will start a light-history node, it’s highly recommended to use this image if not using a state-history or hyperion node, the extra overhead is minimal (this is not the EOSIO v1 history plugin, it is the Greymass light history implementation, only requiring about 200mb with an 8gb blocks.log.)

These images pull a full archive of the blocks, and a snapshot if using the standard node. The history image pulls a complete archive, including the state database, history files, and blocks. This download takes a long time, expect 30 minutes or more, but is much faster than waiting for a node to sync from genesis (a day or more).

Data:

Each container will store the chain data in a volume, allowing for easy upgrades without data loss.

Usage:

Install docker (ubuntu)
sudo apt-get install -y docker.io python3 python3-pip git
sudo pip3 install docker-compose
sudo usermod -a -G docker $(whoami)
newgrp
Clone the fio-docker repository:
git clone https://github.com/fioprotocol/fio-docker.git
Start a node:
cd fio-docker/testnet-v1history
docker-compose up -d

This will perform the following actions:

  1. Download and install the latest FIO packaged deb file (e.g., https://bin.fioprotocol.io/mainnet/fioprotocol-3.0.x-latest-ubuntu-18.04-amd64.deb)
  2. Fetch the latest blocks.log archive (this can take 30+ minutes)
  3. Start nodeos on port 8888 (if you use the default port)

Confirm your node is running:

curl --url http://localhost:8888/v1/chain/get_info

Sync status will show in the Docker logs:

cd fio-docker/testnet-v1history
docker-compose logs -f --tail 20

List your running Docker containers:

docker ps

CONTAINER ID   IMAGE            COMMAND                  CREATED          STATUS          PORTS                                                                                  NAMES
4756dc0abf5e   testnet_nodeos   "/usr/local/bin/fio-…"   22 minutes ago   Up 22 minutes   0.0.0.0:3856->3856/tcp, :::3856->3856/tcp, 0.0.0.0:8888->8888/tcp, :::8888->8888/tcp   testnet_nodeos_1

Access Docker container to run commands:

docker exec -it testnet_nodeos_1 /bin/bash
Upgrade an existing node:
docker-compose --no-cache build
docker-compose up -d
Destroy a node:
docker-compose down -v