-
Notifications
You must be signed in to change notification settings - Fork 9
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
Wrld 3 feature/process events #28
Open
sylvaincormier
wants to merge
32
commits into
main
Choose a base branch
from
WRLD-3-feature/process-events
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…P request deadlines - Define DataFetchedSuccessfully in the Event enum to signal successful data retrieval. - Define HttpFetchingError in the Error enum for handling HTTP request failures. - Correct the type mismatch in fetch_data by adjusting the .deadline() method to accept a Timestamp derived from the current time plus a Duration
This commit introduces the CardanoFollowerRpc trait along with its implementation, CardanoFollowerRpcImpl, which handles the submission of Cardano events via JSON-RPC within a Substrate node. Key highlights include: - The `submitCardanoEvent` RPC method is defined to accept JSON string events. It deserializes these into an Event struct and stores the data in offchain storage using Substrate's persistent storage capabilities. - Enhanced error handling provides detailed feedback for any failures encountered during the event parsing and storage processes. - The RPC method is integrated into the existing Substrate node infrastructure using jsonrpsee_core's RpcModule, ensuring seamless interaction with other node components. The implementation ensures that Cardano events are processed efficiently, leveraging Substrate's offchain workers. Although the `submitCardanoEvent` method itself is implemented synchronously, it is registered as an asynchronous RPC method to align with jsonrpsee's asynchronous communication patterns. This setup not only caters to current needs but also provides a foundation for integrating more complex asynchronous operations in the future.
… processing - Changed RPC from ws to http - Integrated offchain worker functionality to fetch and process data from an external JSON-RPC API endpoint. - Added necessary imports and configurations for `no_std` environments, including `extern crate alloc` and appropriate `use` statements for `ToString` and `serde_json` functionalities. - Implemented `fetch_all_events` function in the pallet to make a POST request to the JSON-RPC API and handle responses, including proper handling of content-type headers and JSON payloads. - Added detailed logging to capture and print response codes and body content, improving debugging capabilities. - Fixed type issues related to HTTP requests and payload handling by ensuring correct type usage and conversions. - Refactored existing code to align with Substrate's offchain worker paradigms and best practices, including the usage of timeouts and error handling mechanisms.
…in pallet - Added struct with necessary fields and methods. - Implemented leader election logic placeholder in function. - Created functions to fetch, validate, and process events: , , . - Integrated event sequence validation with function to ensure proper order and consistency among validators. - Added extrinsic to handle inclusion transactions, ensuring events are validated and ordered correctly. - Implemented offchain worker hooks to fetch and process data, and submit inclusion transactions if the validator is the leader. - Enhanced error handling and logging for better traceability. - Defined storage map `EventStorage` to store events and facilitate mempool management.
Refactor pallet: Clean up and set up basic offchain functionality - Removed unnecessary code and imports. - Set up basic structure for offchain worker to fetch and process data. - Implemented `fetch_data` function for HTTP requests. - Added `manual_fetch` call to trigger data fetch. - Ensured code compiles successfully.
…response - Added deserialization of HTTP response body into Vec<CustomEvent> in fetch_all_events. - Implemented processing of each fetched event in fetch_and_process_data. - Improved error logging for failed event processing.
- Added CustomEvent struct and methods for creating and hashing events. - Implemented pallet structure with Config trait and StorageMap for event storage. - Added off-chain worker logic to fetch and process events from an external source. - Implemented leader election logic and inclusion transaction creation. - Enhanced HTTP request handling and error logging. - Added placeholder functions for future integration with priority queue and KV store. - Included synchronization logic for events with peers. - Integrated new RPC endpoint for fetching all events from the priority queue.
…rldmobilegroup/aya-node into WRLD-3-feature/process-events
- Added CustomEvent struct and methods for creating and hashing events. - Implemented pallet structure with Config trait and StorageMap for event storage. - Added off-chain worker logic to fetch and process events from an external source. - Implemented leader election logic and inclusion transaction creation. - Enhanced HTTP request handling and error logging. - Added placeholder functions for future integration with priority queue and KV store. - Included synchronization logic for events with peers. - Integrated new RPC endpoint for fetching all events from the priority queue
- Added CustomEvent struct and methods for creating and hashing events. - Implemented pallet structure with Config trait and StorageMap for event storage. - Added off-chain worker logic to fetch and process events from an external source. - Implemented leader election logic and inclusion transaction creation. - Enhanced HTTP request handling and error logging. - Added placeholder functions for future integration with priority queue and KV store. - Included synchronization logic for events with peers. - Integrated new RPC endpoint for fetching all events from the priority queue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.