Why#
- Denial of service. A validator whose IP is public can be flooded off the network. Sentries take the public traffic; if one is flooded, the validator keeps its other sentry and its direct links to the other validators.
- Key exposure. The sealing key is unlocked while the validator runs. Fewer open ports and no RPC on that machine leave less to attack.
- Upgrades. Sentries and RPC nodes can be restarted, moved or replaced without touching the validator.
Layout#
| Node | ROLE |
Discovery | Inbound P2P from | Peers it keeps |
|---|---|---|---|---|
| Validator | validator |
off | your sentries and the other validators only | your sentries, the other validators |
| Sentry (two or more, different machines) | fullnode |
on | anyone | the validator (trusted), public nodes, the seed nodes |
| RPC node | rpc |
on or off | nobody (outbound only) | a sentry, or the seed nodes |
Put the sentries in different data centres, or at least on different machines. Reach the validator from the sentries over a private network or a VPN (WireGuard) if you can; otherwise allow only the sentries' public IPs in the validator's firewall.
Settings#
Each node gets its own package folder and node.env. Read the enode of each node with ./oysbio-node.sh info.
Validator (node.env):
ROLE=validator
NAT=extip:10.0.0.10 # the private address the sentries use
DISCOVERY=0
EXTRA_PEERS=enode://<sentry A>@10.0.0.11:30303,enode://<sentry B>@10.0.0.12:30303
The enodes of the other validators are exchanged privately between validator operators and added to EXTRA_PEERS too. They are never published.
Sentry (node.env):
ROLE=fullnode
NAT=extip:<public IP of this sentry>
DISCOVERY=1
MAX_PEERS=60
EXTRA_PEERS=enode://<validator>@10.0.0.10:30303
TRUSTED_PEERS=enode://<validator>@10.0.0.10:30303 # kept even when the sentry is full
EXTRA_PEERS and TRUSTED_PEERS are written to the node's config.toml (StaticNodes, TrustedNodes) at each start: the node reconnects to static peers by itself and never drops a trusted peer for lack of slots.
Firewall on the validator#
Allow the P2P port only from the sentries and the other validators, and SSH only from your admin addresses. With nftables:
table inet oysbio_validator {
set p2p_peers { type ipv4_addr; elements = { 10.0.0.11, 10.0.0.12 } } # sentries, other validators
chain input {
type filter hook input priority 0; policy drop;
ct state established,related accept
iif lo accept
tcp dport 22 ip saddr <admin IP> accept
tcp dport 30303 ip saddr @p2p_peers accept
icmp type echo-request limit rate 5/second accept
}
}
Sentries open 30303 TCP and UDP to everyone. Nothing else needs to be public on any of them; the RPC node's HTTPS proxy is the only public web service.
Check it#
- On the validator,
./oysbio-node.sh infoshows only your sentries and the validators as peers (admin.peersin the console lists them). - From outside, the validator's P2P port does not answer:
nc -vz <validator IP> 30303times out. - Stop one sentry: the validator keeps sealing through the other sentry and its validator links.
- The explorer's Validators page shows your validator sealing its turns.
How OysBio runs its nodes#
The OysBio validators accept peer connections only from the other validators and their own nodes, and their addresses are not published. The public seed nodes are sentries: none of them holds a validator key. The public RPC (rpc.oys.bio, testnet-rpc.oys.bio) runs on separate RPC nodes behind an HTTPS gateway with rate limits.