dhtnode1
A simple opendht command line node runner.
Usage
dhtnode [-h]
[-V]
[-v
[-l
logfile]
[-L]]
[-i
[-I
file]]
[-c
file]
[-k
file]
[-m
password]
[-d]
[-s]
[-D]
[-U]
[-P]
[-n
network_id]
[-p
local_port]
[-b
bootstrap_host
[:port]]
[-f
path]
[-S
port]
[-e
port]
[-a
address]
[-w
file]
[-K
file]
[-M
password]
[-C
server]
[-y
endpoint]
[-z
key]
[-u
bundleid]
Overview
Runs an OpenDHT node, with an interactive CLI (default) or as a daemon (with '-d' or '-s'). Commands available in the interactive shell are:
h, help Print this help message.
x, quit Quit the program.
log Start/stop printing DHT logs.
Node information:
ll Print basic information and stats about the current node.
ls [key] Print basic information about current search(es).
ld [key] Print basic information about currenty stored values on this
node (or for a specific key).
lr Print the full current routing table of this node.
Operations on the DHT:
b <ip:port> Ping potential node at given IP address/port.
g <key> Get values at <key>.
l <key> Listen for value changes at <key>.
cl <key> <token> Cancel listen for <token> and <key>.
p <key> <str> Put string value at <key>.
pp <key> <str> Put string value at <key> (persistent version).
cpp <key> <id> Cancel persistent put operation for <key> and
value <id>.
s <key> <str> Put string value at <key>, signed with our
generated private key.
e <key> <dest> <str> Put string value at <key>, encrypted for <dest>
with its public key (if found).
cc Trigger connectivity changed signal.
Operations with the proxy (if compiled with proxy server support):
pst [port] <pushServer> Start the proxy interface on port.
psx [port] Start the proxy SSL interface on port.
psp [port] Stop the proxy interface on port.
Operations with the proxy (if compiled with proxy client support):
stt [server_address] <device_key> Start the proxy client.
stp Stop the proxy client.
rs [token] Resubscribe to opendht.
rp [token] Inject a push notification.
Options
-
-h, --help -
Prints help and exits.
-
-V, --version -
Prints version information and exits.
-
-v, --verbose -
Enable verbose mode (log to stdout/stderr by default).
-
-l logfile, --logfile logfile -
Write log to file instead of stdout/stderr.
-
-L, --syslog -
Write log to syslog instead of stdout/stderr (enables verbose mode).
-
-i, --identity -
Generate a cryptographic identity (RSA key pair and self-signed certificate) for the node. Required to perform cryptographic operations (encrypt/sign values) if no private key file is provided.
-
-I file, --save-identity file -
Save generated identity (certificate and private key) to given file prefix. Files are saved as file and file_ca.
-
-c file, --certificate file -
Load identity certificate from given file. If specified, the certificate is published on the DHT.
-
-k file, --privkey file -
Load identity private key from given file. Required to perform cryptographic operations if no identity is generated.
-
-m password, --privkey-password password -
Password to use for private key encryption or decryption (optional).
-
-d, --daemonize -
Run the program in daemon mode (will fork in the background). When verbose mode is enabled, logs to syslog by default.
-
-s, --service -
Run the program in service mode (non-forking daemon).
-
-D, --peer-discovery -
Enables multicast automatic local peer discovery.
-
-U, --no-rate-limit -
Disable rate limiting (allows unlimited requests and storage).
-
-P, --public-stable -
Enable public stable mode.
-
-f path, --persist path -
Specify a file path to persist/load the node state (routing table and values).
-
-n network_id, --net network_id -
Specify the network id. This lets you connect to distinct networks and prevents the merge of two different networks. Defaults to 0 (the main public network).
-
-p local_port, --port local_port -
Use UDP port local_port for the program to bind to. If not set, will use any available port. The default OpenDHT port for public nodes is 4222.
-
-b bootstrap_host[:port], --bootstrap bootstrap_host[:port] -
Specify a bootstrap node address to connect to the network.
-
-S local_port, --proxyserver local_port -
Run a REST API proxy server bound to this DHT node on HTTP port local_port.
-
-e local_port, --proxyserverssl local_port -
Run a REST API proxy server with SSL bound to this DHT node on HTTPS port local_port.
-
-a address, --proxy-addr address -
Proxy server bind address.
-
-w file, --proxy-certificate file -
Load proxy SSL certificate from given file.
-
-K file, --proxy-privkey file -
Load proxy SSL private key from given file.
-
-M password, --proxy-privkey-password password -
Password for the proxy private key encryption or decryption (optional).
-
-C server, --proxyclient server -
Run this DHT node in proxy client mode, and connect to server.
-
-y endpoint, --pushserver endpoint -
Push notification server endpoint.
-
-z key, --devicekey key -
Device key for push notifications.
-
-u bundleid, --bundleid bundleid -
Bundle ID for push notifications.
Examples
Run a node using bootstrap.jami.net as a bootstrap:
dhtnode -b bootstrap.jami.net:4222
Run a node as a non-forking daemon on port 4222:
dhtnode -b bootstrap.jami.net -p 4222 -s
Run a proxy server on port 8000:
dhtnode -b bootstrap.jami.net:4222 --proxyserver 8000
Use a proxy client to connect to a proxy server:
dhtnode --proxyclient dhtproxy.jami.net:80
Releases
5 releases since Debian 9 (Stretch); the text changed 3 times.
--bootstrap since Arch Linux 2026-11-01;
--bundleid since Arch Linux 2026-11-01;
--certificate since Debian 11 (Bullseye);
--daemonize since Arch Linux 2026-11-01;
--devicekey since Arch Linux 2026-11-01;
--help since Arch Linux 2026-11-01;
--identity since Arch Linux 2026-11-01;
--logfile since Arch Linux 2026-11-01;
--net since Arch Linux 2026-11-01;
--no-rate-limit since Arch Linux 2026-11-01;
--peer-discovery since Arch Linux 2026-11-01;
--persist since Arch Linux 2026-11-01;
--port since Arch Linux 2026-11-01;
--privkey since Debian 11 (Bullseye);
--privkey-password since Debian 11 (Bullseye);
--proxy-addr since Arch Linux 2026-11-01;
--proxy-certificate since Arch Linux 2026-11-01;
--proxy-privkey since Arch Linux 2026-11-01;
--proxy-privkey-password since Arch Linux 2026-11-01;
--proxyclient since Debian 11 (Bullseye);
--proxyserver since Debian 11 (Bullseye);
--proxyserverssl since Arch Linux 2026-11-01;
--public-stable since Arch Linux 2026-11-01;
--pushserver since Arch Linux 2026-11-01;
--save-identity since Debian 11 (Bullseye);
--service since Arch Linux 2026-11-01;
--syslog since Arch Linux 2026-11-01;
--verbose since Arch Linux 2026-11-01;
--version since Arch Linux 2026-11-01;
-C since Arch Linux 2026-11-01;
-D since Debian 11 (Bullseye);
-I since Arch Linux 2026-11-01;
-K since Arch Linux 2026-11-01;
-L since Debian 11 (Bullseye);
-M since Arch Linux 2026-11-01;
-P since Arch Linux 2026-11-01;
-S since Arch Linux 2026-11-01;
-U since Arch Linux 2026-11-01;
-V since Arch Linux 2026-11-01;
-a since Arch Linux 2026-11-01;
-c since Arch Linux 2026-11-01;
-e since Arch Linux 2026-11-01;
-f since Debian 11 (Bullseye);
-k since Arch Linux 2026-11-01;
-m since Arch Linux 2026-11-01;
-s since Debian 11 (Bullseye);
-u since Arch Linux 2026-11-01;
-w since Arch Linux 2026-11-01;
-y since Arch Linux 2026-11-01;
-z since Arch Linux 2026-11-01.