Source for xch.dev, the documentation for Sage and the Chia Wallet SDK. It's built with Docusaurus.
- Node.js 24 (see
.nvmrc; 20 or newer works) - pnpm, at the version pinned in
package.json'spackageManagerfield. Runningcorepack enablepicks it up automatically.
pnpm install
pnpm startpnpm start and pnpm build both generate the RPC reference pages first. The generated pages go to docs/sage/rpc, which is gitignored. To regenerate them on their own, run pnpm gen-api-docs.
Before opening a PR, run:
pnpm format:check # or `pnpm format` to fix
pnpm typecheck
pnpm buildCI runs the same checks on every pull request.
Every Rust example in docs/sdk is compiled and run against the Wallet SDK. The SDK commit the docs are written against is the rev in sdk-examples/Cargo.toml. To check the examples (this needs a Rust toolchain):
pnpm check:sdk-examples # every page
pnpm check:sdk-examples docs/sdk/primitives/cat.md # specific pages
pnpm check:sdk-examples --sdk /path/to/wallet-sdk # against a local SDK checkoutEach ```rust block is compiled as its own module, so it needs its own use lines. Mark a block ```rust ignore to skip it, which is only meant for excerpts like struct definitions. CI doesn't run this check yet.
To update the docs for a new SDK release with Claude Code, run /update-sdk-docs <tag>.
The RPC pages are generated from src/openapi.json, which comes from Sage. To update it to a Sage release (this needs git and a Rust toolchain):
pnpm sync-openapi v0.13.1 # omit the tag to use the latest releaseTo use a local Sage checkout instead, set SAGE_DIR=/path/to/sage.
Every push to main builds the site and deploys it to GitHub Pages through .github/workflows/ci.yml.