[Backend] Implement gRPC Protocol Adapter for High-Throughput Event Streaming - #749
Open
DevGod-001 wants to merge 1 commit into
Open
[Backend] Implement gRPC Protocol Adapter for High-Throughput Event Streaming#749DevGod-001 wants to merge 1 commit into
DevGod-001 wants to merge 1 commit into
Conversation
… streaming - Add tonic/prost/tokio-stream dependencies to core/Cargo.toml - Add core/proto/events.proto with ContractEvent and EventStreamService schema - Add core/build.rs to compile proto via tonic-build - Implement core/src/grpc.rs with EventStreamServiceImpl backed by SimulationBus - Wire gRPC server startup in main.rs on configurable GRPC_PORT (default 50051) - Include unit tests covering translate_event filtering logic Closes SoroLabs#583
|
@DevGod-001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or 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
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.
Summary
Adds a gRPC service using
tonicthat streams Soroban contract events over HTTP/2 with Protobuf framing, eliminating the latency and serialization overhead of HTTP JSON polling for enterprise indexing consumers.Changes
core/proto/events.proto— DefinesContractEvent,StreamContractEventsRequest, andEventStreamServicein packagesoroscope.events.v1core/build.rs— Compiles the proto schema at build time viatonic-buildcore/src/grpc.rs— ImplementsEventStreamServiceImplbacked by the existingSimulationBusbroadcast channel; includes unit tests for translate_event filteringcore/Cargo.toml— Addstonic,prost,tokio-streamdependencies andtonic-buildbuild-dependencycore/src/main.rs— Spawns the gRPC server on a configurableGRPC_PORT(default50051) alongside the existing Axum HTTP serverUsage
GRPC_PORT=50051 RUST_LOG=info cargo run -p soroscope-core grpcurl -plaintext -d '{"contract_id":"CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC"}' \ localhost:50051 soroscope.events.v1.EventStreamService/StreamContractEventsValidation
rustfmt --edition 2021 src/grpc.rs— passesgrpc.rscover: no-filter passthrough, contract ID match/no-match, event-type filter match/no-match, and progress-event suppressioncargo check --locked --all-targetschecks contracts workspace (pre-existing scope; core is standalone as per repo convention)Closes #583