Skip to content
For the complete documentation index optimized for AI agents, see llms.txt or llms-full.txt. A markdown version of this page is available by appending .md to the URL or sending Accept: text/markdown.

a4-server

For AI agents: the documentation index is at llms.txt (full corpus: llms-full.txt). A markdown source for this page is /a4-server/overview.md.

a4-server is a Rust crate that runs generated Arete behavior in your own infrastructure. A live server can connect to Yellowstone gRPC, process Solana data through projections, and stream results to clients. The same builder can instead run a program-only spec() and expose typed account reads without starting a live projection runtime.

Portable Artifacts vs Runtime Configuration

Section titled “Portable Artifacts vs Runtime Configuration”

The Rust DSL keeps these concepts separate:

  • A ProgramSpec identifies portable public program behavior. It has no endpoint or managed decoder selection.
  • A LiveSpec defines entities, mappings, and views over exact ProgramSpecs.
  • A StackManifest composes aliased LiveSpecs and selected views for clients.
  • A hosted Program Release immutably binds a ProgramSpec to managed decoder behavior.
  • A deployment runs one exact composition; a binding attaches an endpoint and authentication policy to a live, program, chain, or transaction capability.

Self-hosted a4-server remains code-first:

Server::builder().spec(my_stack::spec())

The generated spec() supplies parsers, account readers, and automatic local release fingerprints derived from ProgramSpecs and the decoder-engine contract. It does not require a hosted registry, public release manifest, or decoder selection.

Do not treat one server URL as part of artifact identity. The builder enables runtime surfaces independently:

SurfaceBuilder configurationClient transport
Live views.websocket() and the generated live runtimePer-LiveSpec WebSocket transport
Program reads.program_reads()Per-program HTTP transport and release/binding
Chain reads.chain_reads()Generic Solana chain-read transport
Transactions.transactions_config(...)Transaction inspect/send transport

.http() is a convenience that enables health, Program Read, chain-read, and stack-query routes together; transaction routes remain disabled until explicitly configured. A composed client can use multiple live aliases and multiple program bindings while choosing completely separate chain and transaction transports.

To run a stack with a4-server, you need:

RequirementDescription
Yellowstone gRPC EndpointRequired for a live runtime. A URL to a Solana node running the Yellowstone Geyser plugin.
X-TokenUsually required when the selected Yellowstone provider authenticates live streams.
Rust 1.75+Required to build the server binary.
A compiled definitionYour crate with the #[arete(...)] macro, which generates a live or program-only spec() function.

a4-server reads configuration from environment variables:

VariableRequiredDescription
YELLOWSTONE_ENDPOINTFor live runtimeYour Yellowstone gRPC endpoint URL
YELLOWSTONE_X_TOKENProvider-specificAuthentication token for the endpoint

Use a4-server when:

  • Developing and testing stacks locally
  • Running a single stack in your own infrastructure
  • You need full control over the server deployment
  • You already have Yellowstone gRPC access
  • You need a program-only typed read service without live views

Consider Arete Cloud when:

  • You need multi-stack orchestration
  • You want managed Yellowstone infrastructure
  • You need built-in authentication and API keys
  • You prefer zero-config deployment