A minimal Rust example of interacting with the backtest API using only standard external crates.
List the available slot ranges.
curl https://staging.simulator.termina.technology/available-ranges | jqRun a baseline simulation.
export SIMULATOR_API_KEY=your-key
cargo run -- \
--url staging.example.com \
--start-slot 123 \
--end-slot 456Run a simulation while replacing and streaming logs for a program.
export SIMULATOR_API_KEY=your-key
cargo run -- \
--url staging.simulator.termina.technology \
--start-slot 123 \
--end-slot 456 \
--program-id addr1234 \
--program-so path/to/program/bytecode
--log-file test.txt- Connect to the backtest WebSocket endpoint
- Create a session over a range of historical Solana slots (if the requested range isn't in the cache, it'll take ~90s to fetch and prepare)
- Query the simulated chain state via HTTP JSON-RPC (
getSlot,getLatestBlockhash,getAccountInfo) - Advance through each block one at a time
- Close the session
The API key can also be supplied via the SIMULATOR_API_KEY environment variable:
HTTP JSON-RPC calls are standard Solana RPC format, posted to the rpcEndpoint from the SessionCreated response. This endpoint is unauthenticated.