Skip to content

Query past block event using LCD's txs endpoint instead of fetching block from RPC to speed up indexing. #40

@y-pakorn

Description

@y-pakorn

By using /txs endpoint on LCD we can directly query transaction that has specific event without need to query every past block from RPC.

- handler: handleEvent
  kind: cosmos/EventHandler
  filter:
    type: execute
    messageFilter:
      type: "/cosmwasm.wasm.v1.MsgExecuteContract"
      contractCall:
        contract: "juno1v99ehkuetkpf0yxdry8ce92yeqaeaa7lyxr2aagkesrw67wcsn8qxpxay0"

Filter above with start block at 3062001 can be translated to
lcd.endpoint/cosmos/tx/v1beta1/txs?events=message.action=/cosmwasm.wasm.v1.MsgExecuteContract&events=execute._contract_address=juno1v99ehkuetkpf0yxdry8ce92yeqaeaa7lyxr2aagkesrw67wcsn8qxpxay0&events=tx.height>=3062001

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions