> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tape.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

This guide connects the Rust SDK to Tapenet, reserves a tape, writes a file, and reads
it back.

You'll need the [crate installed](https://docs.tape.network/sdks.md#installation) and a connection to
[Tapenet](https://docs.tape.network/tapenet.md). Current network details are on the
[networks page](https://docs.tape.network/protocol/architecture/networks.md).

**1. Fund a wallet**

Complete the [wallet and funding setup](https://docs.tape.network/tapenet/access.md) and use that wallet as the
payer in your SDK client. Local Tapedrive isn't released yet, so this guide runs
against Tapenet. Check the wallet's SOL and TAPE balances before writing:

```rust Rust theme={null}
let client = Tapedrive::new(rpc, payer);
let sol = client.sol_balance().await?;   // in lamports
let tape = client.tape_balance().await?; // missing accounts read as zero
```

**2. Set up a wallet and client**

Create or load the Solana keypair that signs everything and owns the tape, then build the client. The full client takes an RPC connection and your keypair as payer. If you only read, a gateway endpoint is enough. No keypair needed.

```rust Rust theme={null}
use tape_sdk::Tapedrive;

let payer = read_keypair_file("~/.config/solana/id.json")?;
let client = Tapedrive::new(rpc, payer);                          // full client
let reader = Tapedrive::new_gateway_read_only(rpc, GATEWAY_URL)?; // gateway reads, no keypair
```

**3. Reserve a tape**

The one payment step. Create the tape's key (or derive its address from your wallet), price the reservation, then reserve capacity for a duration. What you get back is a tape controlled by that key, with room for the uploads that follow.

The tape key *is* the tape: store it like you store the data ([why](https://docs.tape.network/protocol/architecture/tapes.md)).

```rust Rust theme={null}
let tape = TapeKey::generate();
let cost = client.estimate_cost(capacity, epochs).await?;
client.reserve(&tape, capacity, epochs).await?;
println!("tape: {}", tape.address());
```

**4. Write**

One call writes a file. The SDK picks the path by size: small data rides inside the transaction, larger data is erasure-coded, and very large data streams in segments ([how the paths work](https://docs.tape.network/sdks/writing.md)). This example uses a file big enough to take the erasure-coded path.

The write certifies the track before it returns. Certification is the network's proof that your data is held: a quorum of the storage nodes that received your slices signs, and that aggregate signature lands on-chain ([what certification promises](https://docs.tape.network/protocol/architecture/tracks.md)).

The receipt carries the manifest address, which the last step reads back.

```rust Rust theme={null}
let data = std::fs::read("photo.jpg")?;
let receipt = client.write_bytes(&tape, &data).await?;
println!("manifest track: {}", receipt.manifest);
```

**5. Read it back**

Two ways to get your bytes: through the SDK by track address, or from any gateway over plain HTTP. The address is the same in both.

```rust Rust theme={null}
let bytes = client.read_bytes(&receipt.manifest).await?;
assert_eq!(bytes.len(), data.len());
```

```bash Gateway URL theme={null}
curl "$TAPE_GATEWAY/object/<track-address>" -o photo.jpg
```

## Where to go next

You've connected, reserved, written, and read back. From here:
[reading](https://docs.tape.network/sdks/reading.md) and [writing](https://docs.tape.network/sdks/writing.md) for everything those flows can do,
[objects](https://docs.tape.network/sdks/objects.md) for the S3-style layer, and
[docs.rs](https://docs.rs/tape-sdk) for every method.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.