Skip to content

node: allow registration of custom reactors while creating node#3771

Merged
melekes merged 6 commits intomasterfrom
parth/custom-reactor-registration
Jul 3, 2019
Merged

node: allow registration of custom reactors while creating node#3771
melekes merged 6 commits intomasterfrom
parth/custom-reactor-registration

Conversation

@melekes
Copy link
Contributor

@melekes melekes commented Jul 3, 2019

See #3730 (comment)

Replaces #3730

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

@codecov-io
Copy link

codecov-io commented Jul 3, 2019

Codecov Report

Merging #3771 into master will decrease coverage by 0.12%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3771      +/-   ##
==========================================
- Coverage   64.04%   63.91%   -0.13%     
==========================================
  Files         217      217              
  Lines       18129    18142      +13     
==========================================
- Hits        11610    11595      -15     
- Misses       5550     5573      +23     
- Partials      969      974       +5
Impacted Files Coverage Δ
node/node.go 63.11% <100%> (+0.37%) ⬆️
libs/events/events.go 93.2% <0%> (-4.86%) ⬇️
blockchain/reactor.go 71.49% <0%> (-3.28%) ⬇️
blockchain/pool.go 80.26% <0%> (-1.98%) ⬇️
p2p/pex/pex_reactor.go 81.53% <0%> (-1.14%) ⬇️
consensus/reactor.go 70.69% <0%> (-0.59%) ⬇️
mempool/reactor.go 78.99% <0%> (-0.48%) ⬇️
consensus/state.go 79.73% <0%> (-0.12%) ⬇️
consensus/replay.go 71.02% <0%> (+0.81%) ⬆️

@melekes
Copy link
Contributor Author

melekes commented Jul 3, 2019

\cc @ParthDesai

Copy link
Contributor

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be added into the docs somewhere? 🥇

Copy link
Contributor

@thanethomson thanethomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🎉

It's great how this solution doesn't break the Golang API 👍

@melekes melekes merged commit f76684a into master Jul 3, 2019
@melekes melekes deleted the parth/custom-reactor-registration branch July 3, 2019 13:18
@ebuchman
Copy link
Contributor

It's great how this solution doesn't break the Golang API

Truly fantastic.

Should this be added into the docs somewhere?

Good question. I don't think we have explicit documentation for the Go APIs other than comments in the code. We should probably write a doc.go for the node package to explain more about how everything works and how to make customize more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants