node/hosts the Substrate node binary; treatruntime/mainnetandruntime/testnetas the authoritative runtime crates.- Pallets live under
pallets/…, with matching runtime APIs inpallets/*/rpcand precompiles inprecompiles/. client/contains RPC layers and tracing utilities, whilechainspecs/anddeployment/hold network configuration and release artifacts.- Scripts for local orchestration sit in
scripts/; TypeScript simulations are inuser-simulation/for scenario-driven testing.
nix flake developopens a fully provisioned shell when using Nix.cargo check -p nodevalidates core changes quickly; prefer before pushing.cargo build --release --features testnetproduces the testnet node; swap features to target mainnet../scripts/run-standalone-local.sh --cleanspins up a fresh local testnet with authorities and logs under/tmp.npx @acala-network/chopsticks@latest --config=scripts/chopsticks.ymlforks the live chain for rapid iteration.- From
user-simulation/, useyarn install && yarn startto exercise end-to-end flows against a local node.
- Stick to the pinned toolchain in
rust-toolchain.toml(Rust 1.86 plusrustfmt,clippy, andwasm32-unknown-unknowntarget). - Format via
cargo fmt(hard tabs, 100-column width) and lint withcargo clippy --workspace --all-targets. - Prefer
snake_casefor modules/functions,UpperCamelCasefor types, andSCREAMING_SNAKE_CASEfor constants; mirror existing pallet naming when adding crates. - Run
dprint fmton TOML manifests when touching dependency metadata.
cargo test --workspacemust pass; add focused crates with-p pallet-namefor faster loops.- Mirror runtime invariants in Rust unit tests; use benchmarks or fuzzers under
pallets/*/benchmarkingandpallets/*/fuzzerwhen logic is math-heavy. - Execute
yarn testinuser-simulation/before merging features that affect external RPC flows. - Document new integration scenarios in
scripts/(e.g., additional Chopsticks configs) when manual steps are required.
- Follow the existing Conventional Commit pattern (
feat:,fix:,docs:,chore:) seen ingit log. - Keep commits scoped to one logical change and include relevant crate paths in the body when touching multiple pallets.
- PRs should summarize motivation, list test commands run, and link issues or RFCs; attach screenshots only when UX or telemetry dashboards change.
- Request reviews from runtime and node owners for consensus-critical updates; surface migration notes for storage changes.