-
Notifications
You must be signed in to change notification settings - Fork 204
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
New web-sockets
connector
#5170
New web-sockets
connector
#5170
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feat/outport-refactor #5170 +/- ##
======================================================
Coverage 70.82% 70.82%
======================================================
Files 675 677 +2
Lines 87850 87941 +91
======================================================
+ Hits 62218 62284 +66
- Misses 20940 20960 +20
- Partials 4692 4697 +5
☔ View full report in Codecov by Sentry. |
cmd/node/config/external.toml
Outdated
# This flag shall only be used for observer nodes | ||
Enabled = false | ||
URL = "localhost:22111" | ||
# This flag will start the WebSocket connector as server or client |
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.
Maybe "ServerMode = false/true" ?
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.
or Mode = "server"
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.
changed in Mode
cmd/node/config/external.toml
Outdated
URL = "localhost:22111" | ||
# This flag will start the WebSocket connector as server or client | ||
IsServer = false | ||
# The url of the WebSocket client/server |
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.
I think we should clarify that this URL is used when using the driver in client mode.
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.
This will be used in both cases because the URL is needed also for the server when it starts.
WithAcknowledge = true | ||
# Currently, only "json" is supported. In the future, "gogo protobuf" could also be supported | ||
MarshallerType = "json" | ||
# The number of seconds when the client will try again to send the data | ||
RetryDurationInSec = 5 | ||
BlockingAckOnError = false |
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.
add a descriptive comment on what this does?
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.
added
|
||
var log = logger.GetOrCreate("outport/factory/hostdriver") | ||
|
||
func CreateHostDriver(args ArgsHostDriverFactory) (outport.Driver, error) { |
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.
missing comments in the whole file
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.
added
@@ -0,0 +1 @@ | |||
package factory |
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.
missing unit tests
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.
added
}, nil | ||
} | ||
|
||
func (o *hostDriver) SaveBlock(outportBlock *outport.OutportBlock) error { |
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.
missing comment
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.
added
outport/host/driver.go
Outdated
|
||
err = o.senderHost.Send(marshalledPayload, topic) | ||
if err != nil { | ||
o.log.Error("cannot send on route", "topic", topic, "error", err) |
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.
Since this still can happen while closing the node, I would filter out log.Error prints only if they are not of type closed error.
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.
removed
cmd/node/config/external.toml
Outdated
# This flag shall only be used for observer nodes | ||
Enabled = false | ||
URL = "localhost:22111" | ||
# This flag will start the WebSocket connector as server or client |
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.
or Mode = "server"
log core.Logger | ||
} | ||
|
||
func NewHostDriver(args ArgsHostDriver) (*hostDriver, error) { |
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.
missing comment
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.
added
cmd/node/config/external.toml
Outdated
# This flag will start the WebSocket connector as server or client | ||
IsServer = false | ||
# The url of the WebSocket client/server | ||
# This flag will start the WebSocket connector as server or client( can be "client" or "server") |
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.
typo:
as server or client (can be "client"
wrong spacing near the (
character
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.
done
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.
System test passed
@@ Log scanner @@
integrate-new-ws-client-server
================================================================================
- Known Warnings 10
- New Warnings 3
- Known Errors 0
- New Errors 0
- Panics 0
================================================================================ - block hash does not match 6548
- wrong nonce in block 2528
- miniblocks does not match 0
- num miniblocks does not match 0
- miniblock hash does not match 0
- block bodies does not match 0
- receipts hash missmatch 0
================================================================================ - No jailed nodes on the testnet
================================================================================
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.
just the spacing comment
Reasoning behind the pull request
Proposed changes
WebSocketDriver
( now named `HostDriver ) in this repository.FullDuplexHost
frommx-chain-communication-go
repository (https://github.com/multiversx/mx-chain-communication-go).Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?