stores, and/or from the blockchain's data source in the form of a Block or a Clock).
transfer_mapmodule could extract all transfers in each Block, and
storemodule - could keep track of how many transfers occurred.
storewhich keeps track of multiple counters.
Blockprotobuf model, and is deterministic in its execution.
mapmodule, and a
storemodule is different from a
mapin that it is a stateful module. It holds and builds a simple and fast key/value store.
kind: storemodule's code is able to write to the key/value store, but in order to ensure parallelization is always possible and deterministic, it cannot read any of its values.
valueType, instructs the Substreams runtime of the data that will be stored in the stores:
updatePolicy,determines what methods are available in the runtime, as well as the merging strategy for identical keys found in two contiguous stores produced by parallel processing:
ordin different methods of the store APIs.
storeas an input to a module, you can consume its data in one of two modes:
get- provides your module with the key/value store guaranteed to be in sync up to the block being processed, readily queried by methods such as
get_first(see the modules API docs) from your module's Rust code. Lookups are local, in-memory, and very fast.
deltas- provides your module with all the changes that occurred in the source
storemodule. See the protobuf model here. You are then free to pick up on updates, creates, and deletes of the different keys that were mutated during that block.