How niko-2182/bnb26_penguins_maharashtra_round works
FairDrop is a ticket-allocation API designed to resist bots with proof-of-work, trust scoring, and weighted random selection. Its visible workflow is client join and verification, followed by a claim attempt that atomically checks eligibility and seat availability. The API also exposes session, metrics, ledger, and admin endpoints. The graph reflects the sampled runtime code and README; several documented capabilities are retained, but unsampled handler and persistence behavior limits which connections can be verified.
Main entry points: router.go Route dispatch · session.go Session manager · redis.go Redis client · service.go Metrics service
Components 21
API surface
- HTTP server
api/main.go - Route dispatch
api/internal/httpx/router.go - Join endpoint
api/internal/handlers/join.go - Verify endpoint
api/internal/handlers/verify.go - Session endpoint
api/internal/handlers/session.go - Claim endpoint
api/internal/handlers/claim.go
Eligibility checks
- Session manager
api/internal/session/session.go - Rate limiter
api/internal/abuse/ratelimit.go - Proof of work
api/internal/abuse/pow.go - Trust scoring
api/internal/abuse/trust.go
Allocation and state
- Seat allocator
api/internal/allocator/claim.go - Redis client
api/internal/store/redis.go - Redis
- Session persistence
api/internal/session/store.go
Operations and reporting
- Ledger endpoint
api/internal/httpx/router.go - Ledger service
api/internal/ledger/service.go - Ledger persistence
api/internal/ledger/store.go - Metrics endpoint
api/internal/httpx/router.go - Metrics service
api/internal/metrics/service.go - Admin endpoints
api/internal/httpx/router.go
Other components
- Client
Connections 26
- Client → HTTP server: sends requests
- HTTP server → Route dispatch: serves routes
api/main.go - Route dispatch → Join endpoint: routes join
api/internal/httpx/router.go - Route dispatch → Verify endpoint: routes verify
api/internal/httpx/router.go - Route dispatch → Session endpoint: routes session
api/internal/httpx/router.go - Route dispatch → Claim endpoint: routes claim
api/internal/httpx/router.go - Route dispatch → Ledger endpoint: serves ledger
api/internal/httpx/router.go - Route dispatch → Metrics endpoint: serves metrics
api/internal/httpx/router.go - Route dispatch → Admin endpoints: serves admin
api/internal/httpx/router.go - Route dispatch → Session manager: creates manager
api/internal/httpx/router.go - Route dispatch → Ledger service: creates service
api/internal/httpx/router.go - Route dispatch → Metrics service: creates service
api/internal/httpx/router.go - Session manager → Rate limiter: checks limits
api/internal/session/session.go - Session manager → Trust scoring: gets trust score
api/internal/session/session.go - Session manager → Proof of work: verifies proof
api/internal/session/session.go - Session manager → Redis client: uses client
api/internal/session/session.go - Claim endpoint → Trust scoring: gets trust score
api/internal/handlers/claim.go - Claim endpoint → Seat allocator: attempts claim
api/internal/handlers/claim.go - Seat allocator → Redis client: executes script
api/internal/allocator/claim.go - Redis client → Redis: accesses data
api/internal/store/redis.go - Ledger endpoint → Ledger service: reads events
api/internal/httpx/router.go - Ledger service → Ledger persistence: reads or records
api/internal/ledger/service.go - Metrics endpoint → Metrics service: gets metrics
api/internal/httpx/router.go - Metrics service → Ledger service: reads recent events
api/internal/metrics/service.go - Metrics service → Redis client: reads counters
api/internal/metrics/service.go - Admin endpoints → Redis client: updates state
api/internal/httpx/router.go