About
Tana api service

Tags
No tags available

Languages
TypeScript 95%, Dockerfile 5%

tana-api

unified API gateway for the Tana blockchain platform.

overview

tana-api is the public-facing entry point for all client requests. it routes traffic to internal microservices, providing a single endpoint for CLI tools, mobile apps, and web applications to interact with the blockchain.

how it works

clients send requests to tana-api, which examines the path and forwards the request to the appropriate internal service. responses flow back through the gateway to the client.

routing architecture

clients (CLI, mobile, web)
            |
            v
       tana-api
            |
   +--------+--------+--------+--------+
   |        |        |        |        |
 queue   ledger    edge     mesh   identity
 (write)  (read)   (exec)   (net)   (auth)

service routing

  • transactions - routed to tana-queue for submission
  • blocks, users, balances - routed to tana-ledger for queries
  • contract execution - routed to tana-edge for HTTP handlers
  • network topology - routed to tana-mesh for node discovery
  • authentication - routed to tana-identity for QR auth

architecture

built with TypeScript and Bun for high-performance HTTP proxying. the gateway adds minimal latency while providing a consistent interface regardless of internal service organization.

benefits

  • clients only need to know one endpoint
  • internal services are not exposed publicly
  • service topology can change without client updates
  • central point for future auth, rate limiting, caching

api surface

the gateway exposes a unified API that mirrors the internal services:

  • POST /transactions - submit transactions
  • GET /users, GET /balances - query state
  • GET /blocks - query blockchain
  • GET /contracts/:id/* - execute contract handlers
  • GET /nodes - network topology
  • POST /auth/* - authentication flows

integration

tana-api sits in front of all other Tana services. clients connect only to the gateway, which handles routing and load distribution across the service mesh.