-
Notifications
You must be signed in to change notification settings - Fork 7
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
EX-115: add kafka publisher with protobuf #105
Conversation
27e56f9
to
6223770
Compare
listener.WithEventLogs(nil, nil)) | ||
|
||
return listener.New(l, wsEVMClient, httpEVMClient, handler, sanityEVMClient, sanityCheckInterval, | ||
listener.WithEventLogs(nil, nil)), nil | ||
} | ||
|
||
func getPublisher(c *cli.Context, redisClient *redis.Client, topic string) (publisherpkg.Publisher, 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.
Review note: At first I put the logic below into NewListener
function, however, it causes cyclomatic complexity
error when linting. So I separate this logic into its own function.
The parameters passed into this function seem quite counterintuitive to me, though.
f993069
to
c495538
Compare
c495538
to
e3dfc52
Compare
710bd29
to
8dba19c
Compare
8dba19c
to
6cb2463
Compare
bytes hash = 2; | ||
bytes parent_hash = 3; | ||
bytes reorged_hash = 4; |
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.
Review note: Previously in Go struct, these fields are defined as string
. I updated them to bytes
to save data size.
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.
LGTM! 👍
0bd891e
to
b9b06f3
Compare
* feat: add kafka publisher * feat: handler config publisher type * chore: remove cleanup producer * feat: add producer wait acks * chore: refactor function name * refactor: reduce cyclomatic complexity to pass linter * chore: add kafka topic name validation * fix: check topic name match regex * test: add validate topic name test * test: add kafka publisher test * feat: change interface of publisher to publish byte * feat: add protobuf support * feat: add encoder * feat: add protobuf encoder * chore: separate encoder type
* feat: add kafka publisher * feat: handler config publisher type * chore: remove cleanup producer * feat: add producer wait acks * chore: refactor function name * refactor: reduce cyclomatic complexity to pass linter * chore: add kafka topic name validation * fix: check topic name match regex * test: add validate topic name test * test: add kafka publisher test * feat: change interface of publisher to publish byte * feat: add protobuf support * feat: add encoder * feat: add protobuf encoder * chore: separate encoder type
* feat: add kafka publisher * feat: handler config publisher type * chore: remove cleanup producer * feat: add producer wait acks * chore: refactor function name * refactor: reduce cyclomatic complexity to pass linter * chore: add kafka topic name validation * fix: check topic name match regex * test: add validate topic name test * test: add kafka publisher test * feat: change interface of publisher to publish byte * feat: add protobuf support * feat: add encoder * feat: add protobuf encoder * chore: separate encoder type
* feat: add kafka publisher * feat: handler config publisher type * chore: remove cleanup producer * feat: add producer wait acks * chore: refactor function name * refactor: reduce cyclomatic complexity to pass linter * chore: add kafka topic name validation * fix: check topic name match regex * test: add validate topic name test * test: add kafka publisher test * feat: change interface of publisher to publish byte * feat: add protobuf support * feat: add encoder * feat: add protobuf encoder * chore: separate encoder type
TDD: https://www.notion.so/kybernetwork/TDD-Longer-retention-message-broker-for-EVM-Listener-2da22223cd5d41ac897d73ea244ad65f
This PR is based on the idea of running EVM Listener + Kafka in a separate instance vs EVM Listener + Redis stream.
Although this PR is backward-compatible, we still need to discuss if we want to merge this PR into
main
branch.