StreamingFast dbin Library
dbin
is a simple file storage format to pack a stream of protobuf
messages. It is part of StreamingFast.
Usage
See example usage in merger
First four magic bytes:
Next single byte:
- file format version, current is
0x01
Next 2 bytes are big-endian uint16, the length of the proto definition type, to follow:
Next bytes are the name of the proto def:
- "sf.ethereum.type.v1.Block"
Rest of the file, a sequence of:
- Length-prefixed messages, with each length specified as 4 bytes big-endian uint32.
- Followed by message of that length
EOF reached when no more bytes exist after the last message boundary.
Version 0 of the dbin
for mat was:
First four magic bytes:
Next single byte:
- file format version, was
0x00
.
Next 5 bytes were the content type, including 3 letters and 2 numbers.
Rest of the file, a sequence of:
- Length-prefixed messages, with each length specified as 4 bytes big-endian uint32.
- Followed by message of that length
EOF reached when no more bytes exist after the last message boundary.
Contributing
Issues and PR in this repo related strictly to the dbin library.
Report any protocol-specific issues in their
respective repositories
Please first refer to the general
StreamingFast contribution guide,
if you wish to contribute to this code base.
License
Apache 2.0