loom-sdk-documentation
loom-sdk-documentation copied to clipboard
Document querying our event store and setting up one
Document querying our event store and setting up one
Event Store allows users to query events emitted from contracts running on our chain.
The following is the config to enable Event Store
EventStore:
DBName: {{.EventStore.DBName}} // Set DB name (can be anything, default is events)
DBBackend: {{.EventStore.DBBackend}} // Set DB type 'goleveldb' or 'cleveldb'
{{end}}
EventDispatcher:
Dispatcher: {{.EventDispatcher.Dispatcher}} // Available dispatcher: "db_indexer" | "log" | "redis"
# Redis will be use when Dispatcher is "redis"
Redis:
URI: "{{.EventDispatcher.Redis.URI}}"// Redis URI
Config example
EventDispatcher:
Dispatcher: db_indexer
EventStore:
DBName: "event"
DBBackend: "goleveldb"
Now you can query emitted event fromBlock
to toBlock
https://plasma.dappchains.com/query/contractevents?fromBlock=5216332&toBlock=5216352
https://github.com/loomnetwork/loom-sdk-documentation/pull/214