All packages
injective_common

injective_common

streamingfast
This is not the latest version — go to v0.3.0
v0.1.0/352 downloads

Package ref

injective-common@v0.1.0

Run package

CLI

Run all_transactions from the command line.

substreams run injective-common@v0.1.0 all_transactions -e cosmos --start-block -1
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

Injective Foundational Modules

The Injective Foundational modules are Substreams modules extracting common data from the Injective blockchain.

Modules

all_events

The all_events module extracts only the events and provides them, along with the transaction hash and block at which it they are found.

filtered_events

The filtered_events module allows a reduction of the all_events output, only matching the events that match the requested type.

Use with the parameter, ex: `substreams run [...] -p filtered_events="message || injective.peggy.v1.EventDepositClaim"

all_transactions (work in progress)

The all_transactions module extracts all the transactions from the Injective blockchain, providing useful information, such as messages, signatures or events.

Some message types are parsed from their "Any" type into the the corresponding type of an enum. See ./proto/cosmos/v1/transactions.proto to see the ones that are supported. The other types will still be shown as protobuf "Any" type.

Getting Started

Gather protobuf definitions in generated-buf-build.binpb

The required protobuf modules are referenced in buf.yaml. You need a (free) API token to access https://buf.build and resolve the dependencies into a single file, generated-buf-build.binpb. That file is then used to generate the rust protobuf bindings or to bundle the definitions in the .spkg. (it is referenced in the substreams.yaml)

Generate rust protobuf bindings

make protogen

Build Substreams modules

make build

Run Substreams

You will need an API key to access the streamingfast servers, see https://substreams.streamingfast.io

This example query only fetches the events of type 'injective.peggy.v1.EventDepositClaim'

substreams run -e mainnet.injective.streamingfast.io:443 substreams.yaml filtered_events -p filtered_events='injective.peggy.v1.EventDepositClaim' -s 9600 -t 9700

Package as .spkg

make package

Modules

Execution graph

4 modules
map

filtered_events

`filtered_events` reads from `all_events` and applies a filter on the event types, only outputing the events that match the filter. The only operator that you should need to use this filter is the logical or `||`, because each event can only match one type.

Output

sf.substreams.cosmos.v1.EventList

Inputs

blockIndex

index_events

`index_events` sets the keys corresponding to every event 'type' ex: `coin_received`, `message` or `injective.peggy.v1.EventDepositClaim`

Output

sf.substreams.index.v1.Keys