Skip to content

Add Rpc interface#26

Open
xyzconstant wants to merge 1 commit into
2140-dev:masterfrom
xyzconstant:add-rpc-interface
Open

Add Rpc interface#26
xyzconstant wants to merge 1 commit into
2140-dev:masterfrom
xyzconstant:add-rpc-interface

Conversation

@xyzconstant

@xyzconstant xyzconstant commented Jun 8, 2026

Copy link
Copy Markdown

bitcoin/bitcoin#32297 introduced the Rpc interface for bitcoin-cli, allowing it to execute RPC commands over IPC. This commit adds the corresponding Cap'n Proto schema and includes a test that queries uptime.

@rustaceanrob

Copy link
Copy Markdown
Member

tACK 1f30c7d

@Sjors

Sjors commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Concept ACK

@xyzconstant

Copy link
Copy Markdown
Author

Rebased with master to resolve conflicts and force-pushed.

@Sjors

Sjors commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

In d0ecafd the test fails:

failures:
---- rpc_query_getblockcount stdout ----
thread 'rpc_query_getblockcount' (8835) panicked at tests/test.rs:106:9:
assertion `left == right` failed
  left: 101
 right: Number(104)

I suggest reading some other RPC value, because the number of blocks is going to depend on the order in which tests are run.

Other than that the code looks good to me.

@Sjors

Sjors commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

An alternative approach to get test coverage, without adding a new test, would be to take one of the RPC calls in https://github.com/2140-dev/bitcoin-capnp-types/blob/master/tests/util/bitcoin_core.rs and adjust it got via this RPC-over-IPC route.

@xyzconstant xyzconstant force-pushed the add-rpc-interface branch 2 times, most recently from 22998e8 to 6839ca4 Compare June 19, 2026 16:26
bitcoin/bitcoin#32297 introduced the RPC interface for `bitcoin-cli`, allowing
it to execute RPC commands over IPC. This commit adds the corresponding Cap'n Proto
schema and includes a test that queries `uptime`.
@xyzconstant

Copy link
Copy Markdown
Author

re: #26 (comment)

Yes, you're right. This test depends on a fresh node start.

Just updated it to query uptime instead.

d0ecafd -> 214aec9 (compare)

@xyzconstant

Copy link
Copy Markdown
Author

re: #26 (comment)

I like this approach too, but I would keep the RPC-over-IPC test to demonstrate how to use the Rpc interface, consistent with how the other interfaces are tested in the same file.

If everyone agrees, I can create a follow-up to move the existing JSON-RPC setup to IPC.

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.

3 participants