Skip to content

Latest commit

 

History

History
103 lines (66 loc) · 2.59 KB

README.md

File metadata and controls

103 lines (66 loc) · 2.59 KB

HORNET in Docker

Table of contents

Requirements

  1. A recent release of Docker enterprise or community edition.

  2. git and curl

  3. At least 1GB available RAM

Quick Start

Clone Repository

Clone the repository

git clone https://github.com/gohornet/hornet && cd hornet

The rest of the document assumes you are executing commands from the root directory of the repository.

Prepare

i. Edit the config.json for alternative ports if needed.

ii. Edit peering.json to your neighbors addresses.

iii. The Docker image runs under user with uid and gid 65532. To make sure there are no permission issues, create the directory for the database, e.g.:

mkdir mainnetdb && chown 65532:65532 mainnetdb

iv. The Docker image runs by default under user with uid 65532. To make sure there are no permission issues, create the directory for the snapshots, e.g.:

mkdir snapshots/mainnet && chown 65532:65532 snapshots -R

Docker Compose

Note: Follow this step only if you want to run HORNET via docker-compose.

If you are using an architecture other than amd64/x86_64 edit the docker-compose.yml file and set the correct architecture where noted.

The following command will build the image and run HORNET:

docker-compose up

CTRL-c to stop.

Add -d to run detached, and to stop:

docker-compose down -t 1200

Build Image

If not running via docker-compose, build the image manually:

docker build -f docker/Dockerfile -t hornet:latest .

Or pull it from dockerhub (only available for amd64/x86_64):

docker pull gohornet/hornet:latest && docker tag gohornet/hornet:latest hornet:latest

Run

Best is to run on host network for better performance (otherwise you are going to have to publish ports, that is done via iptables NAT and is slower)

docker run --rm -v $(pwd)/config.json:/app/config.json:ro -v $(pwd)/snapshots/mainnet:/app/snapshots/mainnet -v $(pwd)/mainnetdb:/app/mainnetdb --name hornet --net=host hornet:latest

Use CTRL-c to gracefully end the process.

Build Specific Version

By default the Dockerfile builds the image using HORNET's latest version. To build an image with a specific version you can pass it via the build argument TAG, e.g.:

docker build -f docker/Dockerfile -t hornet:v0.3.0 --build-arg TAG=v0.3.0 .