wormhole-explorer/blockchain-watcher
Matías Martínez 00e5d6a6a2
Blockchain Watcher: ethereum -> sns implementation (#790)
* evm block repo implementation

* adding sns publisher

* adding external config and initial runner

* fix: start from latest if no fromBlock configured

* feat: add dryRun option

* fix: handler filtering and eth_getLogs filter payload

* local e2e

* actual sns arns for testnet

* smaller docker image

* deployment changes
2023-11-10 09:28:37 -03:00
..
config Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
docs Blockchain watcher: adding domain and infra layers (#786) 2023-11-07 15:25:06 -03:00
src Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
test Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
.dockerignore Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
.gitignore Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
.prettierrc.json Blockchain watcher: adding domain and infra layers (#786) 2023-11-07 15:25:06 -03:00
Dockerfile Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
README.md folder rename 2023-10-25 10:03:12 -04:00
TODO.md adding some new abstract types for processor redesign 2023-10-25 10:58:09 -04:00
jest.config.js Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
package-lock.json Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
package.json Blockchain Watcher: ethereum -> sns implementation (#790) 2023-11-10 09:28:37 -03:00
tsconfig.json folder rename 2023-10-25 10:03:12 -04:00

README.md

Explorer Event Watcher

The purpose of this process is to watch all Wormhole connected blockchains for events in Wormhole ecosystem contracts, and then produce database records for these events, and other important associated data.

For now, only EVM chains are supported, but this should be readily extensible in the future.

Installation

run npm ci in the root of the project run npm dev in the root of the project

Deployment

This process is meant to be deployed as a docker container. The dockerfile is located in the root of the project.

Configuration

Look at the provided example .env file for configuration options.

A brief explanation of the environment variables: RPCS : A json object of rpcs to connect to. The key is the wormhole chain ID, and the value is the rpc url. If an RPC is provided here, it is always used, regardless of the USE_DEFAULT_RPCS variable. ENVIRONMENT : DEVNET , TESTNET, or MAINNET these are Network objects from the wormhole SDK USE_DEFAULT_RPCS : if true, the RPCS according to the ENVIRONMENT will be used. If false, an exception is thrown if the RPCS environment variable is not set for a given chain. RPCS

Contract overrides take the form of : ETHEREUM_DEVNET_WORMHOLE_RELAYER_ADDRESS=0x53855d4b64E9A3CF59A84bc768adA716B5536BC5 BSC_DEVNET_WORMHOLE_RELAYER_ADDRESS=0x53855d4b64E9A3CF59A84bc768adA716B5536BC5

If the contract override is supplied, it will be used, otherwise the default contract addresses from the wormhole SDK will be used instead.

Usage & Modification

A Handler should be created and registered in the handlers directory for each event type that needs to be handled. Handlers are registered inside the src/index.ts file. These handlers are treated as listeners, and thus require 100% uptime to to ensure no events are missed.