{"id":31767828,"url":"https://github.com/openzeppelin/event-scanner","last_synced_at":"2026-03-09T17:30:19.326Z","repository":{"id":316721636,"uuid":"1052595320","full_name":"OpenZeppelin/Event-Scanner","owner":"OpenZeppelin","description":"A lightweight highly performant event scanner built in rust","archived":false,"fork":false,"pushed_at":"2025-10-03T10:29:52.000Z","size":389,"stargazers_count":4,"open_issues_count":31,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-03T11:39:44.807Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenZeppelin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-08T09:22:07.000Z","updated_at":"2025-10-03T07:51:29.000Z","dependencies_parsed_at":"2025-10-03T11:30:33.434Z","dependency_job_id":null,"html_url":"https://github.com/OpenZeppelin/Event-Scanner","commit_stats":null,"previous_names":["openzeppelin/event-scanner"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/OpenZeppelin/Event-Scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2FEvent-Scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2FEvent-Scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2FEvent-Scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2FEvent-Scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenZeppelin","download_url":"https://codeload.github.com/OpenZeppelin/Event-Scanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2FEvent-Scanner/sbom","scorecard":{"id":1238443,"data":{"date":"2025-10-03T07:51:47Z","repo":{"name":"github.com/OpenZeppelin/Event-Scanner","commit":"61a8e6fe866dbf9aeddc4d0682339c822faf293a"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":8,"checks":[{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"project was created within the last 90 days. Please review its contents carefully","details":["Warn: Repository was created within the last 90 days."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Warn: jobLevel 'actions' permission set to 'write': .github/workflows/cla.yml:15","Warn: jobLevel 'statuses' permission set to 'write': .github/workflows/cla.yml:17","Info: topLevel 'contents' permission set to 'read': .github/workflows/check.yml:9","Info: topLevel 'contents' permission set to 'read': .github/workflows/cla.yml:9","Info: topLevel 'contents' permission set to 'read': .github/workflows/publish.yml:5","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18","Info: topLevel 'contents' permission set to 'read': .github/workflows/test.yml:4"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":10,"reason":"all dependencies are pinned","details":["Info:  11 out of  11 GitHub-owned GitHubAction dependencies pinned","Info:  18 out of  18 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:20"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#license"}},{"name":"Branch-Protection","score":8,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'main'","Info: 'stale review dismissal' is required to merge on branch 'main'","Warn: required approving review count is 1 on branch 'main'","Info: codeowner review is required on branch 'main'","Info: 'last push approval' is required to merge on branch 'main'","Info: 'up-to-date branches' is required to merge on branch 'main'","Info: status check found to merge onto on branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"name":"Contributors","score":6,"reason":"project has 2 contributing companies or organizations -- score normalized to 6","details":["Info: found contributions from: openzeppelin, xinef it"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}},{"name":"SAST","score":6,"reason":"SAST tool is not run on all commits -- score normalized to 6","details":["Warn: 19 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"name":"CI-Tests","score":10,"reason":"30 out of 30 merged PRs checked by a CI test -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-10-03T11:43:57.851Z","repository_id":316721636,"created_at":"2025-10-03T11:43:57.859Z","updated_at":"2025-10-03T11:43:57.859Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002399,"owners_count":26083374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-10T01:48:07.212Z","updated_at":"2026-03-09T17:30:19.316Z","avatar_url":"https://github.com/OpenZeppelin.png","language":"Rust","readme":"# Event Scanner\n\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://opensource.org/licenses/MIT)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/Event-Scanner/badge)](https://api.securityscorecards.dev/projects/github.com/OpenZeppelin/Event-Scanner)\n\n## Node compatibility\n\nEvent Scanner's test suite and examples are exercised against Foundry's `anvil` dev node.\n\nWhile the library is intended to work with other EVM nodes and RPC providers, behaviour may vary across implementations. If you encounter errors when using a different node/provider, please open an issue at:\n\nhttps://github.com/OpenZeppelin/Event-Scanner/issues\n\n## About\n\nEvent Scanner is a Rust library for streaming EVM-based smart contract events. It is built on top of the [`alloy`](https://github.com/alloy-rs/alloy) ecosystem and focuses on in-memory scanning without a backing database. Applications provide event filters; the scanner takes care of fetching historical ranges, bridging into live streaming mode, all whilst delivering the events as streams of data.\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Architecture Overview](#architecture-overview)\n- [Quick Start](#quick-start)\n- [Usage](#usage)\n  - [Building a Scanner](#building-a-scanner)\n  - [Defining Event Filters](#defining-event-filters)\n  - [Scanning Modes](#scanning-modes)\n    - [HTTP Subscription Support](#http-subscription-support)\n- [Examples](#examples)\n- [Testing](#testing)\n\n---\n\n## Features\n\n- **Historical replay** – stream events from past block ranges.\n- **Live subscriptions** – stay up to date with latest events via WebSocket, IPC, or HTTP transports (HTTP requires the `http-subscription` feature flag).\n- **Hybrid flow** – automatically transition from historical catch-up into streaming mode.\n- **Latest events fetch** – one-shot rewind to collect the most recent matching logs.\n- **Composable filters** – register one or many contract + event signature pairs.\n- **No database** – processing happens in-memory; persistence is left to the host application.\n\n---\n\n## Architecture Overview\n\nThe library exposes two primary layers:\n\n- `EventScanner` – the main scanner type the application will interact with. \n- `BlockRangeScanner` – lower-level component that streams block ranges, handles reorg, batching, and provider subscriptions.\n\n---\n\n## Quick Start\n\nAdd `event-scanner` to your `Cargo.toml`:\n\n```toml\n[dependencies]\nevent-scanner = \"1.1.0\"\n```\n\nCreate an event stream for the given event filters registered with the `EventScanner`:\n\n```rust\nuse alloy::{network::Ethereum, providers::ProviderBuilder, sol_types::SolEvent};\nuse event_scanner::{EventFilter, EventScannerBuilder, Message};\nuse robust_provider::RobustProviderBuilder;\nuse tokio_stream::StreamExt;\nuse tracing::{error, info};\n\nuse crate::MyContract;\n\nasync fn run_scanner(\n    ws_url: \u0026str,\n    contract: alloy::primitives::Address,\n) -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Connect to provider\n    let provider = ProviderBuilder::new().connect(ws_url).await?;\n    let robust_provider = RobustProviderBuilder::new(provider).build().await?;\n    \n    // Configure scanner with custom batch size (optional)\n    let mut scanner = EventScannerBuilder::live()\n        .max_block_range(500)  // Process up to 500 blocks per batch\n        .connect(robust_provider)\n        .await?;\n\n    // Register an event listener\n    let filter = EventFilter::new()\n        .contract_address(contract)\n        .event(MyContract::SomeEvent::SIGNATURE);\n\n    let subscription = scanner.subscribe(filter);\n\n    // Start the scanner and get the proof\n    let proof = scanner.start().await?;\n\n    // Access the stream using the proof\n    let mut stream = subscription.stream(\u0026proof);\n\n    // Process messages from the stream\n    while let Some(message) = stream.next().await {\n        match message {\n            Ok(Message::Data(logs)) =\u003e {\n                for log in logs {\n                    info!(\"Callback successfully executed with event {:?}\", log.inner.data);\n                }\n            }\n            Ok(Message::Notification(notification)) =\u003e {\n                info!(\"Received notification: {:?}\", notification);\n            }\n            Err(e) =\u003e {\n                error!(\"Received error: {}\", e);\n            }\n        }\n    }\n\n    Ok(())\n}\n```\n\n---\n\n## Usage\n\n### Building a Scanner\n\n`EventScannerBuilder` provides mode-specific constructors and functions to configure settings before connecting.\nOnce configured, connect using:\n\n- `connect(provider)` - Connect using a [Robust Provider](https://github.com/OpenZeppelin/Robust-Provider) wrapping your alloy provider or using an alloy provider directly\n\nThis will connect the `EventScanner` and allow you to create event streams and start scanning in various [modes](#scanning-modes).\n\n```rust\nuse alloy::providers::ProviderBuilder;\nuse event_scanner::EventScannerBuilder;\nuse robust_provider::RobustProviderBuilder;\n\n// Connect to provider (example with WebSocket)\nlet provider = ProviderBuilder::new().connect(\"ws://localhost:8545\").await?;\n\n// Live streaming mode\nlet scanner = EventScannerBuilder::live()\n    .max_block_range(500)  // Optional: set max blocks per read (default: 1000)\n    .block_confirmations(12)  // Optional: set block confirmations (default: 12)\n    .connect(provider.clone())\n    .await?;\n\n// Historical block range mode\nlet scanner = EventScannerBuilder::historic()\n    .from_block(1_000_000)\n    .to_block(2_000_000)\n    .max_block_range(500)\n    .connect(provider.clone())\n    .await?;\n\n// we can also wrap the provider in a RobustProvider\n// for more advanced configurations like retries and fallbacks\nlet robust_provider = RobustProviderBuilder::new(provider).build().await?;\n\n// Latest events mode\nlet scanner = EventScannerBuilder::latest(100)\n    // .from_block(1_000_000)  // Optional: set start of search range\n    // .to_block(2_000_000)    // Optional: set end of search range\n    .max_block_range(500)\n    .connect(robust_provider.clone())\n    .await?;\n\n// Sync from block then switch to live mode\nlet scanner = EventScannerBuilder::sync()\n    .from_block(100)\n    .max_block_range(500)\n    .block_confirmations(12)\n    .connect(robust_provider.clone())\n    .await?;\n\n// Sync the latest 60 events then switch to live mode\nlet scanner = EventScannerBuilder::sync()\n    .from_latest(60)\n    .block_confirmations(12)\n    .connect(robust_provider)\n    .await?;\n```\n\nInvoking `scanner.start()` starts the scanner in the specified mode and returns a `StartProof` that must be passed to `subscription.stream()` to access the event stream. This compile-time guarantee ensures the scanner is started before attempting to read events.\n\n### Defining Event Filters\n\nCreate an `EventFilter` for each event stream you wish to process. The filter specifies the contract address where events originated, and event signatures (tip: you can use the value stored in `SolEvent::SIGNATURE`).\n\n```rust\nuse alloy::sol_types::SolEvent;\nuse event_scanner::EventFilter;\n\n// Track a SPECIFIC event from a SPECIFIC contract\nlet specific_filter = EventFilter::new()\n    .contract_address(*my_contract.address())\n    .event(MyContract::SomeEvent::SIGNATURE);\n\n// Track multiple events from a SPECIFIC contract\nlet specific_filter = EventFilter::new()\n    .contract_address(*my_contract.address())\n    .event(MyContract::SomeEvent::SIGNATURE)\n    .event(MyContract::OtherEvent::SIGNATURE);\n\n// Track a SPECIFIC event from ALL contracts\nlet specific_filter = EventFilter::new()\n    .event(MyContract::SomeEvent::SIGNATURE);\n\n// Track ALL events from SPECIFIC contracts\nlet all_contract_events_filter = EventFilter::new()\n    .contract_address(*my_contract.address())\n    .contract_address(*other_contract.address());\n\n// Track ALL events from ALL contracts\nlet all_events_filter = EventFilter::new();\n```\n\nRegister multiple filters by invoking `subscribe` repeatedly.\n\nThe flexibility provided by `EventFilter` allows you to build sophisticated event monitoring systems that can track events at different granularities depending on your application's needs.\n\n### Event Filter Batch Builders\n\nBatch builder examples:\n\n```rust\n// Multiple contract addresses at once\nlet multi_addr = EventFilter::new()\n    .contract_addresses([*my_contract.address(), *other_contract.address()]);\n\n// Multiple event names at once\nlet multi_events = EventFilter::new()\n    .events([MyContract::SomeEvent::SIGNATURE, MyContract::OtherEvent::SIGNATURE]);\n\n// Multiple event signature hashes at once\nlet multi_sigs = EventFilter::new()\n    .event_signatures([\n        MyContract::SomeEvent::SIGNATURE_HASH,\n        MyContract::OtherEvent::SIGNATURE_HASH,\n    ]);\n```\n\n### Message Types\n\nThe scanner delivers three types of messages through the event stream:\n\n- **`Message::Data(Vec\u003cLog\u003e)`** – Contains a batch of matching event logs. Each log includes the raw event data, transaction hash, block number, and other metadata.\n- **`Message::Notification(Notification)`** – Notifications from the scanner.\n- **`ScannerError`** – Errors indicating that the scanner has encountered issues (e.g., RPC failures, connection problems, or a lagging consumer).\n\nAlways handle all message types in your stream processing loop to ensure robust error handling and proper reorg detection.\n\nNotes:\n\n- Ordering is guaranteed only within a single subscription stream. There is no global ordering guarantee across multiple subscriptions.\n- When the scanner detects a reorg, it emits `Notification::ReorgDetected`. Consumers should assume the same events might be delivered more than once around reorgs (i.e. benign duplicates are possible). Depending on the application's needs, this could be handled via idempotency/deduplication or by rolling back application state on reorg notifications.\n- In **Historic** mode specifically, reorg checks are only performed while streaming the **non-finalized** portion of the requested range. Blocks at or below the chain's `finalized` height are streamed without reorg checks.\n\n### Scanning Modes\n\n- **Live** – scanner that streams new blocks as they arrive. \n- **Historic** – scanner for streaming events from a past block range (default: genesis..=latest). For non-finalized blocks, the scanner may re-stream parts of the range if it detects a reorg, and will emit `Notification::ReorgDetected`.\n- **Latest Events** – scanner that collects up to `count` most recent events per listener. Final delivery is in chronological order (oldest to newest).\n- **Sync from Block** – scanner that streams events from a given start block up to the current confirmed tip, then automatically transitions to live streaming.\n- **Sync from Latest Events** - scanner that collects the most recent `count` events, then automatically transitions to live streaming.\n\n#### HTTP Subscription Support\n\nBy default, live block subscriptions rely on WebSocket or IPC transports. If your provider only supports HTTP, enable the `http-subscription` feature flag and opt in on the `RobustProviderBuilder`:\n\n```toml\n[dependencies]\nevent-scanner = { version = \"1.1.0\", features = [\"http-subscription\"] }\n```\n\n```rust\nlet robust_provider = RobustProviderBuilder::new(provider)\n    .allow_http_subscriptions(true)\n    .build()\n    .await?;\n```\n\nBoth steps are required — the feature flag makes the API available, and `.allow_http_subscriptions(true)` enables it at runtime.\n\nThis applies to all modes that include a live streaming phase: **Live**, **Sync from Block**, and **Sync from Latest Events**.\n\n\n#### Important Notes\n\n- Set `max_block_range` based on your RPC provider's limits (e.g., Alchemy, Infura may limit queries to 2000 blocks). Default is 1000 blocks.\n- The modes come with sensible defaults; for example, not specifying a start block for historic mode automatically sets it to the genesis block.\n- In live mode, if the block subscription lags and the scanner needs to catch up by querying past blocks, catch-up queries are performed in ranges bounded by `max_block_range` to respect provider limits.\n\n---\n\n## Examples\n\n- `examples/live_scanning` – minimal live-mode scanner using `EventScannerBuilder::live()`\n- `examples/live_scanning_http` – live-mode scanner over HTTP transport using the `http-subscription` feature flag\n- `examples/historical_scanning` – demonstrates replaying historical data using `EventScannerBuilder::historic()`\n- `examples/sync_from_block_scanning` – demonstrates replaying from genesis (block 0) before continuing to stream the latest blocks using `EventScannerBuilder::sync().from_block(block_id)`\n- `examples/latest_events_scanning` – demonstrates scanning the latest events using `EventScannerBuilder::latest()`\n- `examples/sync_from_latest_scanning` – demonstrates scanning the latest events before switching to live mode using `EventScannerBuilder::sync().from_latest(count)`.\n\nRun an example with:\n\n```bash\nRUST_LOG=info cargo run --example live_scanning --features example\n```\n\nFor the HTTP subscription example:\n\n```bash\nRUST_LOG=info cargo run --example live_scanning_http --features \"example http-subscription\"\n```\n\nThis will also enable `event-scanner` internal logs in the example.\n\nAll examples spin up a local `anvil` instance, deploy a demo counter contract, and demonstrate using event streams to process events.\n\nIf you run into issues when using a different node/provider, please report them at https://github.com/OpenZeppelin/Event-Scanner/issues.\n\n---\n\n## Testing\n\n(We recommend using [nextest](https://crates.io/crates/cargo-nextest) to run the tests)\n\nIntegration tests cover all modes:\n\nNote: Tests are exercised against a local Foundry [anvil][anvil] instance.\n\n```bash\ncargo nextest run --features test-utils\n```\n\n[anvil]: https://github.com/foundry-rs/foundry?tab=readme-ov-file#anvil\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzeppelin%2Fevent-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenzeppelin%2Fevent-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenzeppelin%2Fevent-scanner/lists"}