Introducing a new way to review your PRs.

Read the announcement

celestiaorg / celestia-node

Celestia Data Availability Nodes

View on GitHub

22 documents · Updated Nov 23, 2026

docs / api-and-operations

Public APIs and node operations

Celestia Node provides two public operating paths: a command-line interface for node lifecycle, local administration, and diagnostics; and an authenticated JSON-RPC service for applications and remote tools. A Go client combines Bridge reads with Core-backed account and submission actions when an application needs both access patterns. See RPC API contracts for method-level behavior and command-line operations for command usage.

Operating model

The operator creates a local node store, starts a node of the required type, and then uses the CLI or RPC service while the daemon runs. The store supplies the saved configuration and key material that connect lifecycle actions, authentication, and signed operations.

Node lifecycle

bridge and light are the two node modes. Each mode has an initialization step that creates its local state and a start step that opens the store, constructs the node, and runs it until a termination signal arrives.

The normal lifecycle is:

  1. Initialize the selected mode with celestia bridge init or celestia light init.
  2. Start the daemon with the matching celestia bridge start or celestia light start command.
  3. Use RPC-backed commands or an external client while the daemon serves requests.
  4. Send a termination signal and let the node stop its services and close its store.

Start-time flags override saved values for that run only. Use initialization or configuration maintenance when a value must apply to later starts.

References: cmd/start.go• L19-77 nodebuilder/init.go• L24-74

Store maintenance

Store maintenance changes local operating state outside the live RPC path. Configuration updates add missing defaults while preserving existing values where possible. A store reset removes node data while keeping the configuration and key store.

These actions use the store lock and should run after the daemon stops. Removing the saved configuration is a separate administrative action from removing node data.

References: cmd/config.go• L10-55 cmd/reset_store.go• L10-31 nodebuilder/config.go• L76-145

Key management

Keys provide the signer for account actions and blob submission. The cel-key utility uses the configured home and keyring directory to expose standard key operations, while the Go client helper can create a named key when the selected keyring does not contain one.

The keyring backend controls how key data is protected. The test backend stores key data in plain text and the client warns about that choice. When a new key is created, its mnemonic is printed once and must be stored safely.

References: cmd/…/main.go• L21-59 api/…/keyring.go• L17-64

RPC interface

The node exposes its application boundary through a JSON-RPC endpoint. The endpoint groups node capabilities into namespaces and applies transport, request, and permission checks before a method runs. See RPC API contracts for the supported methods and result rules.

Endpoint access

The default endpoint is http://localhost:26658. Operators can change its address and port, enable TLS, configure browser access with CORS, and add an optional per-IP request limit. The server also bounds request size, connection count, and HTTP timeouts.

Authentication is enabled by default. A client sends a bearer token in the Authorization header. The CLI can resolve the endpoint and token from the selected node store or accept them as explicit connection settings. If an explicit URL is used without a token, the request is unauthenticated unless the CLI also has a store from which to load the token.

The endpoint starts and stops with the node. A port conflict, invalid listen address, or invalid TLS key pair prevents the service from starting. Per-IP limits use the address visible to the node, so a reverse proxy should enforce the limit when it hides the original client address.

References: api/…/server.go• L28-35 api/…/server.go• L133-181 api/…/server.go• L240-284 cmd/start.go• L36-76

Capability namespaces

Namespaces are the main boundary between a caller and a node capability. The same capability groups are available through the typed RPC client and the CLI's RPC-backed commands.

NamespaceOperational purpose
headerRead chain headers and sync state
shareRead shares, squares, namespace data, and proofs
blobSubmit and retrieve blobs and check inclusion
stateRead account state and submit account actions
dasInspect data availability sampling
p2pInspect peers and network connections
nodeInspect and administer the node
blobstreamWork with data-root tuples and proofs
fibreSubmit, retrieve, and inspect Fibre data and account flows

References: api/…/server.go• L224-234 api/…/client.go• L28-39 api/…/client.go• L64-100

Go client boundary

The Go client separates read access from signed submission. A read client uses the Bridge JSON-RPC service for headers, blobs, shares, Blobstream, and Fibre reads. A full client adds a Core gRPC connection and a keyring for state actions and blob submission.

Fibre write operations run through the full client's local Core-backed service rather than through the Bridge. This keeps the signer and transaction path with the application while the read path remains available through Bridge RPC. The client must be closed so its Bridge, Core, transaction, blob, and Fibre resources stop together.

Queued submission can use multiple worker accounts to increase throughput. Parallel workers can change inclusion order, so callers that depend on order should use immediate or single-worker submission.

References: api/…/client.go• L25-52 api/…/client.go• L73-112 api/…/client.go• L154-223

API documentation

The celestia docgen command produces an OpenRPC description of the JSON-RPC surface. The document gives tools and users a stable view of method names, permissions, transport needs, and representative request and result values.

The generator derives examples from registered API types and embedded sample data. A new or changed public type therefore needs a usable example before documentation generation can describe it. Subscription methods require the WebSocket transport rather than a normal HTTP request.

References: api/…/examples.go• L41-59 api/…/examples.go• L61-239

Request path

This flow shows how a CLI command or application reaches a namespace service and receives an authenticated result.

flowchart LR
    A[CLI or application] --> B[RPC URL and token]
    B --> C[HTTP or HTTPS JSON-RPC endpoint]
    C --> D[Request and permission checks]
    D --> E[Capability namespace]
    E --> F[Node service]
    F --> G[JSON result or error]

The CLI creates the RPC connection for the command that needs it. Applications can use the typed namespace client or the higher-level Go client when they need reads and signed actions together.

References: api/…/server.go• L133-234 api/…/client.go• L81-112

