Skip to content
The Surfpool SDK is published as two artifacts that wrap the same Rust runtime:
LanguagePackageWhere it runs
Rustsurfpool-sdk on crates.ioInside any multi-threaded #[tokio::test] or async runtime
TypeScript / JavaScript@solana/surfpool on npmNode.js 18+ via napi-rs native bindings

​Rust

Add the crate as a dev-dependency. The SDK is async-first and expects a Tokio runtime, so include tokio with the full feature for tests.
Cargo.toml
The crate re-exports the Solana types you need most often, so a single use surfpool_sdk::{...} is usually enough:
If you need a type that isn’t re-exported, depend on the underlying Solana crate directly — the SDK does not pin you to any specific version of solana-program or solana-client.

​TypeScript / JavaScript

Install it as a dev dependency:
To use Surfpool as a Solana Kit plugin, install the Kit packages too — they are optional peer dependencies:
@solana/surfpool 1.7.0 declares a @solana/kit ^8 peer dependency. Kit 8 requires Node.js 20.18 or newer, above this package’s own floor. The package exports a single Surfnet class plus supporting types:

​Supported Platforms

The JS package depends on platform-specific native modules that are installed automatically as optionalDependencies:
PlatformTarget triplenpm package
macOS Apple Siliconaarch64-apple-darwin@solana/surfpool-darwin-arm64
macOS Intelx86_64-apple-darwin@solana/surfpool-darwin-x64
Linux x86-64 (glibc)x86_64-unknown-linux-gnu@solana/surfpool-linux-x64-gnu
Unsupported platformIf the package is installed on a platform without a matching binary, the install completes but Surfnet.start() will throw at runtime. Open an issue if you need an additional target.

​Requirements

  • Node.js 18 or newer. The SDK uses Uint8Array, native fetch, and assert/strict from node:test.
  • A writable temp directory. Each Surfnet instance allocates ports and may write transient data to the OS temp directory.

​Verifying The Install

A one-line smoke test confirms the runtime starts and the RPC endpoint accepts requests.
Rust
Run with cargo test --test smoke.

​Troubleshooting

`failed to bind to port` on RustAnother process is binding 0.0.0.0 aggressively. Re-run the test — the SDK picks a new port on each call. If the failure persists, check for orphaned surfpool processes.
`Cannot find module ‘@solana/surfpool-…’`The optionalDependencies entry for your platform did not install. Re-run install with --include=optional, or check that your platform appears in the supported table above.
`stop()` hangs in JSConfirm you’re calling stop() once per start(). The Node wrapper keeps RPC and WebSocket servers bound until stop() returns.