Getting started
Install
cargo install swarm-scout swarm-stash swarm-perch swarm-keep
# binaries: scout, stash, perch, keep
Reading needs nothing
Reads default to the public Swarm gateway, so this works immediately:
scout cat <reference> # print content
scout get <reference> out.bin # download to a file
Override the read endpoint with --gateway / $BEE_GATEWAY to use your
own node or a private gateway.
Writing needs a node + a postage batch
Uploading (and feeds, sharing, stash push, perch deploy, keep set)
requires a Bee node that holds a postage batch. Two pieces:
- A node. Run Bee
locally (defaults to
http://localhost:1633) or use a hosted one. Point the tools at it with--node/$BEE_NODE. - A postage batch. Buy one on the node — it prepays storage:
On a fresh testnet node a usable batch needscurl -s -XPOST "$BEE_NODE/stamps/<amount>/<depth>" # returns a batchIDamountabove the chain's current total and takes a couple of minutes to become usable. Pass the batch id with--stamp/$BEE_STAMP.
export BEE_NODE=http://localhost:1633
export BEE_STAMP=<batchID>
scout up notes.md # -> a reference
perch deploy ./site # -> a website URL
Environment variables
| Var | Used by | Meaning |
|---|---|---|
BEE_GATEWAY | all (reads) | read endpoint (default: public gateway) |
BEE_NODE | all (writes) | your Bee node for uploads (default: localhost:1633) |
BEE_STAMP | all (writes) | postage batch id |
Concepts in 30 seconds
- Reference — a content address (hex). Immutable: same bytes → same ref.
- Feed — a mutable pointer you own; the handle stays put while the content it serves changes. Powers stash/perch/keep's "latest version."
- Postage batch — prepaid storage; required to upload.
- ACT — Access Control Trie: encrypt content and grant/revoke specific
recipients (used by
scout share).