Package Logo
injective_common
injective-common@v0.1.0
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
)
Documentation
Modules
Maps icon
Maps

map
all_transactions

cf4cab342e79c1c75c8c1d0bf0a3fc448b78fca5
map all_transactions (
blocksf.cosmos.type.v2.Block
)  -> sf.substreams.cosmos.v1.TransactionList
substreams gui injective-common@v0.1.0 all_transactions

map
all_events

6f0159be1dfac6c472ecb941b783a20c113bf46e
substreams gui injective-common@v0.1.0 all_events

map
filtered_events

f75dc6d73a9ea32779a2674dbfd4852c870bb24a
Default param : message

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.

substreams gui injective-common@v0.1.0 filtered_events
Block Indexes icon
Block Indexes

blockIndex
index_events

cd53325d4afee9862e29e2a55114d5bdb7dcc0ba

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

substreams gui injective-common@v0.1.0 index_events
Protobuf

Protobuf Docs Explorer

cosmos.tx.v1beta1
cosmos.distribution.v1beta1
gogoproto
injective.exchange.v1beta1
cosmos_proto
ibc.core.channel.v1
injective.oracle.v1beta1
cosmos.slashing.v1beta1
cosmos.authz.v1beta1
cosmos.upgrade.v1beta1
cosmos.tx.signing.v1beta1
cosmwasm.wasm.v1
injective.auction.v1beta1
cosmos.crypto.multisig.v1beta1
cosmos.gov.v1beta1
sf.cosmos.type.v2
cosmos.bank.v1beta1
injective.peggy.v1
cosmos.evidence.v1beta1
injective.crypto.v1beta1.ethsecp256k1
ibc.core.client.v1
cosmos.crisis.v1beta1
amino
cosmos.msg.v1
cosmos.base.v1beta1
injective.wasmx.v1