About
Tana queue service

Tags
No tags available

Languages
TypeScript 97%, Dockerfile 3%

tana-queue

high-performance transaction ingestion gateway for the Tana blockchain.

overview

tana-queue is the entry point for all transactions entering the blockchain. it provides an HTTP API for submitting transactions and manages a Redis-backed queue that validators consume during block production.

how it works

clients submit transactions via HTTP POST. the queue service validates the basic structure and pushes them to a Redis stream. validators then consume batches of transactions from the stream when producing blocks.

clients
   |
   v
POST /transactions
   |
   v
tana-queue
   |
   v
Redis stream
   |
   v
validators consume for block production

transaction flow

  1. client submits signed transaction to queue service
  2. queue validates structure and pushes to Redis stream
  3. stream assigns unique ID and persists transaction
  4. validator calls consume endpoint to get batch
  5. validator produces block with transactions
  6. validator acknowledges processed transactions
  7. stream removes acknowledged transactions

horizontal scaling

multiple queue instances can run behind a load balancer, all writing to the same Redis backend. this allows linear scaling of ingestion throughput.

load balancer
     |
+----+----+----+
|    |    |    |
q1   q2   q3   q4
|    |    |    |
+----+----+----+
     |
   Redis

single instance handles 5,000-10,000 transactions per second. four instances can handle 20,000-40,000 transactions per second.

architecture

built with TypeScript and Hono, compiled to a standalone Bun binary. uses Redis streams for durable message passing with at-least-once delivery guarantees.

the consumer group pattern ensures transactions are not lost if a validator crashes mid-processing. unacknowledged transactions are automatically reassigned to other consumers.

api

  • POST /transactions - submit a transaction
  • GET /consume - consume batch for block production
  • POST /acknowledge - acknowledge processed transactions
  • GET /pending - list pending transactions
  • GET /count - queue statistics
  • GET /health - service health check

integration

tana-queue runs as a standalone service accessed through the tana-api gateway. validators connect directly to consume transactions, while clients submit through the public API.