Skip to content

IPC docs (for v31)#1250

Draft
Sjors wants to merge 5 commits into
bitcoin-core:masterfrom
Sjors:2026/05/ipc
Draft

IPC docs (for v31)#1250
Sjors wants to merge 5 commits into
bitcoin-core:masterfrom
Sjors:2026/05/ipc

Conversation

@Sjors

@Sjors Sjors commented May 11, 2026

Copy link
Copy Markdown
Member

This adds IPC documentation, starting with v31.0.

Scherm­afbeelding 2026-05-11 om 19 30 12

This adds about 1000 (LLM generated) lines to the generator, which I need to study a bit more. Mainly looking for feedback on the layout and contents now.

Fixes #1247

Sjors added 5 commits May 11, 2026 19:08
Pure refactor: no behavior change. Splits the RPC-specific code
(BITCOIN_*, Command/Group, getVersion, generateRPC, run) out of
generate.go into rpc.go, leaving generate.go as a thin entry point.

Adds a go.mod so multi-file builds work with `go run .`.
Adds a CI job that installs Go and Cap'n Proto on Debian and runs
`go vet` and `go build` against contrib/doc-gen so syntax
regressions in the generator are caught on every PR.

Full RPC/IPC docs regeneration still requires a running bitcoind
plus a matching Bitcoin Core source checkout, which is out of
scope for CI.
Adds generation of HTML reference docs for Bitcoin Core's Cap'n Proto
IPC (libmultiprocess) interfaces. The new ipc.go module shells out
to `capnp` for canonical schema text, parses interfaces and structs,
and emits, per Bitcoin Core version >= 31:

  * one HTML page per IPC method
  * a per-interface index (linked from `make<Iface>` factories)
  * a single Cap'n Proto structs page with anchors per struct
  * a per-version IPC index and a site-wide IPC landing page

Polish:
  - methods named `construct` and deprecated `*Old<n>` are hidden
  - long signatures are reformatted with one parameter per line
  - factory methods like `makeMining` link to the interface they
    return
  - sidebar groups render in 'init first / structs last / others
    alpha' order so the entry point and reference bookend the
    method groups

The site layout (_layouts/doc.html) and navigation
(_includes/navigation.html) gain an 'IPC Docs' branch parallel to
the existing RPC docs branch and gate IPC content with an
experimental-API warning banner.
Extends the IPC generator to read C++ doxygen-style comments out of
src/interfaces/{init,echo,mining}.h and attach them to the matching
methods on each Cap'n Proto interface. The renderer understands the
common @param[in/out], @RetVal and @returns/@return tags and emits a
`<dl class="ipc-doc-tags">` definition list for them; free prose is
emitted as paragraphs.

Also linkifies whole-word occurrences of known interface and struct
names in the rendered description so e.g. `@retval BlockTemplate`
points at the BlockTemplate interface page.

Adds an interfaceHeaders map mapping each Cap'n Proto interface to a
header file (or to "" to opt out of doxygen). Adding a new interface
to the schemas without an entry in the map is now a hard error, so we
do not silently miss documenting it.
Adds the generated Cap'n Proto IPC reference for Bitcoin Core v31.0,
produced by contrib/doc-gen against github.com/bitcoin/bitcoin tag
v31.0 (commit 6574cb4086).
@Sjors

Sjors commented May 11, 2026

Copy link
Copy Markdown
Member Author

@ryanofsky I wonder if it makes sense to first work on automatically copying .h interface documentation to the .capnp files. The current generator uses those headers directly.

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.

IPC docs

1 participant