This file provides guidance to AI coding agents (Claude Code, and other AGENTS.md-compatible tools) when working with code in this repository.
Required on Linux/macOS: use the Nix devshell, which sets up the compiler, Conan, ccache, and (optionally) Rust automatically.
nix developFor alternate devshell variants (specific compiler, no-compiler, coverage), see docs/build/nix.md. For the manual build steps, CMake options, and protocol codegen commands, see BUILD.md (## Steps, ## Options, ## Code generation).
Rust crate tests (independent of the CMake build): cargo test --manifest-path crates/Cargo.toml --workspace (CI uses cargo nextest).
Unit tests are a custom framework built into the xrpld binary itself (not Boost.Test/GTest/Catch); see CONTRIBUTING.md for the basic invocation. Notes not covered there:
- A suite's
--unittestname is built from the arguments to itsBEAST_DEFINE_TESTSUITE/BEAST_DEFINE_TESTSUITE_PRIOmacro (usually at the bottom of the test file), in reverse order and joined with.:BEAST_DEFINE_TESTSUITE(Credentials, app, xrpl)→xrpl.app.Credentials. --unittest-argdoes nothing — don't use it.- Tests that run offline in under a minute should be automatic
--unittestsuites; anything else is a manual/integration test. - New tests should be written using
gtestundersrc/tests/unless that isn't possible, in which case fall back to the legacy Beast framework undersrc/test/.tests/(top-level) holds integration tests exercised againstlibxrpl/xrpld.
See CONTRIBUTING.md for pre-commit setup and CONTRIBUTING.md for clang-tidy (opt-in, needs local clang-tidy and generated headers).
New file placement and header levelization: see CONTRIBUTING.md. Braces, whitespace, member order, and other conventions: see docs/CodingStyle.md. XRPL_ASSERT/UNREACHABLE contracts: see CONTRIBUTING.md. Commit messages: see CONTRIBUTING.md.
Paths below reflect the current layout; update this section if modularization moves a subsystem to a different directory.
include/xrpl/+src/libxrpl/— the core protocol library: ledger, shamap, consensus, crypto, json, resource, nodestore, rdb, peerfinder, andtx/(transaction application:Transactor.cpp,applySteps.cpp, invariants, payment paths).tx/transactors/has one file per transaction type, grouped by subsystem:escrow/,vault/,lending/,sponsor/,nft/,token/(MPT),payment_channel/,permissioned_domain/,dex/,oracle/,did/,credentials/,bridge/,check/,delegate/,account/,system/. Any change to transaction-processing behavior must be gated behind an Amendment.src/xrpld/— the server application built on top oflibxrpl:app,core,overlay(P2P networking),peerfinder,perflog,rpc,shamap.mainbuilds anApplicationImpimplementingApplication; most components hold a reference to it (app_), giving broad cross-component access — expect to trace call chains throughApplication&.src/test/— unit tests mirroring the subsystems above, plusjtx/(the transaction-building test DSL — e.g.jtx/escrow.h,jtx/vault.h,jtx/sponsor.h,jtx/permissioned_dex.h) andunit_test/(the custom test framework itself, derived from Beast).src/tests/— unit tests forlibxrplwritten ingtest, gradually replacing thesrc/testequivalents.crates/— a Rust workspace (only built with-Dxrpld -Drust=ON) bridged into C++ viacxxbridge/thecxxcrate; currently just ahello_worldinterop scaffold. Requires the Rust toolchain pinned inrust-toolchain.toml(the Nix devshell provides it automatically).