https://github.com/lit-protocol/event-listener-test
https://github.com/lit-protocol/event-listener-test
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lit-protocol/event-listener-test
- Owner: LIT-Protocol
- Created: 2025-01-07T22:27:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-07T22:59:33.000Z (over 1 year ago)
- Last Synced: 2025-02-04T12:04:12.142Z (over 1 year ago)
- Language: TypeScript
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Event listener PoC / test
This is a proof of concept for an event listener using Rust and ethers.
It is a simple contract that emits events, and a Rust program that listens for those events.
The Rust program is a simple polling program that queries the contract for events in blocks.
The TypeScript program is a simple script that emits 100 events to the contract.
## Usage
To run the tests, make sure you have a Yellowstone private key in the `LIT_ROLLUP_MAINNET_DEPLOYER_PRIVATE_KEY` environment variable. The emitter contract is already deployed, but if you want to isolate the test to ensure nobody else is emitting events, you can deploy it yourself with the `scripts/deploy.ts.ts` script. Note that the contract address is hardcoded in a bunch of places so you'll need to change that as well.
To run the test where we emit 100 events and check that we received all of the in rust, run `./test.sh`. in the `rust-ethers` directory.