Tenzro
Tutorial — Network markets

Store data on Tenzro

Put an object on the network with erasure-coded redundancy, open a streaming deal for it, and settle each epoch against a retrievability challenge. Storage rides the same prepaid balance and the same stake as compute rental, and TNZO moves one byte-epoch slice at a time.
Level
Intermediate
Time
~20 min
Prerequisites
tenzro-node with spare disk; a funded TNZO account
Stack
CLI
01

Store an object with redundancy

The object is erasure-coded into data and parity shards and published on the iroh data plane, keyed by content address. Redundancy means the loss of one provider does not lose the data — the defaults keep 4 data shards and 2 parity shards.

tenzro node storage store \
  --object-id my-dataset-v0 \
  --owner 0xYOUR_ADDRESS \
  --file ./dataset.bin \
  --data-shards 4 --parity-shards 2
02

Fund a prepaid balance

Per-byte-epoch charges draw from the same prepaid TNZO ledger that compute rental uses. Fund it once with a real on-chain debit; each epoch streams a slice out of it, or refunds on a miss. The balance survives a node restart.

tenzro escrow prepaid-deposit \
  --renter 0xYOUR_ADDRESS \
  --amount 3000000000000000000
03

Open a streaming deal

The per-epoch price is a function of object size and the provider's rate_per_byte_epoch, times the term. Opening fails if the provider's stake cannot cover the new obligation on top of everything else it owes — compute rentals included. Keep the returned deal_id.

tenzro node storage open-deal \
  --rpc https://PROVIDER_RPC \
  --object-id my-dataset-v0 \
  --renter 0xYOUR_ADDRESS \
  --size-bytes 1073741824 \
  --total-epochs 48
04

Charge an epoch against a retrievability proof

Each epoch the provider answers a challenge that samples a subset of the object's shards and returns a digest keyed to a per-challenge nonce — a stale or fabricated answer does not pass. The outcome is one of three: Charged (challenge passed; one byte-epoch slice moved), Missed(no value moved), or Closed (term reached or coverage lost).

tenzro node storage charge-epoch \
  --rpc https://PROVIDER_RPC \
  --deal-id <deal-id>
05

Inspect the deal, then reclaim unspent funds

Check the deal state at any time. When the term ends, withdraw whatever the provider did not earn back to your on-chain account.

tenzro node storage deal --rpc https://PROVIDER_RPC --deal-id <deal-id>
tenzro escrow prepaid-balance --renter 0xYOUR_ADDRESS
tenzro escrow prepaid-withdraw --renter 0xYOUR_ADDRESS --amount <remaining-wei>
Related
← All tutorials