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
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_streamand theirwrite_namedcounterparts, size-dispatched, withAsyncReadsources for streams (writing). Track-level control:write_track/write_named_track/write_rawfor callers choosing the path explicitly. - Reads:
read_bytes/read_intofor whole content into a buffer or anAsyncWritesink; track-levelreadandverifyfor commitment checks (reading). - Tape lifecycle:
reservewith theestimate_cost/reservation_cost/remaining_epochspricing 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_objectswith 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:
TapeKeyand 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
TapedriveErrortype every method returns, and the metrics trait for instrumentation.