Running a dht node is as simple as installing the DHT cli.
npm i -g @hyperswarm/cli
Then to run the node do:
hyperswarm-dht
NOTE: If the above prints a warning that your network is NOT holepunchable, you might wanna look into opening port 49737.
That's it! You probably run to run the above command as a daemon so it get's decent uptime.
The DHT node will store IPs and ports from other users through an udp interface. The network is quite redundant so no worries if you shutdown your node or if it crashes :) It also shouldn't consume too much bandwidth as it's just simple small udp messages that exchanged when peers do discovery.
We might upgrade the command set in the future so it's a good idea to hang in #dat on freenode so we can share updates and you can give us feedback.
Leaving a comment here that you are running a node for a bit will help us in this early phase of the rollout also so we can stay in touch :)
Maybe this is helpful to others, I am running following setup on an ubuntu linux:
(note: I am not a linux or server pro, but this seems to work; improvement suggestions warmly welcome)
Make sure that only the required ports are open: (Port 49737 is used by the hyperswarm bootstrap nodes )
sudo ufw allow 22 sudo ufw allow 49737 sudo ufw enable
Note: Forgetting port 22 may disable the ssh connection 😅
Add npm build dependencies:
Install @hyperswarm/cli globally with a sudo user.
Create a dedicated hyperswarm user that doesn't have sudo privileges.
Add the dht as a service to run as hyperswarm user:
Note: this works without specifying a port - it will use a random port - but for the firewall a static port should be better.
Start the service:
See the status of the service:
The output on my terminal looks like
with
6ee604068aa7c2396384f5841032ac3f40af7cc1e5893a8f715
being my current node id.Up-/downgrading
To up-/downgrade the hyperswarm you need to...
sudo npm i -g @hyperswarm/cli@<version>
sudo systemctl restart hyperswarm-dht