Using Docker
The instructions below are for Linux and macOS. If you have Windows, please use a VPS.
Do not start installing a HOPR node without a HOPR Safe. To create a HOPR Safe and run a node please follow the onboarding process here.
1. Install Docker
Before doing anything else, you need to install Docker Desktop on your machine.
- Linux
- macOS
Depending on your distribution, please follow the official guidelines to install and run Docker on your workstation.
- Visit Docker and download Docker Desktop to your computer.
- Follow the wizard steps to ensure Docker is installed.
- Ensure the installation was successful by running
docker ps
in your terminal.
2. Configure Command
The default command provided below will look similar to the one provided during the onboarding process. Whether you are onboarding a new node or trying to re-run an old one, the default command needs to be configured before you can use it to run a node.
Default command (do not copy, use the command provided within the onboarding process):
docker run --pull always --restart on-failure -m 2g --platform linux/x86_64 --log-driver json-file --log-opt max-size=100M --log-opt max-file=5 -ti -v $HOME/.hoprd-db-dufour:/app/hoprd-db -p 9091:9091/tcp -p 9091:9091/udp -p 8080:8080 -p 3001:3001 -e DEBUG="hopr*" europe-west3-docker.pkg.dev/hoprassociation/docker-images/hoprd:providence --network dufour --init --api --identity /app/hoprd-db/.hopr-id-dufour --data /app/hoprd-db --password 'open-sesame-iTwnsPNg0hpagP+o6T0KOwiH9RQ0' --apiHost "0.0.0.0" --apiToken 'YOUR_SECURITY_TOKEN' --healthCheck --healthCheckHost "0.0.0.0" --announce --safeAddress <SAFE_WALLET_ADDRESS> --moduleAddress <Module_ADDRESS> --host <YOUR_PUBLIC_IP>:9091
Note: Only use the default command as a starting point if you are restarting an old node and not registering you're node through the onboarding process. If you are setting up this node for the first time, please use the command provided to you within the onboarding process in the Staking Hub.
2.1 Adjust the API Token
(1) Create a Security Token (password) which satisfies the following requirements:
Security token should contain:
- at least eight symbols
- a lowercase letter
- uppercase letter
- a number
- a special symbol (don't use
%
or whitespace)
This ensures the node cannot be accessed by a malicious user residing in the same network.
(2) Replace the apiToken
within your docker command with your own security token.
For example: replace --apiToken 'YOUR_SECURITY_TOKEN'
with --apiToken 'My#S3cur1ty#Token'
.
Note: Make sure to make a note of the API token you have created. You will need it to access HOPR Admin.
2.2 Adjust Safe & Module Addresses
If you have copied the docker command from your Staking Hub onboarding process, you will already have your Safe & Module address by default and can skip this step and go directly to step 2.3.
If you have not copied the command from the onboarding process, you will likely need to replace the Safe and Module addresses and should follow the instructions below:
(1) Head over to the Staking Hub Dashboard, and you should find your Safe and Module address at the top of the staking section.
(2) replace the safeAddress
and moduleAddress
within your docker command with your own security token.
For example replace:
--safeAddress <SAFE_WALLET_ADDRESS>
with
--safeAddress 0xEe8D810feAb42313Cc6E2F9DC2D9E2e55d2eb6f9
And replace:
--moduleAddress <Module_ADDRESS>
with
--moduleAddress 0x0cE0dD1532e58C09bd60bb2a50fad9BB03c541B2
Note: Make sure that the spacing between words is as above. Do not remove the spaces.
2.3 Adjust Public IP Address
You will need to edit your public IP address within the Docker command:
(1) Find your public IP address. If you do not know it, you can follow the instructions here.
(2) Replace the host
within your docker command with your own security token.
For example: replace --host <YOUR_PUBLIC_IP>:9091
with --host 8.8.8.8:9091
.
Make sure not to remove the port :9091
at the end.
Note: Dynamic IPs will not work for this, as once your IP address changes, your node will no longer be reachable.
3. Start Your Node
Once you have configured your docker command correctly, you can start your node by using the now adjusted docker command.
(1) Open your terminal.
(2) Check that Docker is installed by running the following command:
docker --help
If you see an output of available docker commands, Docker is installed. If the docker command is not found, please make sure you have correctly installed Docker.
(3) With Docker installed, paste your adjusted docker command into the terminal and execute it. Your adjusted command should look similar to the following below.
Note: Please do not copy this command and use your own, as it will not work. It is provided just as an example.
(4) After running the command, wait for a little bit, and from the terminal output, locate your Node Information
.
(5) Copy your Node address
, and close your node using the command CTRL + C
or Command + C
.
Note: Do not close the node if it has already been approved. Only close it if you have not yet joined the waitlist and are onboarding this node for the first time.
(6) Go back to the Staking Hub to register to the waitlist or if you have been approved to join the network, to complete your onboarding.
4. Link Your Node to Your Safe
Only do this if you have been approved to join the network. If you are still on the waitlist, please wait until you have been approved to join the network.
For VPS users
(1) Please make sure you have installed Tmux
(2) Open your terminal
(3) Paste and execute your configured docker command. If you do not have it saved, you can configure the default command by following the instructions here.
(4) After your node has started, please wait for a few minutes and in your terminal output, locate Node information:
, where you either will need to click on the link which will forward you to complete the onboarding process or copy the node address and fill in the Staking Hub field manually.
For Linux/macOS
(1) Open your terminal
(2) Paste and execute your configured docker command. If you do not have it saved, you can configure the default command by following the instructions here.
(3) After your node has started, please wait for a few minutes and in your terminal output, locate Node information:
, where you either will need to click on the link which will forward you to complete the onboarding process or copy the node address and fill in the Staking Hub field manually.