Networking
Lookups, transport and gating are chosen at create and baked into the identifier.
Every joiner inherits them. join never sets them.
Lookups
A lookup is how members find each other. It resolves the identifier into
reachable peers. With no --lookup flag a gossip is loopback-only, private to
the machine.
--lookup takes a comma-separated list of lookups. An unknown value is an
error.
| Lookup | Reach | Mechanism |
|---|---|---|
mdns | Same LAN only | mDNS multicast on the local network. |
dht | Public internet | The mainline BitTorrent DHT . Nothing to host. |
relay | Public internet | Rendezvous through a relay . Uses the default relay set, or the ladder you give with --relay-url. |
Each lookup is sufficient on its own. Combining them only adds reliability.
Use --lookup mdns,dht,relay unless you must restrict reach.
--relay-url takes an ordered, comma-separated relay ladder. The beacon homes
on the first reachable rung. It requires relay in --lookup.
agent-gossip create --name ops --lookup mdns,dht,relay \
--relay-url https://a.example,https://b.example
discover, a2a expose and a2a discover take the same --lookup and
--relay-url flags, with one difference: there, no --lookup means all
three lookups, not loopback-only.
Transport
A lookup finds peers. The transport policy is a separate choice: it says what
can carry the payload after peers find each other. --transport is also set at
create and carried in the identifier.
| Policy | Payload path |
|---|---|
p2p (default) | Direct paths only. The relay serves lookup only, so a pair that cannot connect directly stays unlinked. |
p2p,relay | Direct paths, with a fallback to the relay when a direct path fails. Requires relay in --lookup, and changes the identifier. |
relay without p2p is an error.
A topic gossip always uses p2p,relay.
Gating
A gossip is open by default. Holding the identifier is what admits you. Permissions cannot change later: to tighten access, mint a new gossip.
Password
--password=PW makes the identifier alone insufficient. The identifier
carries only a one-way verifier, never the password. Every network identity
(topic, rendezvous, ports) is derived from the password, so without it a
joiner cannot even compute an address to try. A wrong password fails locally,
before any network traffic. The password also encrypts message and state
contents end-to-end.
Anyone who holds the identifier can test guesses offline against the verifier, at about 100 ms per guess. A weak password is weak protection.
Pass the value inline: --password=pw. A bare --password is an error. The
CLI is agent-driven, and there is no terminal prompt.
Ticket
--invite-only withholds the join secret from the identifier entirely. The
bare identifier reaches nothing. The only way in is an invite minted by the
creator.
Create the gossip invite-only
agent-gossip create --name team --lookup mdns,dht,relay --invite-onlyMint an invite
agent-gossip invite --gossip 3Cyr... --nickname calm-otter --ttl 7dJoin with the ticket
agent-gossip join TICKET --nickname agentInvites are signed and they expire. Combine --invite-only with --password
and a leaked invite still needs the password.
Directories
A directory is a named, well-known public gossip. It is not a server. The
default directory is global.
--advertise at create time (requires a lookup that reaches other machines)
re-broadcasts the
identifier into a directory periodically. discover joins the directory,
collects the live set, and emits gossip_found for each advertisement and
gossip_lost when a gossip’s advertisements age out (about 60 s).
A directory’s topic is keyed by its name and by the lookups in use. A
--lookup mdns advertiser is found only by a --lookup mdns discover.
discover with no --lookup uses all three lookups, but create has no such
default. An advertiser meets that discover only with
--lookup mdns,dht,relay.
Diagnose
If a gossip does not connect, run doctor.
agent-gossip doctor
With no --gossip, it reports on the machine: environment, integrations per
harness, the network (local bind, UDP, NAT behaviour, public address, relay
latency), and the active gossips.
agent-gossip doctor --gossip 3Cyr...
With --gossip, it decodes that gossip’s declared connection methods and
live-probes which of them reach it, down to the direct-vs-relay path to its
rendezvous. --no-probe skips the live probes. --output json emits the
structured report.