All packages
base-orderbook

base-orderbook

SC4RECOIN
v0.1.1/54 downloads/Repository

Package ref

base-orderbook@v0.1.1

Run package

CLI

Run map_evm_events from the command line.

substreams run base-orderbook@v0.1.1 map_evm_events -e base --start-block -1
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

Substreams

Substreams is an indexer for onchain events when subgraphs aren't available.

https://docs.substreams.dev

Deploy subgraph

Each chain has its own configuration file. See the justfile for deployment commands.

Example: Sepolia

  1. Copy an existing configuration file and rename it to substreams-sepolia.yaml
  2. Update the package name field in the config to name: sepolia-orderbook
  3. Update the starting block initialBlock: 10108380
  4. Update the parameter field to the appropriate chain id to map_evm_events: "11155111"
  5. Update the neywork field to network: sepolia
  6. Build and publish the spkg file with just build-and-publish-evm sepolia
  7. Deploy an indexing service using the docker image specified in the justfile
  8. Set PACKAGE env variable to sepolia-orderbook-v0.1.1.spkg
  9. Test with just debug-gui sepolia 10108380 (next 10 block should have events)

Modules

Execution graph

3 modules
Show 2 dependencies
map

ethcommon:all_events

`all_events` gives you all the events in a block (from successful transactions), with basic block hash/number/timestamp and transaction hash

Output

sf.substreams.ethereum.v1.Events

blockIndex

ethcommon:index_events

`index_events` sets the following keys on the block: * Event signatures evt_sig:0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef (signature in hex, prefixed by 0x) * Event address evt_addr:0x0123456789abcdef0123456789abcdef01234567 (address in hex, prefixed by 0x)

Output

sf.substreams.index.v1.Keys