-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add support for PublishBlockStream
to simulator
#548
base: main
Are you sure you want to change the base?
feat: add support for PublishBlockStream
to simulator
#548
Conversation
Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
Signed-off-by: georgi-l95 <[email protected]>
* tracks processed blocks, and maintains a history of stream statuses. It provides functionality | ||
* to start, monitor, and shutdown the gRPC server. | ||
*/ | ||
public class PublishStreamGrpcServerImpl implements PublishStreamGrpcServer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All implementations could be unified under one interface, that means that we close the idea of starting couple of implementations under one instance. Which is okay, judging by the current and future needs.
* @param publishStreamRequest The incoming stream request to process | ||
*/ | ||
@Override | ||
public void onNext(PublishStreamRequest publishStreamRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future PRs we will add handlers here to respond, depending on predefined configuration or depending on controller (don't exist yet). For now we have only one handler, which returns block ack.
@@ -148,8 +134,10 @@ public void stop() throws InterruptedException { | |||
public StreamStatus getStreamStatus() { | |||
return StreamStatus.builder() | |||
.publishedBlocks(publishStreamGrpcClient.getPublishedBlocks()) | |||
.processedBlocks(publishStreamGrpcServer.getProcessedBlocks()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all grpc implementations are unifed under one interface, this could be improved and reduced.
Description:
This PR adds support for
PublishBlockStream
in the simulator, by introducing new wokring mode, called PublisherServerMode, where the application acts a server, which listents and awaits stream of block data. With the effort here I aim mainly to introduce the feature, where in future ones we will refine it, according to needs to be able to use it as testing driver.Related issue(s):
Fixes #430
Notes for reviewer:
Checklist