Skip to main content
Version: v2.1.5

Running Multiple Nodes

1. Select method to run additional node

important

When running multiple nodes with third-party RPC providers, you must assign a different RPC provider to each node to avoid potential conflicts and ensure optimal performance, as third-party RPC providers have limitations. This requirement does not apply if you are using a local RPC provider. For more details about RPC providers, you can find information here.

Please select Docker method to run multiple nodes:

To run multiple nodes on the same device or VPS, change the ports associated with your node and the location of your node database. Each node must have different ports, and they should not match between the nodes you are running on the same device or VPS.

For example, the second node should implement the following changes:

  • Change -p 9091:9091/tcp -p 9091:9091/udp -p 3001:3001 to -p 9092:9092/tcp -p 9092:9092/udp -p 3002:3002
  • Change -v $HOME/.hoprd-db-dufour:/app/hoprd-db to -v $HOME/.hoprd-db-dufour-2:/app/hoprd-db
  • Add --apiPort 3002 (where first defaults to 3001)
  • Ensure you suffix your IP address with the new port, which in this example would now be 9092 instead of 9091.
  • Assign a different name to your second node by changing --name hoprd to --name hoprd-2

These changes would result in the following configuration:

New Node Comparison

Here, the first node's command (on the left in the image above) is:

docker run --pull always -d --restart on-failure -m 2g --security-opt seccomp=unconfined --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 --name hoprd -p 9091:9091/tcp -p 9091:9091/udp -p 3001:3001 -e RUST_LOG=info europe-west3-docker.pkg.dev/hoprassociation/docker-images/hoprd:stable --network dufour --init --api --announce --identity /app/hoprd-db/.hopr-id-dufour --data /app/hoprd-db --apiHost '0.0.0.0' --apiToken '<YOUR_SECURITY_TOKEN>' --password 'open-sesame-iTwnsPNg0hpagP+o6T0KOwiH9RQ0' --safeAddress <SAFE_WALLET_ADDRESS> --moduleAddress <MODULE_ADDRESS> --host <YOUR_PUBLIC_IP>:9091 --provider <CUSTOM_RPC_PROVIDER>

And the second node's command (on the right in the image above) is:

docker run --pull always -d --restart on-failure -m 2g --security-opt seccomp=unconfined --platform linux/x86_64 --log-driver json-file --log-opt max-size=100M --log-opt max-file=5 -ti -v $HOME/.hoprd-db-dufour-2:/app/hoprd-db --name hoprd-2 -p 9092:9092/tcp -p 9092:9092/udp -p 3002:3002 -e RUST_LOG=info europe-west3-docker.pkg.dev/hoprassociation/docker-images/hoprd:stable --network dufour --init --api --announce --identity /app/hoprd-db/.hopr-id-dufour --data /app/hoprd-db --apiHost '0.0.0.0' --apiPort 3002 --apiToken '<YOUR_SECURITY_TOKEN>' --password 'open-sesame-iTwnsPNg0hpagP+o6T0KOwiH9RQ0' --safeAddress <SAFE_WALLET_ADDRESS> --moduleAddress <MODULE_ADDRESS> --host <YOUR_PUBLIC_IP>:9092 --provider <CUSTOM_RPC_PROVIDER>

2. Register your node

Once you have started your additional node, you have to link your node with your current HOPR Safe.

(1) Access the recently launched HOPR Admin UI. Assuming you used the default port numbers, you should be able to access the HOPR Admin UI at http://localhost:4677 (replace localhost with your server IP address if you are using a VPS).

Example:

http://127.0.0.1:4677

(2) Click "CONNECT TO NODE" in the top right corner. In the popup under "Node credentials:", do the following:

  • In the API endpoint field, the default API endpoint should be set to http://localhost:3001. However, you may need to replace localhost with your server's IP address if you used a VPS, and adjust the port if you changed the mapping during installation.
  • In the API token field, enter the custom security token you created.

(3) Click the button "Connect to the node" where popup should appear with your node address which starts with "0x". Copy your node address.

(4) Note: You don’t need to manually fund your node with xDai tokens. You will fund your node through the HOPR Staking Hub during the short onboarding process for the additional nodes.

Go to the Nodes tab on the Staking Hub, click the "Add New Node" button to register on the waitlist, and wait for approval, which occurs on a tri-weekly basis.

(5) Once your node is granted access to the HOPR network, go to the Nodes tab on the Staking Hub, where you will find your recently approved node address. Click the "train" icon to complete the short onboarding process.