-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsieve.example.toml
More file actions
95 lines (80 loc) · 3.77 KB
/
Copy pathsieve.example.toml
File metadata and controls
95 lines (80 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# sieve.example.toml — example config for indexing USDC events
#
# Sensitive URLs are read from .env (not from this file):
# DATABASE_URL — PostgreSQL connection string
# WEBHOOK_URL — webhook endpoint (required if [[streams]] type = "webhook")
# RABBITMQ_URL — RabbitMQ connection string (required if [[streams]] type = "rabbitmq")
# Which chain to index: "mainnet" (default), "base", "optimism", "unichain", or "world".
# A database is bound to its chain on first run; use a separate database
# (or `sieve reset`) when switching chains.
# chain = "mainnet"
[api]
port = 4000 # omit [api] section to disable GraphQL
# [p2p]
# port = 30303 # default; change to run multiple instances
# Pin peers that are always dialed and kept connected (e.g. an archive
# node for deep backfills — most Base full nodes only serve ~31 days of
# receipts):
# trusted_peers = ["enode://<pubkey>@<ip>:<port>"]
[[contracts]]
name = "USDC"
address = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
abi = "abis/erc20.json"
start_block = 21_000_000
# include_receipts = true # adds gas_used, nonce, cumulative_gas_used, tx_status columns
[[contracts.events]]
name = "Transfer"
table = "usdc_transfers"
context = ["block_timestamp", "tx_from"]
columns = [
{ param = "from", name = "from_address", type = "text" },
{ param = "to", name = "to_address", type = "text" },
{ param = "value", name = "value", type = "numeric" },
]
[[contracts.events]]
name = "Approval"
table = "usdc_approvals"
# columns omitted → auto-generated from ABI params with default type mapping
# Optional indexed parameter filters — only index approvals for a specific spender
# [contracts.events.filter]
# spender = ["0x3fC91A3afd70395Cd496C647d5a6CC9D4B2b7FAD"] # Uniswap Universal Router
# ── Function call indexing ──────────────────────────────────────────
# Uncomment to index top-level function calls by decoding tx.input calldata.
# Only successful (non-reverted) calls are stored. Internal calls are not captured.
#
# [[contracts.calls]]
# name = "transfer"
# table = "usdc_transfer_calls"
# context = ["block_timestamp", "tx_from"]
# columns = [
# { param = "to", name = "to_address", type = "text" },
# { param = "value", name = "value", type = "numeric" },
# ]
# ── Native ETH transfer indexing ─────────────────────────────────────
[[transfers]]
name = "eth_transfers"
table = "eth_transfers"
start_block = 21_000_000
context = ["block_timestamp", "tx_gas_price"]
# Optional address filters (omit for all transfers)
[transfers.filter]
from = ["0x28C6c06298d514Db089934071355E5743bf21d60"] # Binance hot wallet
# to = ["0x..."] # filter by recipient
# ── Webhook notifications ──────────────────────────────────────────────
# Fires a JSON POST after each block is committed to the database.
# Payload: { block_number, block_timestamp, tables: [{ name, event, count }] }
# Set WEBHOOK_URL in .env to configure the endpoint.
# [[streams]]
# name = "my_webhook"
# type = "webhook"
# backfill = false # skip during historical sync
# ── RabbitMQ streaming ────────────────────────────────────────────────
# Publishes each decoded event as a JSON message to an AMQP exchange.
# Routing key supports {table} and {event} placeholders.
# Set RABBITMQ_URL in .env to configure the connection.
# [[streams]]
# name = "rabbitmq_events"
# type = "rabbitmq"
# exchange = "sieve_events"
# routing_key = "{table}.{event}" # optional, this is the default
# backfill = false