Documentation
¶
Overview ¶
Package nodeidentity resolves the stable node ID every WB daemon carries, per spec/features/peer-connectivity#req:node-identity.
The ID is 128 random bits, hex-encoded, generated once on first start (or on first `wb peers join`) and stored under the private WB state directory at <state dir>/state/node-id, mode 0600. It is a display and matching identifier, not a secret: renaming the host changes nothing, and a copied state directory yields two nodes sharing one ID, which single-live-session detects on the hub side.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load resolves the node ID for a projects root, creating it (and its directory) on first use. random defaults to crypto/rand.Reader; a test may inject a deterministic or fault-injecting reader.
func LoadFile ¶
LoadFile is Load with the file path already resolved, so a caller that already knows the WB home (or a test fixture) does not need a second resolution.
func Path ¶
Path returns the node ID file's location for a given projects root, without creating anything.
func PathFromHome ¶
PathFromHome returns the node ID file's location for a WB home directory that is already resolved (internal/wbhome.Root's return value), for a caller that resolved it once already and must not resolve the same projects root a second time through a second, independent call — see cmd/wb's daemon serve, which reuses its own already-resolved home this way rather than calling Load(projectsRoot, nil) directly.
Types ¶
This section is empty.