Deploy
nomctl deploy builds the node from source and sets up its systemd service.
sudo nomctl deploy [--repo URL] [--branch NAME]
What happens
- Pre-flight checks: at least 4 cores and 4 GiB RAM,
systemd-timesyncdpointed attime.cloudflare.com(the config is patched and the service restarted if needed), and Internet connectivity. Every privileged command runs these;--skip-preflightorNOMCTL_SKIP_PREFLIGHT=truedisables them. - Dependencies:
git,makeandgccare installed with apt if missing. - Go toolchain:
NOMCTL_GO_VERSION(default 1.23.0) is downloaded into/opt/nomctl/go. An existing toolchain of the same version is reused; a different version is moved aside. - Clone and build: the repository (
NOMCTL_REPO_URL, defaulthttps://github.com/zenon-network/go-zenon.git) is cloned atNOMCTL_BRANCH_NAME(defaultmaster) into/opt/nomctl/go-zenon, an existing checkout is renamed with a timestamp, andgo build ./cmd/znndruns with the managed toolchain. - Install: the binary is copied to
/usr/local/bin/znnd. - Service:
/etc/systemd/system/go-zenon.serviceis written if absent, then enabled and started.
The unit that is written:
[Unit]
Description=znnd service
After=network.target
[Service]
LimitNOFILE=32768
User=root
Group=root
Type=simple
SuccessExitStatus=SIGKILL 9
ExecStart=/usr/local/bin/znnd
KillMode=control-group
Restart=on-failure
TimeoutStopSec=10s
TimeoutStartSec=10s
[Install]
WantedBy=multi-user.target
Choosing a repository and branch
From the menu, deploy offers zenon-network, hypercore-one or a custom URL, then lists the remote branches with master first. From the command line pass --repo and --branch, or set NOMCTL_REPO_URL and NOMCTL_BRANCH_NAME.
Stopping sends SIGTERM to the service's own processes and SIGKILL after 10 seconds; nothing outside the unit's cgroup is touched, so several nodes can share a host. (The bash toolkit's unit ran pkill -9 znnd, which would have killed all of them.)
Redeploying
Running deploy again rebuilds from the branch head and restarts the service. The previous checkout is kept as /opt/nomctl/go-zenon-<timestamp>. If the unit file on disk differs from the current definition, for example a unit written by an older nomctl, it is rewritten. Deploy takes the node-data lock, so it cannot overlap a backup, restore or resync.
Node configuration
nomctl does not write config.json. znnd enables its HTTP RPC on 0.0.0.0:35997 by default, which is what status, top and alerts read from 127.0.0.1.
That RPC has no authentication. Only 35995/TCP (peer-to-peer) needs to be reachable from the Internet; firewall 35997 and 35998 (WebSocket) unless you intend to serve RPC publicly, for example:
ufw allow 35995/tcp
ufw deny 35997/tcp
ufw deny 35998/tcp
Alternatively set RPC.HTTPHost to 127.0.0.1 in config.json and restart the node.