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.mdto the URL or sendingAccept: text/markdown.
Quickstart
For AI agents: the documentation index is at llms.txt (full corpus: llms-full.txt). A markdown source for this page is /using-stacks/quickstart.md.
This quickstart gets you streaming live Solana data in a few minutes using the ORE demo — a real, deployed Arete stack for the ORE mining program. It’s the fastest way to see Arete in action.
Prerequisites
Section titled “Prerequisites”Choose how you want to run the CLI:
Step 1: Install the CLI
Section titled “Step 1: Install the CLI”Install the native binary via Cargo:
cargo install a4-cliThen use the a4 command:
a4 create my-appThis is the same CLI — Cargo installs it as a4, and so does npm.
No installation needed — just run:
npx @usearete/a4 create my-appThis downloads and runs the CLI without installing it globally.
Install globally via npm:
npm install -g @usearete/a4Then use the a4 command:
a4 create my-appCreate Your App
Section titled “Create Your App”Step 2: Scaffold the project
Section titled “Step 2: Scaffold the project”a4 create my-appnpx @usearete/a4 create my-appa4 create my-appYou’ll be prompted to select a template:
| Template | Description | Run Command |
|---|---|---|
react-ore | React + Vite dashboard | npm run dev → open localhost:5173 |
typescript-ore | TypeScript CLI client | npm start |
rust-ore | Rust + Tokio client | cargo run |
Step 3: Or specify the template directly
Section titled “Step 3: Or specify the template directly”a4 create my-app --template rust-ore # or react-ore, typescript-orenpx @usearete/a4 create my-app --template react-ore # or typescript-ore, rust-orea4 create my-app --template react-ore # or typescript-ore, rust-oreOne final step is required for the browser template: configure hosted authentication.
Step 4: Add browser authentication
Section titled “Step 4: Add browser authentication”The React template connects to the hosted ORE stack. Add a publishable key to my-app/.env.local:
VITE_ARETE_PUBLISHABLE_KEY=hspk_...The template passes this value to AreteProvider as auth={{ publishableKey }}. Authentication is required for hosted read-only viewing; a wallet is not.
What You Just Built
Section titled “What You Just Built”The scaffolded app connects to a deployed Arete Stack — a streaming data pipeline that:
- Watches Solana for ORE mining program activity
- Transforms raw transactions into structured round data (round ID, motherlode, deployment totals)
- Streams updates to your app via WebSocket as they happen on-chain
Solana
ORE program
Arete
ORE stack
Your App
Live feed
No RPC calls. No polling. No custom indexer. Just streaming data.
In the TypeScript SDK mental model, the generated ORE stack is a cartridge and the Arete session is the console. The cartridge keeps its existing generated stack object and types; inserting it as ore makes it available at session.stacks.ore. The same console provides session.programs.<name> for standalone programs, session.chain for generic Solana reads, and session.execute(...) for prepared semantic operations.
Available Templates
Section titled “Available Templates”| Template | Command | What You Get |
|---|---|---|
| react-ore | npx @usearete/a4 create my-app | React + Vite dashboard showing live ORE mining rounds |
| typescript-ore | npx @usearete/a4 create my-app | TypeScript CLI that streams ORE data to your terminal |
| rust-ore | npx @usearete/a4 create my-app | Rust + Tokio client streaming ORE round updates |
All templates connect to the hosted ORE stack at wss://ore.stack.arete.run. Hosted connections are authenticated even when the data is read-only.
You can also specify the template directly:
npx @usearete/a4 create my-app --template react-oreWhat’s Inside
Section titled “What’s Inside”The React template uses @usearete/react with a generated stack definition:
import { AreteProvider } from "@usearete/react";import { OreDashboard } from "./components/OreDashboard";import { ORE_STREAM_STACK } from "./generated/ore-stack";
const publishableKey = import.meta.env.VITE_ARETE_PUBLISHABLE_KEY;if (!publishableKey) throw new Error("VITE_ARETE_PUBLISHABLE_KEY is required");
export default function App() { return ( <AreteProvider stack={ORE_STREAM_STACK} auth={{ publishableKey }}> <OreDashboard /> </AreteProvider> );}import { useArete } from "@usearete/react";import { ORE_STREAM_STACK } from "../generated/ore-stack";
export function OreDashboard() { const arete = useArete(ORE_STREAM_STACK); const board = arete.views.OreBoard.state.use({ address: arete.addresses.board(), }); const roundId = board.data?.state.roundId; const round = arete.views.OreRound.state.use( roundId == null ? undefined : { roundId }, );
return ( <div> <p>{arete.status === "connected" ? "Live" : arete.status}</p> {arete.socketIssue && <p>{arete.socketIssue.message}</p>} <p> Round #{round.data?.id.roundId?.toString() ?? "..."} - Motherlode:{" "} {round.data?.state.motherlode?.toString() ?? "..."} </p> </div> );}ORE’s Board account is the authority for the active round. OreRound.latest remains available for recent-round history, but the live board follows OreBoard/state to keyed OreRound/state during rollover.
autoConnect is omitted because it defaults to true and controls only this initial connection. autoReconnect also defaults to true, independently, and controls recovery only after an established connection is lost.
The TypeScript template uses @usearete/sdk with a generated stack and typed views:
import { createSession } from "@usearete/sdk";import { ORE_STREAM_STACK } from "./generated/ore-stack";
const session = await createSession({ stacks: { ore: ORE_STREAM_STACK },});
for await (const update of session.stacks.ore.views.OreRound.latest.watch({ take: 1 })) { if (update.type === "upsert" || update.type === "patch") { console.log(`Round #${update.data.id.roundId}`); console.log(`Motherlode: ${update.data.state.motherlode}`); }}Connected stacks expose stable views, queries, programs, addresses, constants, defaults, math, read, and flows namespaces when present. Each connected program exposes programId, schemas, pdas, addresses, accounts, queries, raw, instructions, transactions, flows, constants, defaults, and math.
For write-enabled cartridges, semantic .prepare(...) methods take normal camelCase objects; pass the result to session.execute(...). The program.raw namespace is the exact IDL escape hatch and preserves IDL names and nested shapes, including snake_case.
The Rust template uses a4-sdk with typed views:
use a4_sdk::prelude::*;use a4_stacks::ore::{OreStack, OreRound};
#[tokio::main]async fn main() -> anyhow::Result<()> { let a4 = Arete::<OreStack>::connect().await?;
let mut stream = a4.views.ore_round.latest().listen();
while let Some(round) = stream.next().await { println!("Round # {:?}", round.id.round_id); println!("Motherlode: {:?}", round.state.motherlode); } Ok(())}Using an AI Coding Agent?
Section titled “Using an AI Coding Agent?”Install Arete agent skills so your AI can write correct code without you looking up docs:
npx skills add AreteA4/skillsNow try asking your agent: “Show me the ORE mining round data in a table with live updates.”
See Build with AI for the full guide and prompt cookbook.
Next Steps
Section titled “Next Steps”Now that you’ve seen Arete in action, where you go next depends on what you’re building:
Using an existing on-chain program that has a Arete stack?
- Connect to a Stack — Add Arete to an existing project
- React SDK — Build a full React app against a deployed stack
- TypeScript SDK — Use Arete in Node.js, Vue, Svelte, or vanilla JS
- Rust SDK — Native Rust client
Have your own on-chain program and want to stream its data?
- Build Your Own Stack — Create a custom data stream for any Solana program
Want to understand what’s happening under the hood?
- How It Works — Stacks, Views, and how live data flows
Using an AI coding tool?
- Build with AI — Let your agent write Arete code with the right context