Hop
Search…
Running Docker container
Running Hop node as Docker container

Running container

Mount ~/.hop-node from host machine to /root in container in order to be able to use the config file and/or keystore in host machine:
1
docker run -v ~/.hop-node:/root hopprotocol/hop-node --config /root/config.json
Copied!
If you're using a keystore and need to enter the passphrase, use the flags -it to run docker in iterative mode.
1
docker run -it -v ~/.hop-node:/root hopprotocol/hop-node --config /root/config.json
Copied!
If using environment variables from a .env file, use the --env-file flag:
1
docker run --env-file docker.env -v ~/.hop-node:/root hopprotocol/hop-node --config /root/config.json
Copied!

Running as daemon

Use the --detach docker flag to run container as daemon.
1
docker run --detach -v ~/.hop-node:/root hopprotocol/hop-node --config /root/config.json
Copied!
Note: If you're keystore requires a passphrase and you're not using a password file, you'll need to pass the passpharse via the KEYSTORE_PASS environment variable.
1
export KEYSTORE_PASS=mysecretpassword
2
docker run --detach -e KEYSTORE_PASS=$KEYSTORE_PASS -v ~/.hop-node:/root hopprotocol/hop-node --config /root/config.json
Copied!

Docker Compose

Docker compose example for Hop Node: docker-compose.yml
1
version: '3.9'
2
3
bonder:
4
image: hopprotocol/hop-node:latest
5
command: --config /root/config.json
6
env_file:
7
- docker.env
8
restart: unless-stopped
9
volumes:
10
- /home/ubuntu/.hop-node:/root
Copied!
Start docker container:
1
docker-compose -f docker-compose.yml up bonder
Copied!
Start docker container as daemon:
1
docker-compose -f docker-compose.yml up --detach bonder
Copied!

Stopping docker container

1
docker stop hop-node
2
docker rm hop-node
Copied!