For the complete documentation index, see llms.txt. This page is also available as Markdown.

Basic Setup

Complete provider setup with connection verification

This example demonstrates how to create Seismic providers in both signed and unsigned variants, verify the connection, and query basic chain state.

Prerequisites

# Install Rust 1.82+
rustup update stable

# Set environment variables
export PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
export RPC_URL="https://testnet-1.seismictest.net/rpc"

Cargo.toml — see Installation for the full template including the required [patch.crates-io] block:

[package]
name = "basic-setup"
version = "0.1.0"
edition = "2021"
rust-version = "1.82"

[dependencies]
seismic-prelude        = { git = "https://github.com/SeismicSystems/seismic-alloy" }
seismic-alloy-network  = { git = "https://github.com/SeismicSystems/seismic-alloy" }
seismic-alloy-provider = { git = "https://github.com/SeismicSystems/seismic-alloy" }
alloy-provider         = "1.1"
alloy-signer-local     = "1.1"
alloy-primitives       = "1.1"
tokio                  = { version = "1", features = ["full"] }
reqwest                = "0.12"

# [patch.crates-io] block required — see Installation.

Signed Provider (Full Capabilities)

A signed provider can send shielded writes, perform signed reads, and execute all standard Alloy provider operations.

Unsigned Provider (Read-Only)

An unsigned provider does not require a private key. It can query chain state, read public data, and subscribe to events (via WebSocket), but cannot send transactions or perform signed reads.

Network Selection

The builder defaults to SeismicReth (production). Use .foundry() for local development:

Local Development with Sanvil

For local testing using Sanvil (Seismic Anvil):

Anvil::at("sanvil") requires sanvil to be installed and available on your PATH. See the Seismic Foundry documentation for installation instructions.

Error Handling

Expected Output

Next Steps

See Also

Last updated