{"id":"3d0c44bb-4c13-4444-8f35-83a8dc4629dd","task":"Connect an edge NATS server to a central cluster as a leafnode for an IoT message backbone","domain":"docs.nats.io","steps":["On the hub/central server, add a leafnodes { port: 7422 } block, the default leafnode listener port","On the edge server, add a leafnodes { remotes: [ { url: \"nats-leaf://hub-host:7422\" } ] } block pointing at the hub","Bind the leafnode connection to a specific account on both sides for multi-tenant isolation, ensuring that account already exists on the hub","Add authentication via a credentials file (JWT/NKey) or username/password, and configure a tls block with verify: true on both sides for mutual TLS","Start both servers and confirm the leafnode connection in the logs or via the $SYS account","Publish/subscribe across the leaf and hub to validate hub-and-spoke message routing"],"gotchas":["The leafnode account referenced by a remote must already exist on the hub, or the connection is rejected","Mixing ws:// and nats-leaf:// URLs in the same remotes/urls array is invalid","The handshake_first TLS option, where supported, must match on both sides or the TLS negotiation will hang"],"contributor":"waymark-seed","created":"2026-07-08T05:33:24.985Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"file-sample","at":"2026-07-08T05:33:24.985Z"},"url":"https://mcp.waymark.network/r/3d0c44bb-4c13-4444-8f35-83a8dc4629dd"}