Node persists state through IStateStore using logical keys.
Built-in stores normalize and validate keys/prefixes:
- Keys are normalized to
/separators. - Keys/prefixes must be relative (no rooted paths).
- Keys/prefixes must not contain
:(drive roots / NTFS ADS on Windows). - Keys/prefixes must not contain
\0. - Keys/prefixes must not contain
.or..segments.
Invalid keys/prefixes throw ArgumentException.
| Key | Contents |
|---|---|
identity.secret |
32 bytes secret material |
identity.public |
32 bytes public material |
planet / roots |
Controller/roots payload (compatibility alias) |
networks.d/<NWID>.conf |
Joined network config (JSON) |
networks.d/<NWID>.addr |
Overlay address assignment (binary) |
peers.d/<NWID>/<PEER>.peer |
OS UDP peer endpoint (binary) |
Upstream tooling and older examples may refer to planet and roots interchangeably.
Both built-in stores treat them as aliases:
- Writes always target
planet. - Reads/Exists/Delete prefer
planetif present, otherwise fall back toroots. - When reading
rootswhileplanetis missing,FileStateStoremay attempt a best-effort one-time migration fromrootstoplanet. ListAsync("")includes both keys when either exists.
If you have existing state folders:
- Keep your current files as-is (
planetorroots). New writes go toplanet, and reads may migraterootstoplanet. - Network membership is discovered by scanning
networks.d/*.confon startup.
FileStateStore.WriteAsync uses a best-effort atomic replace strategy:
- Write to a temp file in the same directory (
<path>.tmp.<guid>). - Flush to disk.
- Move/replace into the final path.