Stream · Handbook
The Stream handbook.
A practical guide to trying the current Stream implementation, reading a log, and understanding what its tools do.
Working implementation · Rust CLI and browser demo
Choose a path, then return to the reference as you work.
Explore in your browser Create a local logOrientation 01
Before you start
Stream records work as entries in an append-only log. The browser demo and Rust CLI use the current implementation; newer design proposals are being developed separately.
Use the browser demo to explore a prepared example. Use the CLI when you want to create and inspect a log directory yourself.
Browser 02
Try the browser demo
The Now and Act screens run the log engine in your browser and start with a prepared example.
From a checkout of the Stream repository, serve the web directory over HTTP, then open http://localhost:8000 in your browser. The repository includes the current WebAssembly build.
python3 -m http.server -d web 8000- Choose who you are recording as and inspect the running work.
- Use Act to preview an entry and whether it would be accepted.
- Try the simulated agent, then use Seal and Verify to inspect the log.
Command line 03
Create a log with the CLI
Build the stream command and initialize a separate directory for a local example.
From the root of a Stream checkout with a Rust toolchain installed, build the CLI and create a log. Choose a new directory; this example uses ./demo.
cargo build --release
S=target/release/stream
$S init ./demo --log demo --root actor:founder --tz UTC
$S view ./demo entriesThe initialized log begins with a genesis entry. The --root value names the starting authority for this example; it is a local identity in the log, not proof of a real-world identity.
Adopt the example packs from the checkout to add declarations, then inspect the Register:
$S adopt ./demo --as actor:founder packs/si-units@1.pack
$S adopt ./demo --as actor:founder packs/agent-ops@1.pack
$S view ./demo registerEquivalent commands were run against a fresh local log using the debug CLI at the recorded source revision.
Model 04
Read an entry
An entry combines a time, a verb and phase, an object, and a canonical JSON payload.
<time> [P:]VERB[phase] <object> <canonical JSON payload>- A profile is an optional uppercase letter before the verb.
- A phase mark identifies a begin (, end ), or sample *; no mark means an instant.
- The log records who submitted an entry, and a receipt reports whether the submission was accepted, duplicated or refused.
Use the entries view to inspect a log, or the register and gaps views to see declarations and missing recorder sequence numbers.
$S view ./demo entries
$S view ./demo register
$S view ./demo gapsEquivalent commands were run against a fresh local log using the debug CLI at the recorded source revision.
Operations 05
Views, seals and verification
Views derive answers from the log. A seal closes a segment, and verify checks the log's seals, chain and recorded closes.
$S view ./demo balances
$S view ./demo spans
$S seal ./demo
$S verify ./demoEquivalent commands were run against a fresh local log using the debug CLI at the recorded source revision.
A newly initialized example may have no balances or spans until suitable entries have been recorded. Verification checks the properties implemented by this version; it does not establish the truth of external claims.
Reference 06
Where to go next
Follow the source for current implementation details, or explore the design and experiments separately.
Based on Stream source revision 850c32c. Source links open the current repository files.