All tutorials

クライアントをインストールしてサーバーに接続

Linux と Windows への HashRelay クライアントインストール手順。

The client sits on the same LAN as the miners. It dials the server, then opens local listen ports from the mappings the server pushes. You do not configure miner ports in client.toml.

Create the node first

In the web admin UI open Client Nodes and create a node. Copy client_id and the access token. The server stores tokens in client_nodes; the client only presents the token.

Linux

Replace every YOUR_* value. Linux — sudo asks for your password:

bash
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sudo env \
  SERVER_ADDR=YOUR_SERVER_IP \
  TCP_PORT=8555 \
  QUIC_PORT=9555 \
  CLIENT_ID=YOUR_CLIENT_ID \
  TOKEN=YOUR_ACCESS_TOKEN \
  sh

OpenWrt / iStoreOS, or a shell that is already root:

bash
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | env \
  SERVER_ADDR=YOUR_SERVER_IP \
  TCP_PORT=8555 \
  QUIC_PORT=9555 \
  CLIENT_ID=YOUR_CLIENT_ID \
  TOKEN=YOUR_ACCESS_TOKEN \
  sh

Or let the script ask. Linux:

bash
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sudo sh

Already root:

bash
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sh

Or install first, then edit /etc/hash-relay/client.toml and restart hash-relay-client. Linux:

bash
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sudo sh

# Edit /etc/hash-relay/client.toml — set server_addr, tcp_port, quic_port, client_id, token
# sudo nano /etc/hash-relay/client.toml
# sudo systemctl restart hash-relay-client

Already root:

bash
curl -fsSL https://downloads.hashrelay.net/hashrelay/scripts/install-client.sh | sh

# Edit /etc/hash-relay/client.toml — set server_addr, tcp_port, quic_port, client_id, token
# vi /etc/hash-relay/client.toml
# /etc/init.d/hash-relay-client restart

What client.toml actually sets

toml
[client]
server_addr = "YOUR_SERVER_IP"
tcp_port = 8555
quic_port = 9555
client_id = "mine-site-01"
token = "YOUR_ACCESS_TOKEN"

[client.enc]
frame_encrypt_alg = 0
# insecure = true          # lab only
# pin_sha256 = "..."       # copy from the server log when tls = "self_signed"

[client.connection]
transport = "auto"         # auto/quic: QUIC first, then TCP. tcp: TCP first, then QUIC
reconnect_interval = 5
max_reconnect_attempts = 0
heartbeat_interval = 60
heartbeat_timeout_count = 3
transport chooses the dial order and which path the control plane prefers. Each port mapping still has its own protocol: a quic mapping only rides QUIC, a tcp mapping only rides TCP. One side dying does not take the other down.

Windows

Download hr-client.exe from the download page and run it with the same TOML. The fields are identical to Linux.

powershell
.\hr-client.exe --config client.toml

See that it connected

On the server dashboard the node should show a heartbeat. On the client:

bash
sudo systemctl status hash-relay-client
sudo journalctl -u hash-relay-client -f