Events are objects that contain information about the execution of the application. They are mainly used by service providers like block explorers and wallets to track the execution of various messages and index transactions.
Transactions are objects created by end-users to trigger state changes in the application.
subgraph.yaml) identifies the data sources for the subgraph, the triggers of interest, and the functions (
handlers) that should be run in response to those triggers. See below for an example subgraph manifest for a Cosmos subgraph:
kindof data source (
networkshould correspond to a network on the hosting Graph Node. In the example, the CosmosHub mainnet is used.
blockHandlers: run on every new block appended to the chain. The handler will receive a full block and all its data containing, among other things, all the events and transactions.
eventHandlers: run on every event contained in a block that matches the event type specified in the manifest. Block data is also passed onto the mapping in order to have the context of the event within the chain.
transactionHandlers: run for every transaction executed. The mapping is provided with all the relevant data related to the transaction and a block abstraction that can be used to acquire the context of the transaction within a block and within the chain.
Blockis passed to the blockHandler.
EventDatais passed to the eventHandler.
schema.graphql). This will allow the mapping functions to create new objects of those types and save them to the store. This is done by using the
graph deployCLI command after running the
graph createCLI command:
cosmoshub-4. Cosmos Hub current testnet is
theta-testnet-001. Other Cosmos Hub networks, i.e.
cosmoshub-3, are halted, therefore no data is provided for them.
Osmosis support in Graph Node and on the Hosted Service is in beta: please contact the graph team with any questions about building Osmosis subgraphs!
osmosis-1. Osmosis current testnet is