-
Notifications
You must be signed in to change notification settings - Fork 28
Define rough architecture for middleware #31
Conversation
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.
Thanks for the PR!
See some comments inline from an initial review.
I noticed this is a large change (+231k LoC); see comment inline discussing some alternatives.
It also wasn't 100% clear to me if this change was entirely a refactor, or if there's also new features added (beyond logging).
Would it be possible to split out more granular commits, to simplify the review process and merge the easier parts first?
middleware/vendor/github.com/digitalbitbox/bitbox-wallet-app/LICENSE
Outdated
Show resolved
Hide resolved
1ef7200
to
80f9a76
Compare
I discussed this PR with @TheCharlatan offline, and the CI that was added in #34 should be passing at 80f9a76. Even with using the |
We looked briefly into why |
71cbcf4
to
1044516
Compare
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.
Thanks for the changes to no longer depend on logrus
, this is now a much smaller patch than before!
I've left some more comments inline.
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.
Thanks, see few more comments inline.
The functionality of the middleware is now split into three packages. The middleware package takes care of communicating with bitcoind and lightningd and emits an event if new data is received. The handlers package takes care of the communication with the bitbox-wallet-app. It upgrades connections to websocket, if requested, and starts the main middleware event loop. Events from the middleware are caught and passed into a websocket handler. The main package is what is compiled into a binary. It parses command line arguments and creates new middleware and handler instances. This commit also implements logging, where each package creates its own logrus logging instance.
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.
Thanks for the changes!
ACK 9d4545a
The functionality of the middleware is now split into three packages. The middleware package takes care of communicating with bitcoind and lightningd and emits an event if new data is received.
The handlers package takes care of the communication with the bitbox-wallet-app. It upgrades connections to websocket, if requested, and starts the main middleware event loop. Events from the
middleware are caught and passed into a websocket handler.
The main package is what is compiled into a binary. It parses command line arguments and creates new middleware and handler instances.
This commit also implements a coherent logging structure, which is handled in the same fashion as in the bitbox-wallet-app.