| Layer | Behavior |
|---|---|
| Bootstrap | Default bundle may hardcode RPC + relay + signal URLs (mirrors when your infra is up). |
| Directory | tks_listSwarmValidators + GET /discovery + libp2p gossip → merged pools. |
| Mailbox | Federated HTTP /store / /fetch / /ack with RTT rank and failover. |
| Fast path | Federated WSS (optional); HTTP always works if any relay in the pool is live. |
Hardcoded hostnames are hints, not the protocol. If bootstrap relays die but other validators are registered on-chain, clients refresh and use those.
Cipher clients load client-core/network_bundle.default.json or a custom file:
export CIPHER_NETWORK_BUNDLE=/path/to/my-network.json{
"version": 1,
"bundle_id": "my-community-v1",
"http_relays": [
"https://relay-a.example.com",
"https://relay-b.example.com"
],
"signal_ws": [
"wss://signal-a.example.com/ws",
"wss://signal-b.example.com/ws"
],
"rpc_http": [
"https://rpc.tokenkickstarter.com",
"http://127.0.0.1:9944"
]
}-
On-chain — for each
rpc_httpURL, JSON-RPCtks_listSwarmValidators.
Active validators’endpointfield is merged (HTTPS as-is, or libp2p/ip4/…/tcp/4002→http://host:4002). -
Relay mesh —
GET /discoveryon every known HTTP relay; mergerelays[].http_basewheremessage_relay: true(shard ingest hosts are excluded). -
Signal WebSocket pool — same discovery pass builds an RTT-ranked list of
wss://…/wsendpoints (nearest first). Persistent WS + relay/internal/pushafter/storetargets ~100ms delivery when both peers use a nearby validator.
Relays refresh automatically when messaging starts (then every 5 minutes) and before each store/fetch if the cache is stale.
Inspect the pool (always live-refreshes):
cipher-cli network- Send: nearest relay (RTT-ranked) until
POST /storesucceeds; co-located signal server gets an instant push. - Receive (online): WebSocket
type: messagepush; HTTPPOST /fetchis fallback when WS is down. - Ack:
POST /ackon federated HTTP relays after delivery.
See RUN-A-RELAY.md — run tks-chain-node with cipher flags and register_validator on TKS.
- Ed25519-signed network bundles (multisig release key)
- libp2p HyperSwarm client path (aligned with TKS node)
- Stake/slash for relay operators