How to set up a node on HydraDX
Here you will find a guide on how to set up & run the validator node on HydraDX.
OFFICIAL DOCS ARE READY TO USE: https://docs.hydradx.io/node_setup/
Technical requirements
For the time of writing, substrate defaults are defined as follows: Intel Core i7–7700K CPU with 64GB of RAM and an NVMe SSD (https://substrate.dev/docs/en/knowledgebase/learn-substrate/weight). Keep in mind that one core performance is important.
Benchmark list for HydraDX: https://docs.google.com/spreadsheets/d/1is4y04hTtQzlgDDjH6KFKA6jmwWSj2Phdmgg_Duu_Bs/edit?usp=sharing
Setting up a node
- You can set up an environment with this single command.
curl https://getsubstrate.io -sSf | bash -s -- --fast
source ~/.cargo/env
2. Clone source code and checkout to a recent release branch. You can check the last release branch by visiting: https://github.com/galacticcouncil/HydraDX-node/releases
For the time being current release is v2.0.0
git clone https://github.com/galacticcouncil/HydraDX-node.git
cd HydraDX-nodegit checkout v3.0.0
cargo build --release
Running a node (systemd)
You can run your validator as a systemd process so that it will automatically restart on server reboots or crashes (and helps to avoid getting slashed!).
First, create a new unit file called hydra-dx.service
in /etc/systemd/system/
touch /etc/systemd/system/hydra-dx.service
nano /etc/systemd/system/hydra-dx.service[Unit]
Description=HydraDX Validator[Service]
User=YOUR_USER_NAME
ExecStart=PATH_TO_NODE --chain lerna --name YOUR_NAME
Restart=always
RestartSec=120[Install]
WantedBy=multi-user.target
lerna
is stakenet chain
PATH_TO_NODE
example: /home/ubuntu/HydraDX-node/target/release/hydra-dx
To enable this to autostart on bootup run:
systemctl enable hydra-dx.service
Start it manually with:
systemctl start hydra-dx.service
You can check that it’s working with:
systemctl status hydra-dx.service
You can tail the logs with journalctl
like so:
journalctl -f -u hydra-dx
Benchmark
Before running a node it is advised to benchmark your server. After setting up the environment and cloning the HydraDX repo run the following script:
cd HydraDX-node
./scripts/check_performance.sh
Example results:
If the difference is >= 0, performance is similar or better. However, if the difference < 0 — your machine might not suitable to run HydraDX node. Contact HydraDX devs to discuss the results: https://discord.gg/p5u6kpaE
In case you are receiving the error:
Toolchain ...... Nightly toolchain required
Run this (it will set up your toolchain to nightly):
./scripts/init.sh
rustup default nightly./scripts/check_performance.sh
For more information check the following sources: