dbin
is a simple file storage format to pack a stream of protobuf
messages. It is part of StreamingFast.
See example usage in merger
First four magic bytes:
- 'd', 'b', 'i', 'n'
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:
- like 0x002d for "type.googleapis.com/sf.ethereum.type.v2.Block"
Next bytes are the name of the proto definition with a length defined above:
- "type.googleapis.com/sf.ethereum.type.v2.Block"
Rest of the file, is a sequence of:
- Length-prefixed messages, with each length specified as 4 bytes big-endian uint32.
- Followed by message of that length, then start over.
- EOF reached when no more bytes exist after the last message boundary.
First four magic bytes:
- 'd', 'b', 'i', 'n'
Next single byte:
- file format version, current is
0x00
Next three bytes:
- content type, like 'ETH', 'EOS', or whatever..
Next two bytes:
- 10-based string representation of content version: '00' for version 0, '99', for version 99
Rest of the file, is a sequence of:
- Length-prefixed messages, with each length specified as 4 bytes big-endian uint32.
- Followed by message of that length, then start over.
- EOF reached when no more bytes exist after the last message boundary.
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.