Skip to main content
tape-sdk is the native Rust SDK and the reference implementation. It lives in the core repository beside the programs and the node, on purpose: it is what the network’s own end-to-end tests drive.

Who this is for

  • Rust services and backends.
  • Authors of tooling around the node or the programs.
  • Anyone who wants the reference implementation: everything documented anywhere in this section exists here first.

Installation

The crate is on crates.io. For unreleased changes, depend on https://github.com/spool-labs/tape with a git dependency and pin a rev.

The client

Tapedrive::new(rpc, payer) gives you the full client: reads, writes, and lifecycle operations. new_read_only(rpc) is for consumers. from_parts is for callers assembling their own backends. Configuration is builder-style (with_payer, with_metrics), and the accessors (rpc(), the cached protocol state(), payer()) expose what the client holds. The client is generic over its RPC backend and API transport. The same code runs against Solana in production and against in-memory backends in tests, which is how the node’s multi-node simulations drive it (built to be tested).

The modules

A tour by module. Per-method contracts live on docs.rs.
  • Writes: write / write_bytes / write_stream and their write_named counterparts, size-dispatched, with AsyncRead sources for streams (writing). Track-level control: write_track / write_named_track / write_raw for callers choosing the path explicitly.
  • Reads: read_bytes / read_into for whole content into a buffer or an AsyncWrite sink; track-level read and verify for commitment checks (reading).
  • Tape lifecycle: reserve with the estimate_cost / reservation_cost / remaining_epochs pricing helpers; get_tape; extend_expiry / extend_capacity (permissionless); set_tape_delegate / revoke_tape_delegate (tapes).
  • Tracks: get_track, get_track_by_number, find_track, list_tracks_by_tape, get_track_proof, delete (tracks).
  • Objects: put_object, get_object / get_object_into, head_object, list_objects with the query builder (prefix, delimiter, cursor, limit), delete_object (objects).
  • Gateway: the gateway-backed client for read-side consumers, constructed read-only against a gateway endpoint and exposing the same read methods (gateway API).
  • Stream: the segment and manifest machinery under stream writes: manifest types, receipts, stream readers (streams).
  • Staking: node and delegation staking operations (token economics).
  • Keys: TapeKey and stake-key types with generation, persistence, and address derivation.
  • Codec, transfer, error, metrics: on-chain state codecs, the slice upload/download and certify machinery behind writes, the TapedriveError type every method returns, and the metrics trait for instrumentation.

Certified writes

The crate performs the full certified-write orchestration itself: registration, slice distribution, BLS signature collection, certification. The staged pipeline walks those stages one by one, and the rule they enforce is on the tracks page: a coded write is finished when certified.