Keys, Fleets & Access#

Key Hygiene#

  • Node key (<dir>/keys.json): Generated by meshnode init and readable only by the meshnode user (chmod 600). Never copy it into logs, repos, or unencrypted backups.

  • Operator key (operator.key): Keep your 32-byte hex (or nsec) operator key on a secured operator workstation (chmod 600), never on the managed nodes themselves.

  • Control socket: Local administration talks to the Unix domain socket inside <dir>. Filesystem permissions on <dir> and its socket determine who on the host may issue local control commands.

Enrolling Nodes and Managing the Fleet Roster#

  1. Read the node’s public key on the host:

    meshnode whoami /var/lib/fleetmesh
    
  2. Mint a node-bound enrolment token on your operator workstation:

    meshctl fleet token <node-pubkey> --key-file operator.key > node.token
    
  3. Apply the token on the node (tokens are bound to one pubkey and rejected by any other node):

    meshctl enrol "$(cat node.token)" --dir /var/lib/fleetmesh
    
  4. Maintain your encrypted operator roster on the relays (membership is not exposed in public node descriptors):

    meshctl fleet add <node-pubkey> --key-file operator.key --relay wss://relay.fleetmesh.org --label node-fra
    meshctl fleet list --key-file operator.key --relay wss://relay.fleetmesh.org
    

Remote Administration over control/1.0#

Run commands on any enrolled node without SSH access using meshctl send. Both the request and reply are NIP-59 gift-wrapped and authenticated by your operator key (or a capability grant chain passed via --chain):

meshctl send <node-pubkey> health --key-file operator.key --relay wss://relay.fleetmesh.org
meshctl send <node-pubkey> status --key-file operator.key --relay wss://relay.fleetmesh.org

Add --stored to send a stored request (kind 1059) when targeting a node that may reconnect later.

Private Networks and Circles#

  • Private networks (meshctl network): Create a network definition (kind 30830), invite or approve members, and inspect active memberships:

    meshctl network create ...
    meshctl network invite ...
    meshctl network requests ...
    meshctl network approve ...
    meshctl network show ...
    
  • Quorum-governed circles (meshctl circle): Found a multi-member controller (did:group, kind 30834), propose and co-sign capability grants (grant / sign / bundle), amend epochs (amend), and withdraw grants (revoke, which requires only one member). Record the founding genesis event ID printed by meshctl circle create so you can pass --genesis <EVENT_ID> if a relay ever holds a conflicting shadow genesis.