Authentication and authorization

The RPC server uses signed JSON Web Tokens to decide which methods a caller may use. The node store supplies the signing secret, while the CLI and node administration commands provide the operator paths for issuing, checking, and revoking tokens.

Permission levels

Permissions form an access ladder. A higher level includes the lower levels, so a caller can receive only the access needed for its role.

LevelPurpose
publicCalls available without elevated access
readRead-only node and network data
writeState-changing actions and submissions
adminNode, peer, and token administration

--rpc.skip-auth disables permission checks and allows all CORS origins, methods, and headers. It is suitable only when another trusted network boundary protects the endpoint.

References: api/…/server.go• L184-228 api/…/server.go• L224-234 api/…/examples.go• L81-84

Token operations

The top-level auth command creates a token from the node store for use by an external client. The node permissions operation checks a token. The node set-permissions operation issues a token through the running node, and node revoke-token invalidates one and closes its active WebSocket sessions.

Token issuance and revocation require admin access. A token can also have a time limit. Operators must select the store that owns the intended signing secret or provide an explicit token and endpoint.

References: cmd/auth.go• L25-126 nodebuilder/…/node.go• L69-127 api/…/server.go• L184-205

Operational inspection

Inspection tools turn node state into operator-facing checks. The main CLI uses the RPC boundary, while cel-shed provides focused diagnostics that can inspect Core data directly.

Node and network checks

The node commands report node information and readiness, adjust log levels, and manage permissions. The p2p commands show identity, peers, reachability, connections, bandwidth, and pubsub state. The header commands show local and network head data with sync state, while DAS sampling statistics show the current availability-sampling state.

Together these checks distinguish a process or access problem from a network or sync problem.

References: nodebuilder/…/node.go• L17-127 nodebuilder/…/node.go• L36-74 nodebuilder/…/p2p.go• L22-51 nodebuilder/…/header.go• L13-29 nodebuilder/…/das.go• L9-33

Data and account actions

The blob and share commands inspect data by height, namespace, coordinate, or commitment. Blob commands can also submit data. A value with a 0x prefix is decoded as hex; other values are treated as text. The state commands read account data and support signed account actions such as transfers, delegation, reward withdrawal, and fee grants.

Read operations and signed actions use different permission and signer requirements. The detailed arguments and result contracts belong in RPC API contracts and command-line operations.

References: nodebuilder/…/blob.go• L25-37 nodebuilder/…/blob.go• L114-223 nodebuilder/…/share.go• L16-44 nodebuilder/…/state.go• L26-70 nodebuilder/…/state.go• L127-155

Diagnostic utility

The cel-shed utility is a separate entrypoint for focused node diagnostics. Its square utility fetches a signed Core block at a chosen height, builds the extended data square and header, and compares the computed data hash with the header's recorded data hash.

This path is useful when an operator needs to check the relation between consensus block data and its data-availability representation. It connects to Core gRPC directly and does not use the node's JSON-RPC endpoint.

References: cmd/…/square.go• L21-68

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep node lifecycle flags, saved configuration, store paths, and keyring paths aligned across initialization and startup.
  • Keep RPC namespace registration aligned with typed clients, CLI commands, and generated OpenRPC documentation.
  • Treat RPC address, TLS, CORS, request limits, and authentication changes as changes to the external deployment boundary.
  • Keep permission metadata, token creation, token lookup, and token revocation aligned. Active WebSocket sessions must follow the revocation rule.
  • Keep Go client read paths, Core-backed submission paths, signer settings, and Fibre routing aligned.
  • Keep OpenRPC example values valid when public request or response types change.
  • Keep blob input decoding and account transaction settings aligned between CLI behavior and RPC contracts.
  • Keep square inspection inputs aligned with the Core endpoint and block data format.

Important failure modes

TriggerConsequenceGuard
Starting without an initialized storeThe node cannot load its saved configuration or keysRun the matching init command first
Expecting a start-time override to persistLater starts use the old saved valueUpdate saved configuration when persistence is required
Using an authenticated endpoint without a token or matching storeThe RPC request is rejectedProvide a token or select the correct node store
Enabling TLS with an invalid certificate and key pairThe RPC service does not startUse readable matching TLS files
Exposing --rpc.skip-auth beyond a trusted boundaryAny reachable caller can use all permissions and permissive CORSKeep authentication enabled at public boundaries
Running store maintenance while the node is openThe store lock rejects the action or protects against unsafe accessStop the node first
Using multiple queued transaction workers when order mattersBlob inclusion order can differ from submission orderUse immediate or single-worker submission
Revoking a token still used by a clientNew requests fail and active WebSocket sessions closeIssue a replacement before revocation
Changing a public API type without an example valueOpenRPC generation fails or lacks a useful schema exampleAdd or update representative examples
Running square inspection with an unreachable Core endpoint or bad heightThe block cannot be fetched or comparedUse a reachable endpoint and existing height

Key files

FileWhy to read it
cmd/start.goShows how saved and temporary settings become a running node and how shutdown works
api/…/server.goDefines the RPC transport, authentication, request limits, CORS, and lifecycle boundary
api/…/client.goDefines the typed namespace client surface
api/…/client.goShows the Bridge read and Core-backed submission boundary for applications
api/…/keyring.goDefines client keyring creation and new-key behavior
cmd/…/main.goDefines the key management entrypoint and its keyring context
api/…/examples.goProvides representative values used by generated RPC documentation
nodebuilder/…/node.goShows node inspection and token administration operations
nodebuilder/…/blob.goIllustrates blob reads and submission through the CLI
nodebuilder/…/state.goIllustrates account reads and signed state actions
cmd/…/square.goShows direct Core inspection of a block's data square and header