surfpool start as a separate
process.
Both the Rust crate (surfpool-sdk) and the JS bindings (@solana/surfpool)
wrap the same runtime. The JS package ships pre-built native binaries through
napi-rs for macOS (Intel + Apple Silicon) and Linux x86-64, and also exposes a
Solana Kit plugin entry point.
Quickstart
Install the SDK, start a Surfnet, hit the RPC endpoint, then stop it. Parallel tests share the same process safely because ports are allocated dynamically.What’s In The Box
Installation
Cargo and npm setup, supported platforms, native binaries
Kit Plugin
Embedded or attached Surfnet in a Kit client, pre-funded payer, typed cheatcodes RPC
Configuration
Builder options: remote RPC fallback, block production, slot timing, feature gates, custom payers
Cheatcodes
Fund SOL/tokens, mutate accounts, reset upstream state, stream from mainnet
Time Travel
Jump to an absolute slot, epoch, or Unix timestamp
Programs
Anchor workspace auto-discovery, explicit .so + IDL deployment
Events
Drain runtime events for assertions and logging
Rust Reference
Complete surfpool-sdk crate API
JS Reference
Complete @solana/surfpool TypeScript API
How It Differs From surfpool start
The CLI runs a long-lived Surfnet you connect to from outside processes. The SDK
runs Surfnet inside your test, which means:
- No external port management — every
Surfnet::start()binds to a free port, so test suites can run in parallel without--portflags. - Synchronous teardown —
stop()returns when the runtime has actually released its ports. - Cheatcodes as typed methods — the same surface exposed over JSON-RPC by
surfpool startis available as native Rust methods and napi-rs bindings. - Direct event observation — runtime events are exposed through an in-process channel (Rust) or a drain method (JS) without a WebSocket subscription.
When To Use The SDK
Reach for the SDK when:- You’re writing integration tests for an Anchor program and want to assert on token balances after a sequence of cheatcoded setups.
- You need parallel test workers to each have an isolated Surfnet.
- You want to mainnet-fork specific accounts (
remoteRpcUrl+streamAccount) inside a test. - You need deterministic clocks by jumping the runtime to a fixed slot or timestamp before exercising vesting, lockup, or expiry logic.
When the CLI is the better fitUse
surfpool start instead when you want a Surfnet that survives across
multiple processes — for example, when a CLI, browser wallet, and custom
client scripts all need to share the same instance.