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
| Category | Purpose | Key Flags |
|---|---|---|
| Chain / Sync | Chain and synchronization settings | --datadir, --networkid, --syncmode, --mainnet, --testnet |
| Accounts | Key management | --keystore, --unlock, --password |
| Mining | Block production | --mine, --miner.etherbase, --miner.gaslimit |
| Networking | P2P configuration | --port, --maxpeers, --bootnodes, --nat |
| API | RPC endpoints | --http, --http.port, --ws, --http.api |
| Transaction Pool | Transaction pool tuning | --txpool.pricelimit, --txpool.globalslots |
| Performance | Performance tuning | --cache, --cache.database, --cache.trie |
| State | State management | --state.scheme, --gcmode |
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.
| Flag | Purpose | Default |
|---|---|---|
--datadir | Root directory for all data | Linux: ~/.stablenet, macOS: ~/Library/StableNet |
--datadir.ancient | Separate location for ancient/freezer data | <datadir>/gstable/ancient |
--keystore | Override keystore location | <datadir>/keystore |
--datadir.minfreedisk | Auto-shutdown disk threshold (MB) | 0 (disabled) |
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.
| Flag | Description | Default |
|---|---|---|
--db.engine | Select state and chain database engine | pebble |
Synchronization Mode
The--syncmode flag controls how the blockchain is synchronized:
| Mode | Value | Description | Use Case |
|---|---|---|---|
| Full | full | Download all blocks and execute all transactions and state transitions locally | Validator nodes, standard full nodes |
| Snap | snap | Download state snapshots first, then sync blocks to quickly build full state | Fast initial sync |
| Light | light | Keep only block headers; request state/data on demand from peers | Low-resource environments |
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
| Flag | Purpose | Default | Notes |
|---|---|---|---|
--mine | Enable mining/validation | false | Required for validators |
--miner.etherbase | Block reward address | Node key address | Auto-set in Anzeon |
--miner.gaslimit | Block gas ceiling | 105,000,000 | Target block gas limit |
--miner.extradata | Extra block data | Client version | Custom identifier |
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
| Flag | Purpose | Default |
|---|---|---|
--port | P2P listening port | 30303 |
--maxpeers | Maximum peer connections | 50 |
--nat | NAT port mapping method | any |
--bootnodes | Bootstrap node enode URLs (comma-separated) | Auto-selected per network |
--nodiscover | Disable peer discovery | false |
--nodekey | P2P node key file path | Auto-generated |
--netrestrict | Allowed network CIDR mask | None (allow all) |
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
| Flag | Purpose | Default |
|---|---|---|
--http | Enable HTTP-RPC server | Disabled |
--http.addr | Listening interface | localhost |
--http.port | Listening port | 8545 |
--http.api | Exposed API modules | eth,net,web3 |
--http.corsdomain | Allowed CORS domains | None |
--http.vhosts | Allowed virtual hosts | localhost |
WebSocket Configuration
| Flag | Purpose | Default |
|---|---|---|
--ws | Enable WebSocket server | Disabled |
--ws.addr | Listening interface | localhost |
--ws.port | Listening port | 8546 |
--ws.api | Exposed API modules | eth,net,web3 |
--ws.origins | Allowed origins | None |
IPC Configuration
IPC is enabled by default, creating a socket at<datadir>/gstable.ipc.
| Flag | Purpose | Default |
|---|---|---|
--ipcdisable | Disable IPC | false |
--ipcpath | IPC socket path | gstable.ipc |
API Namespace Security
Do not expose all API namespaces publicly. Recommended configurations:| Deployment Type | HTTP APIs | WebSocket APIs | Notes |
|---|---|---|---|
| Public RPC node | eth,net,web3 | eth,net,web3 | Read-only, safe for public use |
| Validator node | None or localhost only | None | Minimize attack surface |
| Development node | eth,net,web3,personal,debug,admin | Same | Full access for testing |
| Archive node | eth,net,web3,txpool,debug | Same | Debug APIs for analysis |
personal, admin, and debug namespaces provide privileged operations. Never expose them on public interfaces without authentication.
RPC Limiting Flags
| Flag | Purpose | Default |
|---|---|---|
--rpc.gascap | Max gas for eth_call / eth_estimateGas | 50,000,000 |
--rpc.evmtimeout | Timeout for eth_call | 5 seconds |
--rpc.txfeecap | Max fee for eth_sendTransaction | 0 (unlimited) |
--rpc.batch-request-limit | Max requests per batch | 1000 |
--rpc.batch-response-max-size | Max batch response size | 25MB |
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:
| Node Type | --cache | --gcmode | Notes |
|---|---|---|---|
| Validator (synced) | 4096+ | full | Fast state access |
| Validator (initial sync) | 8192+ | full | Faster initial sync |
| Full node | 2048 | full | Balanced performance |
| Archive node | 8192+ | archive | No pruning, large disk required |
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:

