Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus indexer on Ideal Network #4

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

carloskiron
Copy link
Contributor

Refactor Indexer for Ideal Network

This PR refactors the event indexer to focus solely on the Ideal Network, removing support for other chains and implementing proper configuration management. This is part of the ongoing work for issue #21, focusing on the initial refactoring and basic event support.

Updates #21

Changes

Core Changes

  • Renamed package from acuity-index-polkadot to acuity-index-ideal and reset version to 0.1.0
  • Removed implementation for other chains (Polkadot, Kusama, Rococo, Westend)
  • Added environment-based configuration for genesis hash and WebSocket URL
  • Updated event handling to focus on System and Balances events

Implementation Details

  1. Configuration Management

    • Added new config.rs module for environment-based configuration
    • Added support for IDN_GENESIS_HASH and IDN_WS_URL environment variables
    • Implemented safe fallbacks for local development
  2. Event Indexing

    • Updated ChainKey enum to handle relevant event types:
      • AccountId for balance events
      • BlockHash for system events
      • ExtrinsicHash for transaction events
    • Updated ChainTrees with appropriate storage trees
    • Removed parachain-specific event handling
  3. Testing

    • Updated test suite to focus on System and Balances events
    • Added test cases for account balance and system event indexing
    • Removed parachain-specific tests
  4. Documentation

    • Updated README with configuration instructions
    • Added example environment variable setup
    • Updated Docker instructions to include configuration

Breaking Changes

  • Removed support for other chains (Polkadot, Kusama, Rococo, Westend)
  • Changed database tree structure to match new event types
  • Changed configuration method to use environment variables

Remaining Work for #21

After this PR is merged, the following work remains for issue #21:

  • Implement pallet manager event handling
  • Add comprehensive test coverage for pallet manager events
  • Set up integration testing with an Ideal Network node

Testing Done

  • Verified all unit tests pass
  • Tested environment variable configuration
  • Verified build process works correctly

How to Test

  1. Set up environment variables:

    export IDN_GENESIS_HASH="your_genesis_hash"
    export IDN_WS_URL="ws://your.node.url:port"
  2. Build and run tests:

    cargo test
  3. Run the indexer:

    cargo run

- Rename package to acuity-index-ideal and set version to 0.1.0
- Remove other chain implementations (Polkadot, Kusama, Rococo, Westend)
- Update ChainKey and ChainTrees to handle System and Balances events
- Add environment-based configuration for genesis hash and WebSocket URL
- Update tests to focus on relevant event types
- Update documentation with configuration instructions

Updates #21
- Keep Ideal Network-focused changes
- Remove other chain implementations
- Use environment-based configuration
- Maintain consistent code formatting

Updates #21
- Switch from local path to git repository
- Fix GitHub Actions build error

Updates #21
- Remove other chain test implementations
- Keep tests focused on Ideal Network events
- Add test for extrinsic hash events
- Fix formatting issues

Updates #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant