Skip to content

streamingfast/dbin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StreamingFast dbin Library

reference License

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

File format

Version 1

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.

Version 0

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.

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages