Skip to main content

Purpose and Scope

This document describes the JSON-RPC API architecture of StableNet, including available API namespaces, service implementations, and the backend abstraction layer that connects API services to core blockchain components.
The API system provides external access to node functionality via HTTP, WebSocket, and IPC transports.
For information on event filtering and subscriptions, refer to Event Filtering and Subscriptions.

API Architecture Overview

The StableNet RPC API follows a layered architecture in which API service implementations depend on a Backend interface.
This design enables access to core blockchain functionality without tight coupling to the Ethereum backend.

API Namespace Structure

StableNet organizes its APIs into multiple namespaces, each with a clearly defined responsibility and purpose.
Namespaces are registered via internal/ethapi.GetAPIs, eth.Ethereum.APIs(), node-level apis(), and the consensus engine (WBFT) APIs(), and are exposed externally through the RPC handler.

API Namespace Mapping

eth Namespace

The eth namespace provides core Ethereum protocol functionality and is composed of multiple API service classes.

EthereumAPI Service

EthereumAPI handles network state and fee-related queries. In StableNet with Anzeon enabled, MaxPriorityFeePerGas does not use a gas price oracle and instead returns the gas tip value enforced by the GovValidator contract.

BlockChainAPI Service

BlockChainAPI provides interfaces for querying blockchain state and data.

TransactionAPI Service

TransactionAPI is responsible for transaction creation, signing, and submission.

txpool Namespace

TxPoolAPI provides read-only access to transaction pool state. Transactions are classified into two states:
  • pending: Eligible for inclusion in the next block
  • queued: Waiting due to nonce gaps or insufficient balance

personal Namespace

PersonalAccountAPI provides password-based account management.
For security reasons, it is typically disabled on external RPC endpoints.

debug Namespace

DebugAPI provides advanced functionality for development and operational diagnostics.

Major Feature Categories

Transaction and Block Tracing
  • TraceTransaction()
  • TraceBlock()
  • TraceBlockByNumber()
  • TraceBlockByHash()
  • TraceCall()
State Inspection
  • DumpBlock()
  • AccountRange()
  • StorageRangeAt()
Database Management
  • DbGet()
  • DbAncient()
  • ChaindbProperty()
  • ChaindbCompact()
Profiling
  • CpuProfile()
  • BlockProfile()
  • MemStats()
  • GcStats()

web3 Namespace

web3API provides basic Web3 utility functions.

istanbul Namespace

Exposed only when WBFT consensus is enabled.

StableNet Fee Delegation Extensions

For fee-delegated transactions, StableNet provides the following extended APIs in the personal and eth namespaces. The resulting signed transaction is submitted via eth_sendRawTransaction, and gas costs are paid by the fee payer.

API Test Infrastructure

The codebase includes the following test infrastructure:
  • Unit tests based on a mock backend
  • Genesis- and key-based integration tests
  • RPC serialization and response validation tests