Node Configuration and Strategies
Node strategies allow for much more detailed and granular control over your node's behavior and its interaction with the protocol, making this feature primarily suited for advanced users. These strategies enable you to effectively manage your node by configuring settings such as the threshold for ticket aggregation, the redemption process, and more. To modify or manage these strategies, you will need to implement a configuration file.
Create and apply configuration file to your node
Please select your platform:
- Docker
- Docker compose
- Dappnode
(1) Download the example file specificaly for Docker: hoprd-docker.cfg.yaml
(2) By default, the strategy settings file is pre-configured and works well as is. However, if you have a clear understanding of the settings and their implications, you can customize them to better align with your specific needs. For detailed instructions, please refer to the section: Understanding Node Strategies.
(3) Navigate to the ".hopr-id-dufour" directory on your machine and upload the newly created configuration file there. Ensure that the configuration file is named "hoprd-docker.cfg.yaml".
(4) After uploading the configuration file, stop your current node.
(5) Once your node is stopped, add the additional parameter "--configurationFilePath '/app/hoprd-db/hoprd-docker.cfg.yaml'" to link your configuration file to your current docker command.
Docker command:
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 '<SECRET_TOKEN>' --password 'open-sesame-iTwnsPNg0hpagP+o6T0KOwiH9RQ0' --safeAddress <SAFE_WALLET_ADDRESS> --moduleAddress <MODULE_ADDRESS> --host <YOUR_PUBLIC_IP>:9091 --provider <CUSTOM_RPC_PROVIDER> --configurationFilePath '/app/hoprd-db/hoprd-docker.cfg.yaml'
Note: If you're running multiple nodes or have changed the default ports, make the necessary port adjustments accordingly.
(7) Paste your Docker command into the terminal window and execute it.
(8) Wait for about 5 minutes, then connect to your node via the HOPR Admin UI. Navigate to the "CONFIGURATION" page to verify that the strategy settings have been updated. If the changes aren't visible, try performing a hard refresh of the HOPR Admin UI page.
Inside the "compose" folder, navigate to the "hoprd_data" folder and make the necessary edits to the "hoprd.cfg.yaml" file:
-
address:
-
port:
-
The default port for peer-to-peer communication is 9091.
-
If you’ve set a different port using the
HOPRD_P2P_PORT
environment variable, make sure to use that one instead. -
If you plan to run HOPRd node(s) behind NAT (Network Address Translation), such as on computers or servers at home or in an office environment, you must expose port
9091
to the public so that other nodes on the HOPR network can connect to your node. For instructions, see our port forwarding guide.
-
-
provider: Use your own RPC provider, more details about custom RPC provider. If you're using a local RPC endpoint, ensure the URL includes the "http://" prefix followed by the IP address or localhost.
-
safe_address: Add your Safe wallet address, more details under safe_module.
-
module_address: Add your Module address, more details under safe_module.
Note: By default, the strategy settings file is pre-configured and works well as is. However, if you have a clear understanding of the settings and their implications, you can customize them to better align with your specific needs. For detailed instructions, please refer to the section: Understanding Node Strategies.
(1) Download the example file specifically for the Dappnode: hoprd.cfg.yaml
(2) By default, the strategy settings file is pre-configured and works well as is. However, if you have a clear understanding of the settings and their implications, you can customize them to better align with your specific needs. For detailed instructions, please refer to the section: Understanding Node Strategies.
Note: Adjust the strategies section according to your needs; no other configuration is required.
(3) After adjusting the configuration file, connect to your Dappnode dashboard, locate the "HOPR" package, and navigate to the "File Manager" tab.
(4) In the "Upload file" section, click the "Browse" button next to the "Choose file" field, then select your newly created configuration file. Ensure that the configuration file is named "hoprd.cfg.yaml".
(5) In the text field under the "Upload file" section, enter the path /app/
.
(6) Click the "Upload" button and wait for the upload to finish.
(7) Go to the "Info" page within your HOPR package, and click the "Restart" button to restart your node.
(8) Wait for about 5 minutes, then connect to your node via the HOPR Admin UI. Navigate to the "CONFIGURATION" page to verify that the strategy settings have been updated. If the changes aren't visible, try performing a hard refresh of the HOPR Admin UI page.
Understanding configuration file settings
Configuration file used by the HOPR protocol. The file is written in YAML format and contains various settings related to the operation of the HOPR node. Below is a breakdown of the example file structure and the key settings within each section:
hopr:
host:
address: !IPv4 1.2.3.4
port: 9091
db:
data: /app/hoprd-db/db
initialize: true
force_initialize: false
strategy:
on_fail_continue: true
allow_recursive: true
strategies:
- !Aggregating
aggregation_threshold: 250
unrealized_balance_ratio: 0.9
aggregate_on_channel_close: true
- !AutoRedeeming
redeem_only_aggregated: true
minimum_redeem_ticket_value: "2500000000000000000 HOPR"
- !ClosureFinalizer
max_closure_overdue: 300
heartbeat:
variance: 2
interval: 60
threshold: 40
max_parallel_probes: 50
network_options:
min_delay: 1
max_delay: 300
quality_bad_threshold: 0.1
quality_offline_threshold: 0.0
quality_step: 0.1
quality_avg_window_size: 25
ignore_timeframe: 120
backoff_exponent: 1.5
backoff_min: 2.0
backoff_max: 300.0
protocol:
outgoing_ticket_winning_prob: 1
heartbeat:
timeout: 6
chain:
provider: https://gnosis-rpc.publicnode.com
announce: true
check_unrealized_balance: true
network: dufour
safe_module:
safe_transaction_service_provider: https://safe-transaction.prod.hoprtech.net
transport:
announce_local_addresses: false
prefer_local_addresses: false
identity:
file: /app/hoprd-db/.hopr-identity
password: #For example: 'rjVFCcqnTNJSh_8Z3P94@M2bep&Dk#UHX$agWf'
api:
enable: true
host:
address: !IPv4 0.0.0.0
port: 3001
inbox:
capacity: 512
max_age: 900
excluded_tags:
- 0
Note: The latest version of the default configuration file for all supported platforms is available in the HOPR GitHub repository.
hopr.host
Specifies host to listen on for the HOPR P2P protocol.
host:
address: !IPv4 1.2.3.4
port: 9091
Settings | Default value | Description |
---|---|---|
host.address | The external IP address of the machine where the node is running. Make sure to include !IPv4 before entering the external IP address. Refer to the FAQ guide to determine if your IP address meets the requirements. | |
host.port | 9091 | Listening on TCP & UDP ports. |
hopr.db
Specifies details for the database used by the HOPR node.
db:
data: /app/hoprd-db
initialize: true
force_initialize: false
Settings | Description |
---|---|
db.data | Specifies the path to the database directory. For Docker users, the path is "/app/hoprd-db". For Dappnode users, the path is "/app/hoprd-db/db". |
db.initialize | Defaults to "true", meaning the database will be created if it doesn't already exist. If set to "false" and the database is missing, the node will not start. |
db.force_initialize | Defaults to "false". If set to "true", any existing database in the specified directory will be overwritten and re-initialized. |