Purpose and Scope
This document explains how to configure a StableNet node using command-line flags, configuration files, and deployment patterns. For information on building the node binary, see Installation and Building.For genesis block setup and network initialization, see Genesis Setup and Network Initialization.
Configuration System Overview
StableNet node configuration uses a hierarchical system that converts command-line flags into structured configuration objects, which are then used to initialize each component. Configuration precedence: Command-line flags > TOML configuration file > DefaultsCommand-Line Flags
All configuration flags are defined incmd/utils/flags.go and are grouped by category.
Core Flag Categories
Network Selection Flags
StableNet provides flags for selecting predefined networks:--mainnet: Connect to StableNet mainnet (ChainID 8282)--testnet: Connect to StableNet testnet (ChainID 8283)--networkid: Override the automatic network ID (defaults to ChainID)- Bootstrap nodes are automatically selected based on the network flag
Data Directory
The--datadir flag specifies the root directory where the node stores blockchain data and state.Some sub-paths, such as the keystore, can be overridden with separate flags. If not specified, internal defaults are used.
Database Configuration
This setting controls the type of database engine used by the node.It determines how state and chain data are stored and accessed internally, affecting performance and resource usage.
Synchronization Mode
The--syncmode flag controls how the blockchain is synchronized:
State Scheme
The--state.scheme flag selects the state storage layout:
hash: Legacy hash-based scheme (default, stable)path: Path-based scheme with Verkle trie support (experimental)
Mining and Validator Configuration
Flags controlling block production for StableNet validators (Anzeon-enabled networks).Mining Flags
Anzeon Network Design Characteristics
etherbaseis automatically derived from--nodekeyand cannot be manually overriddenGasTip(priority fee) is enforced as a network-wide value via GovValidator governance (except for authorized accounts)BaseFeeuses a StableNet-customized calculation logic, with increase/decrease rates and min/max bounds controlled by chain parametersBaseFeeis not burned; it is distributed to validators
For governance-based gas tip management, see Validator Governance.
P2P Network Configuration
P2P networking flags control peer discovery and connection management.P2P Configuration Flags
Bootstrap Node Selection
Bootstrap nodes are selected in the following order:- Use
--bootnodesif explicitly specified - Use bootstrap nodes defined in the config file
- If
--mainnet, use StableNet mainnet bootstrap nodes - If
--testnet, use StableNet testnet bootstrap nodes
Static and Trusted Peers
Static and trusted peers can be configured in the[Node.P2P] section of a TOML configuration file:
- StaticNodes: Peers the node always tries to maintain connections with
- TrustedNodes: Peers exempt from peer count limits
RPC API Configuration
RPC APIs expose node functionality to external clients. StableNet supports HTTP, WebSocket, and IPC transports.HTTP Configuration
WebSocket Configuration
IPC Configuration
IPC is enabled by default, creating a socket at<datadir>/gstable.ipc.
API Namespace Security
Do not expose all API namespaces publicly. Recommended configurations:
Warning:
personal, admin, and debug namespaces provide privileged operations. Never expose them on public interfaces without authentication.
RPC Limiting Flags
These limits protect the node from resource exhaustion by malicious or misconfigured clients.
Performance Tuning
Cache and database settings have a major impact on node performance and resource usage.Cache Configuration
The--cache flag sets total memory allocation, which is split across subsystems. Default allocation:
--gcmode archive), Trie Dirty cache is disabled and reallocated to Trie Clean and Snapshot.
Recommended settings by node type:
Database Engine Selection
The--db.engine flag selects the underlying key-value store:
pebble(default): Modern, fast, better compressionleveldb: Legacy, stable, compatible with older databases
Garbage Collection and Pruning
The--gcmode flag controls state pruning behavior:
full(default): Prunes old state tries, keeps recent state onlyarchive: Keeps all historical state without pruning (requires TBs of disk)
Common Configuration Patterns
Validator Node
--mineenables block production--nodekeyspecifies the validator’s operational key (also used as etherbase in Anzeon)- RPC is bound to localhost for security
- Validators must use
--syncmode full
Public RPC Node
--syncmode snapallowed since this is not a validator- Bound to
0.0.0.0for public access - Only safe APIs exposed (
eth,net,web3)
Development Node
--devcreates a temporary development network with pre-funded accounts--dev.period 1produces a block every second- All APIs enabled for debugging
--allow-insecure-unlockallows HTTP account unlocking (development only)
Archive Node
--gcmode archivedisables state pruningdebugandtraceAPIs are useful for analysis- Requires significant disk space (multiple TBs)
Configuration Files
While command-line flags are the primary configuration method, TOML configuration files are useful for managing complex deployments.TOML Configuration Files
To export the current node configuration to a TOML file:--config flag:
Genesis Configuration
For custom networks, the genesis configuration is provided as JSON and loaded using thegstable init command:

