Skip to content

Add rpc validation#162

Open
lucasbalieiro wants to merge 4 commits into
stratum-mining:mainfrom
lucasbalieiro:add-rpc-validation
Open

Add rpc validation#162
lucasbalieiro wants to merge 4 commits into
stratum-mining:mainfrom
lucasbalieiro:add-rpc-validation

Conversation

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

@lucasbalieiro lucasbalieiro commented May 21, 2026

to be merged after #159
closes #161

This is adding a RPC auto-discovery that will try to probe the network, version and IBD state of the node.

For testing I've listed the edge cases that I found when working on this here: #161 (comment)

Also, I recommend testing from the dev mode and from the docker node.

Some prints of my test cases:

image image image image

@lucasbalieiro lucasbalieiro force-pushed the add-rpc-validation branch 2 times, most recently from 919857a to 340ee1a Compare May 22, 2026 19:54
@lucasbalieiro
Copy link
Copy Markdown
Collaborator Author

ready for review.

I checked that the current state of this PR is working on dev mode, as docker container and also worked on my Umbrel and it was able to identify the Node version, pre-fill the form for the node.sock validation

image

@lucasbalieiro lucasbalieiro marked this pull request as ready for review May 22, 2026 20:08
@GitGab19
Copy link
Copy Markdown
Member

GitGab19 commented May 25, 2026

I tested this PR on my Linux, and I have a couple of points to discuss:

  • the RPC discovery is not working on my end, and that's because of the following AI's explanation:

    host.docker.internal:host-gateway can exist on Linux, but it points at the Docker bridge gateway. If Bitcoin Core RPC is only listening on 127.0.0.1, the helper container won’t reach it through that bridge address. NetworkMode: 'host' makes the helper’s 127.0.0.1 be the host’s loopback on Linux.
    
  • in case the RPC probing doesn't work, I would show the following text instead of the current one (which is a bit too much verbose IMO): We couldn’t automatically detect your Bitcoin Core node. If it’s still starting, wait a moment and retry. If it’s already running, you can continue and enter the connection details manually.

  • in case the RPC probing works, we should immediately do the IPC probing as well, and only guide the user to the current "Bitcoin Core Connection" if that fails, otherwise that can be skipped entirely IMO

  • if the RPC (or IPC) probing fails, it's correct to redirect the user to the "Bitcoin Core Connection" step, but currently the node's version (in case the RPC probing worked but the IPC failed) is being displayed as "Version: 300200" and not "Version: 30.2 • Synced":

    Screenshot From 2026-05-25 19-51-31

@lucasbalieiro
Copy link
Copy Markdown
Collaborator Author

lucasbalieiro commented May 25, 2026

@GitGab19, Text updated. version fixed.

About auto-advance, added in a new commit because I had to add new callback and do other validations ahead of time eee9850

Tested the feature on umbrel and mac and it is working

@GitGab19
Copy link
Copy Markdown
Member

I just tested again, and on Linux it's not able to get the information through RPC.

@GitGab19
Copy link
Copy Markdown
Member

To make it work on my Linux, both dev and docker deployments, I had to push this commit: GitGab19@26dd208

You can find it at https://github.com/GitGab19/sv2-ui/tree/pr-162 in case you want to cherry-pick it.

@lucasbalieiro
Copy link
Copy Markdown
Collaborator Author

@GitGab19, cherry-picked 26dd208

Copy link
Copy Markdown
Member

@GitGab19 GitGab19 left a comment

Choose a reason for hiding this comment

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

Great, I tested everything and it's working on my end.

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.

add RPC support

2 participants