StreamingFast Substreams packages reference

Working with Substreams Packages

A Substreams package is a single file containing all dependencies, protobuf definitions (as FileDescriptors), compiled WASM code, and the module's DAG definition.
Substreams packages are protobuf-serialized files. The standard extension for Substreams packages is .spkg.
Tip: Packages simplify the process of working with Substreams and allow developers to begin streaming immediately!
Note: Substreams packages conform to Buf images and the standard protobuf FileDescriptorSet. This enables Substreams packages to be used with multiple code generation tools as a source for schema definitions.

Creating Packages

Packages are created using the substreams pack 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 using fully qualified paths.
Note: Local protobuf filenames take precedence over the imported package's proto files.
Additional package examples are available in the Substreams Playground.