ztreamer

docs

install

Needs protoc on the path.

$ cargo install --git https://github.com/distractedm1nd/ztreamer ztreamerd

run

One process. Zakura boots inside it, syncs to the tip, then the index builds and the servers open.

$ ztreamerd --zakura-config zakura.toml --index-map-size 68719476736

The map size is a virtual reservation, not disk. Mainnet needs more than the 16 GiB default.

flags

--zakura-config FILEZakura TOML. Zakura defaults and ZAKURA_* apply when omitted.
--index-dir DIRLMDB index. ztreamer-index
--index-map-size BYTESLMDB map ceiling. 17179869184
--grpc-listen ADDRCompactTxStreamer. 127.0.0.1:9067
--metrics-listen ADDRPrometheus. 127.0.0.1:9999
--fetch-workers NHistorical fetch workers. min(cores, 8)
--source-segment-blocks NConsecutive blocks per fetch worker. 256
--max-pending-bytes NBytes awaiting ordered ingestion. 256 MiB
--max-batch-bytes NIndex write batch. 16 MiB
--index-onlyBuild the index and exit.

Logging is RUST_LOG, default info. Ctrl-C shuts down in order: index writer, then Zakura.

protocol

Every CompactTxStreamer method, with three exceptions.

GetMempoolTxUnimplemented.
GetBlockNo transparent data. No wallet reads it.
GetBlockRangeRejects transparent filters. Range scans of transparent data cost more bandwidth than they are worth.

Zaino direct-mode JSON-RPC parity, 24 of 27. Missing: getblockdeltas, getspentinfo, gettxoutsetinfo.

p2p

The same service over Zakura's peer protocol, so a light wallet can sync from any Zakura peer running ztreamer. No server, no TLS, no DNS.

servicezakura.ztreamer.v1
capability bit1 << 17
streamkind 65, version 1, ordered
message limit4 MiB, framed with a MORE flag

Messages are the gRPC request and response types, protobuf-encoded, one per frame sequence.

reorgs

The head follower reconciles the index against Zakura's canonical chain on every advance. A reorg deeper than Zakura's non-finalized window triggers a full recovery pass. Both paths are under test.