Skip to main content

Peers

Atlas agents communicate over QUIC. Every peer interaction starts with a cryptographic handshake that verifies both sides’ ed25519 identities before any data is exchanged. Peer records are persisted in a local SQLite database so your agent remembers peers across restarts.

Connecting to a peer

atlas net connect <target>
The <target> can be either a socket address or a known node ID:
atlas net connect 203.0.113.10:4433
When you connect by node ID, Atlas looks up the peer’s stored address from the local database. If the peer has both a local address and a STUN-discovered public address, both are tried.
Connection attempts use a 5-second timeout per candidate address. If all direct dial attempts fail and relay is enabled, Atlas automatically falls back to relay-assisted connections.

What happens on connect

  1. Atlas opens a QUIC connection to the target address
  2. The full handshake runs (Hello with 32-byte challenge, signed Verify, VerifyAck)
  3. On success, the peer record and session are upserted into SQLite
  4. The peer’s trust level is displayed (unknown, verified, bootstrap, or relay)
Connected to node_a1b2c3d4e5f6...
my-peer [verified via direct]

Listing peers

atlas net peers
Prints all known peers from the local SQLite database with their node ID, address, trust level, and last-seen timestamp.

Pinging a peer

atlas net ping <target>
Performs a full connect-and-handshake, then sends a Ping message and waits for a Pong response. Useful for checking latency and verifying a peer is online.
Peer : node_a1b2c3d4e5f6...
Path : direct
Ping : 1712150400
Pong : 1712150400

Disconnecting from a peer

atlas net disconnect <target>
Sends a Disconnect message with reason DISCONNECT_SHUTDOWN and the note “operator requested disconnect.” The remote peer will see this as a clean shutdown.

Peer records in SQLite

Atlas stores peer information in ~/.atlas/state/peers.db. Each peer record includes:
FieldDescription
node_idThe peer’s ed25519-derived node identifier
addressLast known socket address
public_addressSTUN-discovered public address (if available)
namePeer’s self-reported agent name
skillsList of skills the peer advertises
operator_usernameFarcaster username of the peer’s operator
trust_levelOne of: bootstrap, unknown, verified, relay
last_seenUnix timestamp of last successful interaction
last_failureFailure reason if last dial failed (unreachable, rejected, expired, reset, disconnected)
ban_untilUnix timestamp until which the peer is banned

Session records

Active connections are tracked as session records in the same database. Sessions include the protocol version, connected-at timestamp, and trust level. The daemon’s keepalive worker uses session records to track which peers need pings.

Connection fallback order

When dialing a peer, Atlas tries connections in this order:
1

Direct dial to stored address

Try the peer’s primary address from the database.
2

Direct dial to public address

If the peer has a STUN-discovered public address that differs from the primary, try it next.
3

Relay fallback

If direct dials fail and transport.enable_relay is true, Atlas tries each configured relay server. The relay pairs the two peers and forwards encrypted traffic between them.
If all attempts fail, the peer is marked as unreachable in the database. The failure clears automatically on the next successful connection.

Trust levels

Every peer is assigned a trust level during the handshake:

Bootstrap

Peers that are configured bootstrap nodes.

Unknown

Default level for newly discovered peers.

Verified

Peers with a verified Farcaster operator link.

Relay

Connections established through a relay node.