agorix
AirdropMarketsCollectionsLeaderboardActivity
Agorix · Decentralized Marketplace
Independent · Resilient · Community-Run

A cross-chain marketplace, run by the community.

Discover, list, and trade across Bitcoin, Ethereum, and Solana on an open, community-run network.

Marketplace
CollectionsMarketsLeaderboardActivity
Network
GovernanceExplorerAirdropDocs
Account
ProfileSettings
Legal
Terms of ServicePrivacy PolicyYour Privacy Choices
agorix.io — Lasting Access
CID: 0xA60R1X · v0.1
AirdropMarketsCollections
D
Protocol Docs
Node ArchitectureGateway Front DoorProtocol ExplorerMesh NetworkingHeartbeat SystemData ShardingSSR & ShortlinksLocal Node Telemetry Rollups
Docs/Network/Gateway Front Door
Network

Gateway Front Door

Stateless region-aware routing. How the gateway routes users to the fastest, closest nodes with health-aware cohort selection.

#Gateway Front Door

The Gateway is the entry point for users connecting to the marketplace. It is a stateless, region-aware, health-aware routing layer that directs users to the fastest, closest nodes without introducing a centralized dependency.

#Design Principles

  • Stateless. The gateway holds no protocol state. It only routes.
  • Region-aware. Prefers geographically closer nodes based on multiple geo signals.
  • Health-aware. Continuously probes nodes and quarantines unhealthy ones.
  • Picked from measurements. A visitor is given three servers from the nodes other operators measured as near and able. Nobody keeps a list of servers, and a node's own word brings it no visitors.
  • Redundant. Multiple gateways can run independently with zero shared state.

#Routing Signals

The gateway considers seven signals when scoring nodes for cohort assignment, in descending priority:

SignalDescription
Region matchSame cloud region or data center as the user
Country matchSame country, determined by IP geolocation
Continent matchSame continent when country data is unavailable
CoordinatesGeographic distance calculation using lat/lng when available
Health probesNode response time and availability from recent probes
Client hintsBrowser-reported RTT and connection quality (Sec-CH-RTT, Sec-CH-Downlink)

Signals are combined into a weighted score. The gateway picks the highest-scoring nodes for the cohort, subject to the size constraints below.

#Cohort Selection

Users get assigned to a cohort of nodes that will serve their requests:

ParameterValue
Minimum cohort size3 nodes
Target cohort sizeceil(N / 3) where N = total healthy nodes
Maximum cohort size8 nodes

The cohort is the set of nodes that cross-check reads for a session. It does not decide which servers a visitor gets: those come from the measured route map.

#Node Health Probes

ParameterValue
Probe intervalEvery 15 seconds
Probe timeout1.5 seconds
Result cache TTL10 seconds

Probes hit each node's health endpoint and record response time. Nodes that fail probes or exceed the timeout are marked unhealthy.

#Quarantine System

Unhealthy nodes enter quarantine with a TTL. While quarantined, a node is excluded from all cohort assignments. The quarantine TTL increases with repeated failures and resets after a node passes consecutive health checks. This prevents flapping nodes from degrading user experience.

#Capability Filtering

The gateway routes based on what capabilities are needed for the user's current transaction. If a user wants to buy a Bitcoin ordinal, the gateway filters for nodes with all required capabilities:

  • btc_mempool_watch -- monitor mempool for the transaction
  • btc_block_watch -- track confirmations
  • ord_index_read -- verify ordinal inscription data
  • btc_psbt_share_store -- hold PSBT shares during signing
  • protocol_validate -- validate protocol events
  • protocol_attest -- sign attestations as a witness

Only nodes advertising all required capabilities for the transaction type are included in the cohort.

#Hash Attestation

The gateway verifies that all nodes in a cohort serve the same release hash. On each probe, the node reports its build hash. If a node is serving a different version from the majority of the cohort, it gets excluded. This ensures users always get a consistent marketplace experience -- no mixed-version rendering or API mismatches.

#Rotation Strategy

  • Navigation rotation -- the active node rotates within the cohort on page navigation, distributing load
  • Pending cohort -- smooth transition when a new cohort is being computed; old cohort remains active until the new one is ready
  • Failover -- automatic fallback to the next node in the cohort if the active node becomes unhealthy
  • Cache TTL -- cohort assignments are cached with configurable TTL to avoid recomputation on every request

#Multiple Gateways

Any number of gateways can run independently:

  • They share no state by default
  • Optional shared Redis for cross-gateway probe caching (reduces redundant probes)
  • No single point of failure -- if one gateway goes down, DNS or load balancer routes to another
  • Geographic distribution reduces latency for users in different regions
  • Each gateway makes independent routing decisions based on its own probes

#Network Discovery

The gateway exposes a /network/discover endpoint that returns the current list of known healthy nodes. This endpoint is used by:

  • New nodes joining the network for initial peer discovery
  • Existing nodes refreshing their peer list as a fallback
  • External monitoring tools

The discovery response includes a genesis block hash for network identity verification. Nodes reject peers that report a different genesis hash, preventing cross-network contamination.

#Node Lifecycle States

Beyond simple "healthy / unhealthy", each node publishes an effectiveStatus to the gateway via the descriptor publisher:

StatusMeaningGateway Behavior
READYFully booted, all caches warm, accepting trafficEligible for cohort and direct routing
WARMINGBooted, but core caches still hydrating after restart or DB recoveryExcluded from user-facing routing; allowed for media replica reads
DEGRADEDOperating but a non-critical subsystem is unhealthyRouted to with a scoring penalty
OFFLINEProcess is up but cannot serve real traffic (DB lost, MPC stuck, etc.)Excluded from all routing

The WARMING window matters because a node fresh out of restart can answer health probes while its query path is still cold. Routing real users to a warming node would mean the first few hundred requests slow-load every cache miss. The gateway holds users on READY peers until the warming node settles, while still allowing low-stakes operations like media replica fetches.

The transition out of WARMING is automatic: once the node's bring-up sequence reports done, the descriptor publisher flips the field and the gateway picks the node up on its next selection cycle.

PreviousNode ArchitectureNext Protocol Explorer

On this page

  • Gateway Front Door
  • Design Principles
  • Routing Signals
  • Cohort Selection
  • Node Health Probes
  • Quarantine System
  • Capability Filtering
  • Hash Attestation
  • Rotation Strategy
  • Multiple Gateways
  • Network Discovery
  • Node Lifecycle States