substreams.yaml
, defines the modules composing the Substreams. The manifest is used, among other things, to define the dependencies between your module's inputs and outputs.specVersion
v0.1.0
- no questions asked.package
package.name
substreams pack substreams.yaml
your package.name
must match this regular expression: ^([a-zA-Z][a-zA-Z0-9_]{0,63})$
, meaning:_
a-z
or A-Z
and can contain numbers thereafterpackage.version
package.url
package.doc
imports
imports
section imports modules with their WASM code, all of their (compiled) protobuf definitions and modules definition. The imported modules can be referred to by the key later in the modules
section..yaml
), or a Package (ending in .spkg
)..yaml
file), or remote path as long as it starts with http://
or https://
.Protobuf
Protobuf
section points to the protobuf definitions used by these modules.importPaths
.
Note that the imports
section will also affect which .proto
files end up in your package.binaries
modules[].binary
has a default value of default
. Therefore, make sure to define the default
binary here.modules
section (see below), and define other binaries by their name (like other
in the example above).binaries[name].type
wasm/rust-v1
binaries[name].file
.yaml
file's directory..spkg
when invoking substreams pack
, as well as any substreams run
.modules
modules[].name
[a-zA-Z0-9_]
. These are the same rules as for package.name
.inputs
. Each package should have a unique name.name
also corresponds to the Rust function name that will be invoked on the compiled WASM code upon execution. This is the same function you will define #[substreams::handlers::map]
(orstore
) in your Rust code.modules[].initialBlock
initialBlock
field can be elided and its value will be inferred by its dependent inputs
, as long as all the inputs have the same initialBlock
. If some inputs have different initialBlock
, then it becomes mandatory.modules[].kind
module
. There are two types of modules:map
store
modules[].updatePolicy
kind: store
.set
(last key wins merge strategy)set_if_not_exists
(first key wins merge strategy)append
(concatenates two keys' values)add
(sum the two keys' values)min
(min between two keys' values)max
(max between two keys' values)modules[].valueType
kind: store
.store
, and determines the WASM imports available to the module to write to the store. See API Reference for details.bigfloat
bigint
int64
bytes
string
proto:some.path.to.protobuf.Model
modules[].binary
modules[].inputs
inputs
is a list of input structures. For each object, one of three keys is required:source
store
(can also define a mode
key)map
modules[].output
kind: map
type
will always be prefixed by proto:
followed by a definition you have specified in protobuf definitions, and referenced in the protobuf
section.