StreamingFast Substreams packages reference

Substreams packages overview

A Substreams package is a single file containing all necessary dependencies including:
  • Protobuf definitions as FileDescriptors
  • Compiled WASM code
  • Module DAG definition
Substreams packages are protobuf-serialized files. The standard extension for Substreams packages is .spkg.
Tip: Packages expedite the use of Substreams and allow developers to begin streaming immediately.

Packages as self-describing messages

Substreams packages conform to Buf images and the standard protobuf FileDescriptorSet message layout. They therefore can be used with multiple code generation tools as a replacement for raw .proto files. They implement a pattern called Self-describing Messages.

Creating packages

Packages are created by using the substreamspack command, passing the Substreams manifest file.
substreams pack ./substreams.yaml

Package dependencies

Developers can use modules and protobuf definitions from other Substreams packages when imports is defined in the manifest.
Important: To avoid potential naming collisions select unique .proto filenames and namespaces specifying fully qualified paths.
Local protobuf filenames take precedence over the imported package's proto files.