Package Logo
injective_common
injective-common@v0.1.1
Total Downloads
3212
Published
6 months ago
Publisher
User Avatar streamingfast

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.

filtered_trx_by_events

The filtered_trx_by_events modules allows a reduction of the all_transactions output, only matching the events that match the requested type. The module will return the entire transactions. Some event types will appear that do not match from the filtered params as the entire transaction is returned.

Use with the parameter, ex:

substreams run [...] -p filtered_trx_by_events="message || injective.peggy.v1.EventDepositClaim"

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

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

map
all_events

7201748489b29bd31cb8ab4906f62dc044683d08
substreams gui injective-common@v0.1.1 all_events

map
filtered_events

227d119ad00430c404533ab67a6fce5c9eef988d
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.1 filtered_events

map
filtered_trx_by_events

a695f4c7b55158f007939b7e94795a83160ee073
Default param : message

filtered_trx_by_events reads from all_events and all_transactions and applies a filter on the event types, only outputing the transactions 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.1 filtered_trx_by_events
Block Indexes icon
Block Indexes

blockIndex
index_events

cdcaab605d8f865bb7c8e44dac104a1461759308

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.1 index_events
Protobuf

Protobuf Docs Explorer

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