Table of contents
-
A recent release of Docker enterprise or community edition.
-
git and curl
-
At least 1GB available RAM
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.
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
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
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
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.
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 .