Skip to main content

config.json editor

config.json in the data directory is where znnd reads its settings. nomctl edits it with validation, so a mistyped key or an out-of-range value is refused instead of being silently ignored by the node.

sudo nomctl config show # every setting, its value, and whether it is in the file or a default
sudo nomctl config get RPC.HTTPHost
sudo nomctl config set RPC.HTTPHost 127.0.0.1 # typed and validated, previous file backed up
sudo nomctl config set Net.MaxPeers 80 --restart
sudo nomctl config set Net.Seeders "enode://a,enode://b"
sudo nomctl config unset Net.MaxPeers # back to go-zenon's default
sudo nomctl config edit # $EDITOR, validated before it is installed

The menu has the same under Edit config.json: show, set one setting with a picker, edit in the editor. There it asks whether to restart the node after a change; on the command line pass --restart, otherwise sudo nomctl restart when you are done, since znnd reads the file only at start.

Keys

Keys are dotted, as in go-zenon's config struct:

KeyTypeDefault
Namestringznn-nodenode name shown to peers
LogLevelstringinfodebug, info, warn, error or crit
RPC.EnableHTTP, RPC.EnableWSbooltrueserve JSON-RPC over HTTP / WebSocket
RPC.HTTPHost, RPC.WSHoststring0.0.0.0bind addresses; 127.0.0.1 keeps them local
RPC.HTTPPort, RPC.WSPortint35997, 35998ports
RPC.Endpointslistemptyextra API namespaces
RPC.HTTPVirtualHosts, RPC.HTTPCors, RPC.WSOriginslistsee showHTTP access lists
Net.ListenHost, Net.ListenPortstring, int0.0.0.0, 35995P2P bind address and port
Net.MinPeers, Net.MinConnectedPeers, Net.MaxPeers, Net.MaxPendingPeersint8, 16, 60, 10peer limits
Net.Seederslistemptyseed nodes; empty uses go-zenon's list
DataPath, WalletPath, GenesisFilestringunsetpaths; leave unset unless you know why
Producer.*managed by nomctl pillar setup; set refuses them

Lists take a comma-separated string or a JSON array. Booleans take true/false, yes/no, on/off.

Validation

Before anything is written: ports are within 1–65535, peer counts are not negative and MaxPeers is not below MinPeers, LogLevel is one of go-zenon's levels, bind addresses are not empty, every value has the right type, and each section is an object. set refuses an unknown key by default; --force writes it as text, unchecked, for a key nomctl does not know yet. edit refuses a file with unknown keys, since a typo there is exactly what it guards against. Neither set, unset nor edit changes the Producer section, which belongs to pillar setup. show lists any unknown keys already in the file.

Backups and safety

Every write copies the previous file to config.json.bak.<timestamp> first (a suffix is added if two writes land in the same second), then replaces the file atomically with mode 0600 because it holds the producer password. edit works on a copy, the way visudo does: the original is untouched until the copy validates, and on a problem you can reopen the editor with the problems shown or discard the edit. Sections nomctl does not know are written back with their content unchanged.