Synopsis
Description
Starts one or more query servers for serving blockchain data through different protocols. By default, both query servers (Arrow Flight and JSON Lines) are started. Servers can be selectively enabled using flags. Default behavior: If no server flags (--flight-server, --jsonl-server) are specified, BOTH servers are enabled by default. When any server flag is specified, only the explicitly enabled servers will start.
The server runs continuously until terminated (Ctrl+C or kill signal).
Options
Enable Arrow Flight RPC Server. This provides a high-performance binary protocol for querying data (default port 1602). Uses Apache Arrow Flight for efficient data transfer.Can also be set via the
FLIGHT_SERVER environment variable.Enable JSON Lines Server. This provides a simple HTTP interface for querying data (default port 1603). Accepts SQL queries via POST requests and returns results in JSON Lines format.Can also be set via the
JSONL_SERVER environment variable.Configuration
Server ports and query settings are configured in the TOML config file:Configuration Fields
Arrow Flight server binding address and port
JSON Lines server binding address and port
Maximum blocks per streaming microbatch
Seconds between keep-alive messages (minimum 30 seconds)
Environment Overrides
Available Endpoints
| Endpoint | Default Port | Protocol | Streaming | Use Case |
|---|---|---|---|---|
| Arrow Flight | 1602 | gRPC | Yes | High-performance queries, batch and streaming |
| JSON Lines | 1603 | HTTP | No | Simple HTTP queries, batch only |
Examples
Start Both Servers (Default)
Start Only Arrow Flight Server
Start Only JSON Lines Server
Using Environment Variables
Verifying Server Status
Check JSON Lines Endpoint
Check Arrow Flight Endpoint
Querying Examples
JSON Lines Query
Arrow Flight Query
See the Arrow Flight transport documentation for detailed client usage.Directory Configuration
ampd server requires --config (or AMP_CONFIG) to be provided. Default data, providers, and manifests directory paths are resolved relative to the config file’s parent directory only when the config file does not specify those paths.
When the config file specifies data_dir, providers_dir, or manifests_dir, those values are used directly.
This command does not create directories itself; it relies on the configured paths and any downstream components to create or validate storage locations as needed.
Exit Codes
Server shut down gracefully
Error occurred during server operation or configuration is invalid
See Also
- ampd overview - Command overview and global options
- ampd solo - Development mode with embedded worker