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

The default LMDB map ceiling is 64 GiB. This reserves virtual address space; disk space is used as index data is written.

flags

--zakura-config FILEZakura TOML. Zakura defaults and ZAKURA_* apply when omitted.
--index-dir DIRLMDB index. ztreamer-index
--index-map-size BYTESLMDB map ceiling. 68719476736
--grpc-listen ADDRCompactTxStreamer. 127.0.0.1:9067
--tls-cert FILEPEM certificate chain for gRPC TLS. Requires --tls-key.
--tls-key FILEPEM private key for gRPC TLS. Requires --tls-cert.
--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. Fetch workers can have at most --max-pending-bytes minus the larger of this value and 2 MB in flight, plus the one block the index needs next. 16 MiB
--ping-very-insecureAnswer Ping. Testing only.
--index-onlyBuild the index and exit.

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

protocol

All CompactTxStreamer methods are implemented. GetBlock intentionally omits transparent data, and Ping is opt-in.

PingDisabled unless --ping-very-insecure is set. It is a denial-of-service vector.
GetBlockReturns shielded compact data; transparent transaction data is intentionally omitted.

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.