-
-
Notifications
You must be signed in to change notification settings - Fork 190
Running a node with dhtnode
dhtnode is a command-line utility included with OpenDHT to run, control and monitor an OpenDHT node.
OpenDHT includes a systemd service for dhtnode starting from version 1.3.4.
To use it, build OpenDHT using CMake with the argument -DOPENDHT_SYSTEMD=On.
See Build the library for details about how to build OpenDHT.
Once installed, start the dhtnode service using:
systemctl start dhtnode
Or enable dhtnode to run automatically on startup using:
systemctl enable dhtnode
dhtnode [-p local_port] [-b bootstrap_host:port] [-i] [-v]
-
-ballows to specify a bootstrap node address. -
-pallows to specify the local UDP port to bind (optional). If not set, will use any available port. Note that the default OpenDHT port (to ideally use for public nodes) is 4222. -
-iwill generate a DHT "identity" with the node (RSA key pair, and certificate published on the DHT). Required to perform cryptographic operations (encrypt/sign values). -
-vwill enable debug logs for OpenDHT to standard output.
for instance:
dhtnode -b bootstrap.ring.cx:4222 will run a node and use bootstrap.ring.cx port 4222 as a bootstrap node.
Show a command list with usage.
Bootstrap/ping a DHT node. Similar to providing -b host:port as a command line parameter.
Get values for {key} (the key is a 40 hexadecimal characters string).
Listen for value changes at {key} (the key is a 40 hexadecimal characters string).
Put the text value {string_value} at {key}.