NodeIdentity
NodeIdentity: a cluster node's identity, exchanged in the net-kernel handshake.
A node is named (e.g. "worker@host"), has a stable NodeId derived from its public key, and an incarnation counter that increments each time the node restarts (so peers can tell a fresh start from a stale one — SWIM-style). The identity is serialized with MessagePack and sent inside a NetFrame.
Types
Functions
Decode the bytes of encode. Err with Msgpack's message for bytes that are not MessagePack, or "NodeIdentity: malformed identity record" for any other value than a [Str, Str, Int] array.
The stable NodeId for a node: the hex SHA-256 of its public key [pubkey] (Crypto.sha256), 64 lowercase hex digits. The same key always gives the same id.
Serialize [id] to MessagePack bytes: the 3-element array [name, node_id, incarnation].
An identity for node [name] with public key [pubkey] at [incarnation]: its node_id is derive_id(pubkey).
NodeIdentity.make("worker@host", "pk-worker@host", 1).node_id == NodeIdentity.name_id("worker@host")The node id every stdlib caller gives a node named [name]: derive_id("pk-" ++ name). Real per-node keys are not what ids derive from yet; a certificate-mode handshake binds the id to the certificate through the name (Handshake.verify_peer_cert requires id == name_id(name), and the certificate to name that node).