The Akash Node is a blockchain application built on the Cosmos SDK that enables decentralized cloud computing marketplace functionality. This document provides a high-level overview of the architecture and links to detailed documentation for each layer.
Layer Documentation
For detailed information about each layer:
- Consensus Layer - CometBFT consensus, block production, P2P networking
- Application Layer - Cosmos SDK modules, Akash modules, state management
- API Layer - gRPC, REST, RPC interfaces and examples
High-Level Architecture
+---------------------------------------------------------------+| Akash Node || || +----------------------------------------------------------+ || | API Layer | || | (gRPC | REST | WebSocket | RPC) | || +----------------------------------------------------------+ || | || +----------------------------------------------------------+ || | Application Layer (ABCI) | || | | || | +-----------------------+ +-------------------------+ | || | | Cosmos SDK Modules | | Akash Modules | | || | | - Auth | | - Deployment | | || | | - Bank | | - Market | | || | | - Staking | | - Provider | | || | | - Gov | | - Escrow | | || | | - Distribution | | - Audit | | || | | - Slashing | | - Cert | | || | | - IBC | | - Take | | || | +-----------------------+ +-------------------------+ | || | | || | +----------------------------------------------------+ | || | | State Store (IAVL Tree) | | || | +----------------------------------------------------+ | || +----------------------------------------------------------+ || | || +----------------------------------------------------------+ || | Consensus Layer (CometBFT) | || | - Block Production | || | - Byzantine Fault Tolerance | || | - P2P Networking | || | - Gossip Protocol | || +----------------------------------------------------------+ |+---------------------------------------------------------------+Core Components
1. Consensus Layer (CometBFT)
CometBFT (formerly Tendermint) provides the consensus engine and networking layer.
Responsibilities:
- Block Production - Validators propose and vote on new blocks
- Consensus - Byzantine Fault Tolerant consensus algorithm
- P2P Networking - Gossip protocol for block and transaction propagation
- State Machine Replication - Ensures all nodes maintain identical state
How it works:
- Validators take turns proposing blocks (round-robin)
- Validators vote on proposed blocks (2/3+ majority required)
- Committed blocks are passed to application layer via ABCI
- Application processes transactions and updates state
Key Features:
- Instant finality (no forks)
- Byzantine fault tolerance (up to 1/3 malicious validators)
- High performance (~1-2 second block times)
→ Learn more about Consensus Layer
2. Application Layer (Cosmos SDK + ABCI)
The application layer implements blockchain logic using the Application Blockchain Interface (ABCI). This layer processes transactions, manages state, and enforces business logic.
Application Structure
The Akash node application (AkashApp) extends BaseApp from Cosmos SDK:
type AkashApp struct { *baseapp.BaseApp *apptypes.App
aminoCdc *codec.LegacyAmino cdc codec.Codec txConfig client.TxConfig interfaceRegistry codectypes.InterfaceRegistry sm *module.SimulationManager}Key components:
- BaseApp - Core application logic from Cosmos SDK
- Codec - Serialization/deserialization of transactions and state
- ModuleManager - Manages all blockchain modules
- Store - Persistent key-value database (IAVL tree)
→ Learn more about Application Layer
3. Module System
Akash uses a modular architecture where each module handles specific functionality.
Cosmos SDK Modules (Standard Blockchain)
| Module | Purpose |
|---|---|
| auth | Account authentication and signature verification |
| bank | Token transfers and balance tracking |
| staking | Validator staking and delegation |
| gov | On-chain governance and proposals |
| distribution | Fee distribution to validators/delegators |
| slashing | Validator penalties for misbehavior |
| mint | Token inflation |
| ibc | Inter-Blockchain Communication |
| upgrade | Coordinated chain upgrades |
| evidence | Byzantine behavior evidence handling |
| authz | Authorization grants |
| feegrant | Fee allowances |
Akash-Specific Modules
| Module | Purpose | Source |
|---|---|---|
| deployment | Deployment creation and management | x/deployment |
| market | Order and bid matching | x/market |
| provider | Provider registration and attributes | x/provider |
| escrow | Escrow accounts for leases | x/escrow |
| audit | Provider auditing and attestations | x/audit |
| cert | TLS certificate management | x/cert |
| take | Income distribution/fees | x/take |
4. State Management
IAVL Tree
State is stored in an IAVL tree (Immutable AVL tree):
- Merkle proofs - Cryptographic proof of state
- Versioning - Historical state snapshots
- Efficient queries - O(log n) lookups
State Store Layout
Each module has its own prefixed key space in the store:
deployment/ - Deployment statemarket/ - Orders, bids, leasesprovider/ - Provider registrationsescrow/ - Escrow account balancesaudit/ - Audit attributescert/ - TLS certificatestake/ - Fee parametersState Transitions
State changes only occur through transactions:
- Transaction submitted to mempool
- Validator proposes block with transactions
- Block is committed via consensus
- Transactions executed in order
- State root hash updated
- New state is persisted
Transaction Lifecycle
1. Transaction Submission
Client → Mempool → Validation → PendingProcess:
- Client signs transaction with private key
- Transaction broadcast to node’s mempool
- Node validates signature, fees, and account sequence
- Valid transactions added to mempool
- Propagated to peer nodes via gossip
2. Block Production
Mempool → Proposal → Consensus → CommitProcess:
- Proposer selects transactions from mempool
- Creates block and broadcasts to validators
- Validators vote on block (prevote + precommit)
- Block committed when 2/3+ majority reached
- All nodes apply transactions to state
3. Transaction Execution
Block → BeginBlock → DeliverTx → EndBlock → CommitABCI workflow:
BeginBlock
- Called at start of block
- Updates validator set changes
- Distributes block rewards
DeliverTx (per transaction)
- Verify transaction signatures
- Check account balances and sequences
- Execute transaction logic
- Emit events
- Deduct fees
EndBlock
- Called at end of block
- Execute module end-block logic
- Return validator updates
Commit
- Compute new state root hash
- Persist state to disk
- Return app hash to CometBFT
API Layer
gRPC Services
Each module exposes gRPC services for queries and transactions:
Query services:
/akash.deployment.v1.Query/akash.market.v1.Query/akash.provider.v1.Query/cosmos.bank.v1beta1.Query/cosmos.staking.v1beta1.Query
Tx services:
/akash.deployment.v1.Msg/akash.market.v1.Msg/akash.provider.v1.Msg
REST API
gRPC-Gateway provides REST endpoints:
GET /akash/deployment/v1/deploymentsGET /akash/market/v1/ordersGET /akash/provider/v1/providersPOST /cosmos/tx/v1beta1/txsRPC Endpoints
CometBFT RPC for blockchain queries:
/status - Node status/block - Get block by height/blockchain - Get block headers/tx - Get transaction/validators - Get validator set/consensus_state - Get consensus stateNode Responsibilities
Full Nodes
Responsibilities:
- Maintain complete blockchain history
- Validate all blocks and transactions
- Serve RPC/API requests
- Propagate transactions and blocks to peers
Does NOT:
- Participate in consensus (no voting)
- Propose blocks
- Receive staking rewards
Validator Nodes
Everything a full node does, plus:
- Participate in block production
- Vote on proposed blocks
- Sign blocks with validator key
- Receive staking rewards and commission
- Subject to slashing for downtime/double-signing
Synchronization Methods
1. Block Sync
- Downloads blocks sequentially from peers
- Verifies each block
- Slowest method (~days for mainnet)
2. State Sync
- Downloads state snapshot at specific height
- Verifies state via app hash
- Fast sync (~30 minutes)
- See Node Build guides
3. Snapshots
- Downloads compressed blockchain snapshot
- Extracts and verifies data
- Fastest method (~5 minutes)
- Default method for Helm deployments
Database and Storage
Database Backends
Supported databases:
- GoLevelDB (default) - Pure Go implementation
- RocksDB - High performance C++ database
- BadgerDB - Pure Go, high performance
Storage Requirements
| Pruning Strategy | Disk Space | Historical Queries |
|---|---|---|
nothing | ~500 GB | Full history |
default | ~100 GB | Recent blocks only |
everything | ~50 GB | Current state only |
Recommended for validators: nothing (to serve historical queries)
Networking
P2P Layer
PeX (Peer Exchange):
- Discovers peers automatically
- Shares known peers via gossip
- Maintains peer connections
Persistent Peers:
persistent_peers = "node1@host1:26656,node2@host2:26656"Seeds:
seeds = "seed1@host1:26656,seed2@host2:26656"Ports
| Port | Protocol | Purpose |
|---|---|---|
| 26656 | TCP | P2P (CometBFT) |
| 26657 | TCP | RPC |
| 1317 | TCP | REST API |
| 9090 | TCP | gRPC |
Security
Key Management
Validator Key:
- Used to sign blocks
- Stored in
priv_validator_key.json - Should use TMKMS for production
Node Key:
- Used for P2P authentication
- Stored in
node_key.json - Less critical than validator key
Sentry Node Architecture
For production validators:
Internet | +------------+------------+ | | Sentry Node Sentry Node | | +------------+------------+ | Validator (Private Network)Sentries protect validator from DDoS attacks.
Monitoring and Observability
Metrics
Prometheus metrics exposed on port 26660:
[instrumentation]prometheus = trueprometheus_listen_addr = ":26660"Key metrics:
tendermint_consensus_height- Current block heighttendermint_consensus_validators- Validator counttendermint_mempool_size- Transactions in mempooltendermint_p2p_peers- Connected peers
Logs
Configure logging:
[log]level = "info" # trace, debug, info, warn, errorformat = "plain" # plain or jsonConfiguration
Key Configuration Files
config.toml - CometBFT configuration
- P2P settings
- RPC settings
- Consensus parameters
app.toml - Application configuration
- API settings
- gRPC settings
- Pruning strategy
- State sync settings
genesis.json - Chain genesis state
- Initial validator set
- Chain parameters
- Module genesis state