Skip to content
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

Stratum v2 connman #50

Open
wants to merge 7 commits into
base: 2024/06/sv2_transport
Choose a base branch
from
Open

Conversation

Sjors
Copy link
Owner

@Sjors Sjors commented Jul 19, 2024

Moved to fork repo from bitcoin#30332 (comment)

Based on bitcoin#30315 and bitcoin#30205. Followed by #49.

Parent PR bitcoin#29432.

This PR introduces Sv2Connman which is somewhat similar to CConnman. It uses the Sv2Transport introduced in bitcoin#30315 to enable incoming connections from other Stratum v2 roles.

It's main target user is the Template Provider role introduced in #49.

There may be other Stratum v2 roles we want to support in the future.

A remaining issue is that the code in ThreadSv2Handler reuses a lot of code from CConnman::SocketHandlerConnected. I'd like to find a way to extract this common functionality and put it somewhere else.

TODO:

  • make CConnman::SocketHandlerConnected (partially) reusable
  • avoid dependency on bitcoin_node (e.g. move Transport to bitcoin_common)

@Sjors
Copy link
Owner Author

Sjors commented Jul 19, 2024

@pinheadmz wrote in the original PR:

I am working on a libevent-replacing HTTP server using netbase primitives and yeah, I have some functions that look a lot like the sv2connamn in this branch.

I think it would be cool if possible to abstract the mechanisms in ThreadSocketHandler to work on "abstract clients" and I'd be happy to review and collaborate on that.

I plan to take a look at this.

@Sjors
Copy link
Owner Author

Sjors commented Aug 29, 2024

CMake rebase.

@Sjors
Copy link
Owner Author

Sjors commented Sep 20, 2024

Rebased to move everything into a bitcoin_sv2 library (use -DWITH_SV2=ON to compile).

Sjors and others added 7 commits September 20, 2024 18:22
Co-Authored-By: Christopher Coverdale <chris.coverdale24@gmail.com>
Move the implementation (method definitions) from `test/util/net.h` to
`test/util/net.cpp` to make the header easier to follow.
…lass

This allows reusing them in other mocked implementations.
…o it

And also allows gradually providing the data to be returned by `Recv()`
and sending and receiving net messages (`CNetMessage`).
Co-Authored-By: Vasil Dimov <vd@FreeBSD.org>
Similar to e9bfbb5 for Cirrus, but
not opt-in, because Github CI lacks custom variables.
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.

2 participants