Node configuration and operating modes
Celestia node configuration defines the network, local store, external services, data policy, and run-time options used to create a node. The configuration is saved as TOML in the node store, while command-line flags can select the store and apply temporary or persistent changes before the node starts. The configuration is then passed to the node assembly flow described in Node assembly and service lifecycle.
Configuration lifecycle
The configuration lifecycle turns a node type and command-line input into one complete configuration. Initialization writes the selected values to the store. Startup reads those values, applies start-time overrides, and uses the result to construct the services.
The main stages are:
- The
bridgeorlightcommand selects the node type. The node type chooses the default profile and the service choices that follow. - The command selects a store path. An explicit
--node.storepath wins. Otherwise the path comes fromCELESTIA_HOMEor the default path for the node type and network. - Configuration loading checks an explicit
--node.configfile first. If that flag is not set, the command tries config.toml in the selected store. - If no stored configuration is available, the command uses defaults for the selected node type.
- Subsystem flags update the in-memory configuration.
initpersists the result.startuses the result for that run only. - Node assembly validates subsystem values and selects services from the node type and the final configuration.
This flow keeps the store as the durable source for normal operation while allowing operators to test a changed setting for one start. The --node.config option is useful when a complete TOML file must be supplied outside the store.
After loading the configuration, node construction uses the stored configuration by default. Callers that need a different profile can provide a configuration directly, while the node still uses the selected type and network to assemble its services.
This diagram shows how node type and command input become either durable configuration or a running node.
flowchart LR
A[Node type and network] --> B[Select store]
B --> C{Configuration source}
C -->|--node.config| D[Load external TOML]
C -->|store config.toml| E[Load stored TOML]
C -->|none| F[Create type defaults]
D --> G[Apply command flags]
E --> G
F --> G
G --> H{Command}
H -->|init| I[Save config and create store]
H -->|start| J[Build and run node]
References: cmd/flags_node.go• L21-73 cmd/util.go• L77-159 cmd/init.go• L10-30 cmd/start.go• L19-76 nodebuilder/config.go• L22-53 nodebuilder/node.go• L80-95
Durable configuration
The durable configuration is a TOML document at <store>/config.toml. It groups settings by subsystem so that one node store carries the values needed by the node builder, its data services, and its external interfaces. nodebuilder.Init saves the supplied configuration and creates the key and data areas that make the store usable.
Configuration updates add values from the current defaults without replacing existing non-empty custom values. This supports upgrades that introduce new fields. The config-update command writes the merged result back to the store, while config-remove deletes the stored configuration and leaves the other store data in place.
The store has a lock shared by initialization, updates, removal, and normal opening. A second operation against the same store therefore fails instead of changing configuration while the node uses it.
References: nodebuilder/config.go• L25-35 nodebuilder/config.go• L53-74 nodebuilder/config.go• L76-145 nodebuilder/init.go• L24-74 nodebuilder/store.go• L59-94 cmd/config.go• L10-56
Start-time overrides
Start-time flags change the configuration held by the running process but do not change config.toml. Initialization flags have a persistent effect because init saves the final configuration. This distinction lets an operator keep a stable base profile and use a one-run override when needed.
Flag parsing is ordered around the store and network first, then the Core, state, RPC, pruning, and light-node header settings. The selected values are carried through the command context and supplied to node assembly. A missing configuration in that context causes the command layer to rebuild the type defaults.
References: cmd/start.go• L23-59 cmd/init.go• L10-25 cmd/util.go• L110-159 cmd/env.go• L31-73
Lifecycle timeouts
Startup and shutdown timeouts bound how long the assembled node may take to enter or leave service. The node reads these limits from the final Node configuration and returns a timeout error when the corresponding lifecycle phase does not finish in time.
References: nodebuilder/node.go• L97-110 nodebuilder/node.go• L145-163
Node operating modes
The node type is the high-level operating mode. It controls the purpose of the node and changes the service set, storage expectations, and default resource policy. The supported modes are Bridge, Light, and Full.
| Mode | System role | Configuration effect |
|---|---|---|
| Bridge | Connects a Celestia consensus node to the data-availability network and ingests chain data. | Enables the Core-backed block path, supports the bridge data path, and defaults to peer exchange and stored block retention with pruning. |
| Light | Provides a smaller data-availability client while retaining data-availability sampling. | Uses light availability and sampling settings, enforces pruning, and can run without a Core connection for services that do not need chain state. |
| Full | Runs the full node operating profile. | Selects the Full node type during assembly and uses the configuration path for that profile. |
The mode is selected by the top-level CLI command and is not inferred from the TOML file. The same configuration sections exist across modes, but each mode consumes only the settings that match its service role. The selected mode is also part of the node's peer identity. The peer user agent reports the network, mode, semantic version, and short commit so peers can identify the running profile and build.
References: nodebuilder/node.go• L39-52 nodebuilder/…/type.go• L10-29 nodebuilder/…/type.go• L77-95 cmd/node.go• L16-67 nodebuilder/config.go• L38-50 nodebuilder/module.go• L23-55 nodebuilder/…/buildInfo.go• L21-58 nodebuilder/…/host.go• L36-67
Bridge mode
Bridge mode joins the consensus-facing Core service to the data-availability services. Its configuration can define a primary Core endpoint and additional endpoints for more block and transaction sources. The mode also enables peer exchange by default so the bridge can help other peers find data.
Bridge mode uses storage-oriented header and share defaults. Its normal operating policy runs the pruner to reclaim data outside the storage window. The --archival flag changes this policy by disabling the pruning service and retaining all synced blocks.
References: nodebuilder/…/module.go• L21-100 nodebuilder/…/config.go• L17-30 nodebuilder/…/config.go• L35-66 nodebuilder/…/config.go• L38-61 nodebuilder/…/module.go• L54-80
Light mode
Light mode focuses on sampling and peer-based data access rather than serving as the primary bridge to a consensus node. It enables light availability settings and uses a sampling-aware header window. It can still use a Core endpoint when state or transaction access is required, but a Core connection is not required for the light node to provide its data-availability role.
Light mode always uses pruning. The mode also has smaller lifecycle and storage defaults than Bridge mode so that startup, shutdown, and local resource use fit a lighter operating profile.
References: nodebuilder/node_light_test.go• L44-56 nodebuilder/…/module.go• L36-39 nodebuilder/…/config.go• L47-57 nodebuilder/…/config.go• L36-52 nodebuilder/…/config.go• L20-33 nodebuilder/…/module.go• L54-65 nodebuilder/…/config.go• L15-27
Subsystem settings
The top-level configuration combines the settings that guide each major service family. These settings do not define separate products. They provide the inputs that let node assembly choose connections, storage behavior, data exchange, state access, and external access as one operating profile.
The default Share discovery peer limit is derived from the DASer concurrency limit. It stays within a bounded range so higher sampling concurrency can use more discovered peers without allowing an unbounded peer target.
| Configuration area | Operating concern |
|---|---|
Node | Startup and shutdown time limits. Light mode uses shorter defaults. |
Core | Connection to the consensus node, optional transport security, token authentication, and extra endpoints. |
State | Keyring choice, gas estimation, and queued transaction submission. |
P2P | Listen and announce addresses, mutual peers, peer exchange, and connection limits. |
RPC | Bind address, port, authentication, CORS, TLS, and optional request limits. |
Share | Local EDS storage, cache size, share exchange, Bitswap, discovery, and peer management. |
Header | Trusted header sources, header storage, and synchronization policy. |
DASer | Sampling enablement, sampling parameters, and the concurrency input for the default discovery peer limit. |
References: nodebuilder/config.go• L25-53 nodebuilder/…/config.go• L10-37 nodebuilder/…/config.go• L17-44 nodebuilder/…/config.go• L13-33 nodebuilder/…/config.go• L12-33 nodebuilder/…/config.go• L37-46 nodebuilder/…/config.go• L18-34 nodebuilder/…/config.go• L24-35 nodebuilder/…/config.go• L12-17
Network and store selection
The network identifies the chain to which the node connects. Mainnet is the build default. Mocha and private networks are also supported, and CELESTIA_CUSTOM can register a custom network with its network ID, optional genesis hash, and optional bootstrap peers.
The network must be selected consistently during initialization and startup. The custom-network path is intended for a new store only. Reusing a store across networks can mix persisted data with the wrong chain.
The default store path uses CELESTIA_HOME when it is set. Without it, mainnet uses a path based on the node type, while testnet and custom network paths also include the network name.
References: nodebuilder/…/network.go• L12-24 nodebuilder/…/network.go• L27-67 nodebuilder/…/flags.go• L33-40 nodebuilder/…/flags.go• L68-124 nodebuilder/store.go• L215-237 nodebuilder/settings.go• L41-46
Core connection
The Core settings define whether the node can communicate with a Celestia consensus node. The primary endpoint uses an IP or host name and a gRPC port. The default port is 9090. Additional endpoints are file-only settings that add source and submission capacity beyond the primary endpoint.
TLS protects the Core connection. An X-Token path can add gRPC authentication, but it is valid only when TLS is enabled. If no Core IP is set, the node does not treat the Core connection as configured. A port flag without an IP is rejected.
References: nodebuilder/…/config.go• L17-44 nodebuilder/…/config.go• L46-87 nodebuilder/…/flags.go• L17-47 nodebuilder/…/flags.go• L51-88
Peer-to-peer settings
P2P settings control how the node appears and connects on the data-availability network. Listen addresses accept inbound traffic. Announce and no-announce addresses control which reachable or local addresses the node presents to peers. Mutual peers identify connections that should remain prioritized, and the two peers must configure each other.
Bridge mode enables peer exchange by default. The detailed host, identity, transport, routing, and discovery behavior is covered in Peer-to-peer networking.
References: nodebuilder/…/config.go• L12-33 nodebuilder/…/config.go• L35-66 nodebuilder/…/flags.go• L21-65
RPC access
RPC settings define the external control and data interface. The default server listens on localhost:26658 and keeps authentication enabled. Operators can change the bind address or port, enable HTTPS with a certificate and key, and enable CORS for selected browser origins and methods.
Rate limiting is off by default. When enabled, it limits requests per remote IP. A reverse proxy can hide the real client IP, so rate limiting should then be applied at the proxy instead. The service registration and endpoint surface are described in Node RPC service wiring.
References: nodebuilder/…/config.go• L19-46 nodebuilder/…/config.go• L48-77 nodebuilder/…/config.go• L93-126 nodebuilder/…/flags.go• L27-95 nodebuilder/…/module.go• L12-39
Data retention and archival mode
The normal policy is to prune data outside the mode-specific availability window. This keeps local storage bounded while preserving the data needed by the node role. The --archival flag is available only to Bridge mode and disables the pruning service.
Archival mode also changes the data services to use archival behavior and advertises the node as archival. When a store moves from archival mode back to pruning mode, startup conversion resets the pruning checkpoint so old data can be removed correctly.
References: nodebuilder/…/config.go• L5-13 nodebuilder/…/flags.go• L15-38 nodebuilder/…/module.go• L39-80 nodebuilder/…/module.go• L96-133
Observability and transaction options
Operational flags add capabilities without changing the stored subsystem profile. Logging flags set global or module-specific levels. Profiling can expose pprof on port 6000. Metrics and tracing export telemetry through OTLP, while Pyroscope can export profiles and can attach to tracing.
State flags control the key name and keyring backend used for signing. They can also select a gas estimator and a transaction worker count. Zero workers submit immediately, one worker uses synchronous queued submission, and more than one worker enables parallel submission with separate accounts.
References: cmd/flags_misc.go• L40-135 cmd/flags_misc.go• L138-266 nodebuilder/settings.go• L83-138 nodebuilder/…/config.go• L18-41 nodebuilder/…/flags.go• L19-78
Validation boundaries
Validation protects the boundaries where configuration becomes a network connection, a secure endpoint, or a service policy. Node assembly checks subsystem configuration before it starts the related service. Invalid values therefore fail node construction instead of producing a partially configured process.
Important relationships include:
- Core TLS must be enabled when an X-Token path is set. Core endpoints must have valid ports and must not duplicate one another.
- RPC TLS requires both certificate and key files. Enabled RPC rate limiting requires positive request, burst, and cache values.
- CORS method or header settings require CORS to be enabled. CORS without allowed origins does not permit cross-origin access.
- Light header and share settings must preserve the storage window needed for sampling.
- Transaction worker counts cannot be negative.
- Mutual peers, trusted header peers, and custom bootstrappers must use valid multiaddresses.
References: nodebuilder/…/config.go• L58-114 nodebuilder/…/config.go• L93-126 nodebuilder/…/flags.go• L118-191 nodebuilder/…/config.go• L55-82 nodebuilder/…/config.go• L84-104 nodebuilder/…/config.go• L44-57 nodebuilder/…/flags.go• L45-65
Change checklist
When these files or sections are changed, remember to consider these:
- Update the default profile and the CLI mode selection together when a node mode gains or loses a service.
- Keep derived defaults such as the Share discovery peer limit aligned with the DASer concurrency setting when either subsystem changes.
- Keep
--node.configloading, store config.toml loading, andconfig-updatemerge behavior aligned when configuration fields change. - Preserve the init-versus-start persistence boundary when adding a new flag.
- Update both network selection and default store naming when adding a long-running or custom network path.
- Keep archival mode changes aligned across the pruner, share availability, Core block path, and archival peer advertisement.
- Keep security checks aligned between TLS flags, certificate or token paths, and their subsystem validators.
- Keep the peer user-agent fields aligned with the build metadata and selected node mode when the node identity or release information changes.
- Keep store-backed configuration loading and caller-supplied configuration aligned with the node type and network passed to assembly.
- Keep startup and shutdown timeout behavior aligned with the node lifecycle when service hooks change.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The selected store is already open. | Init, config changes, or startup cannot safely use the store. | The store lock rejects the second operation. |
--core.port is set without --core.ip. | The Core connection cannot be formed from an incomplete endpoint. | Core flag parsing returns an error. |
| Core X-Token is configured without TLS. | The authenticated token setup is rejected. | Core validation requires TLS for X-Token use. |
| RPC TLS is enabled without readable certificate and key files. | The RPC service fails validation before startup. | RPC validation requires both paths and checks both files. |
| Archival mode is requested for a Light node. | The requested retention policy is not supported by that mode. | Pruner flag handling rejects archival mode outside Bridge. |
| A custom network is run over an existing store. | Persisted data can belong to a different chain. | The custom-network path warns operators to use a fresh store. |
| A configuration field is added but an old store is not updated. | New behavior can lack a usable value or fail validation. | config-update merges current defaults into the stored file. |
| Node startup or shutdown exceeds its configured timeout. | The lifecycle operation returns a timeout error before all hooks finish. | The node bounds each lifecycle phase with the configured startup or shutdown timeout. |
Key files
| File | Why to read it |
|---|---|
| nodebuilder/config.go | Defines the top-level configuration, defaults, the DASer-to-discovery peer-limit relationship, TOML load and save, and upgrade merge behavior. |
| nodebuilder/node.go | Shows how configuration enters node assembly and how the selected node type controls lifecycle and supported operating profiles. |
| cmd/flags_node.go | Shows how the command selects the store and chooses between an external and stored configuration. |
| cmd/util.go | Shows the order in which flags become the final node configuration. |
| cmd/init.go | Shows the persistent initialization path. |
| cmd/start.go | Shows the run-time override path and the transition from configuration to node startup. |
| nodebuilder/…/type.go | Defines the supported operating modes and their names. |
| nodebuilder/module.go | Shows how the final mode and configuration reach the service assembly. |
| nodebuilder/…/flags.go | Defines the archival mode boundary and its effect on retention. |
| nodebuilder/…/network.go | Defines supported networks and network aliases. |
| nodebuilder/store.go | Explains store naming, locking, and the location of the durable configuration. |
| nodebuilder/…/config.go | Defines Core endpoint and authentication constraints. |
| nodebuilder/…/config.go | Defines RPC access, security, CORS, and rate-limit constraints. |
| nodebuilder/…/buildInfo.go | Defines the build identity that appears with the selected mode in peer-facing node identity. |