Start
Contribution guide
Set up the repository locally and contribute changes through a pull request.
Local setup
Fork GautamBytes/cashu-fault-lab on GitHub, then clone your fork:
bash
git clone https://github.com/YOUR-USERNAME/cashu-fault-lab.git
cd cashu-fault-lab
git remote add upstream https://github.com/GautamBytes/cashu-fault-lab.git
corepack enable
pnpm install --frozen-lockfileThe repository requires Node.js 24 and pnpm 11.15.0. Docker is optional for the default test suite and required for integration and funded lanes.
Verify the local checkout:
bash
pnpm format:check
pnpm typecheck
pnpm test
pnpm buildRun the documentation website locally:
bash
pnpm website:devOpen http://localhost:3000. Website-specific checks are available through
pnpm website:test, pnpm website:build, and pnpm website:test:e2e.
Development workflow
- Sync your checkout:
git fetch upstream && git switch main && git merge --ff-only upstream/main - Create a focused branch:
git switch -c feat/your-feature - Make your changes, following existing code conventions.
- Run the checks relevant to your change.
- Commit with a descriptive conventional commit message.
- Push your branch:
git push -u origin feat/your-feature - Open a pull request from your fork to
GautamBytes/cashu-fault-lab:main.
Pull request checklist
- Explain the problem and the behavior changed.
- Include the commands used to verify the change.
- Add or update tests for changed behavior.
- Keep generated files and documentation synchronized.
- Do not commit secrets, funded credentials, local artifacts, or environment files.
- Keep the pull request focused; separate unrelated refactors.
Code conventions
- TypeScript strict mode —
strict: true,noUncheckedIndexedAccess,verbatimModuleSyntax - Formatting — Prettier (
pnpm format:check). No manual formatting needed. - Imports — Use
.jsextensions for Node-targeted ESM imports. The Next.js website uses bundler-resolved extensionless imports. Import types withtypekeyword. - No unused imports —
verbatimModuleSyntaxenforces this. - No sensitive data in tests — Use fake tokens only. Secrets are redacted in artifacts.
Adding a scenario
- Create a
.jsonfile underscenarios/<category>/. See existing files for the schema. - Include
nameanddescriptionfields. - Command types:
configure_fault,arm_crash,send,start_send,restart,advance_time,clear_faults,assert_quiescent. - Add a handler in
apps/lab-cli/src/packaged-runtime.tsif using a new scenario name.
Adding an adapter
- Generate a standalone scaffold:
npx cashu-fault-lab@0.1.2 adapter init --language typescript --name your-wallet. Choosetypescript,rust, orpython. - Implement the 8 HTTP routes described in
docs/adapter-guide.md, including cumulative redemption-start evidence fromGET /v1/redemptions. - Start the adapter on a loopback origin and export the bearer-token environment variable named by
its generated
adapter-manifest.json. - Run the read-only contract check:
npx cashu-fault-lab@0.1.2 adapter preflight --adapters ./your-wallet/adapter-manifest.json. - Run the response-loss and duplicate-delivery preview:
npx cashu-fault-lab@0.1.2 adapter preview --adapters ./your-wallet/adapter-manifest.json --sender your-wallet --receiver your-wallet. - Share the redacted feedback bundle from
cashu-fault-results/when requesting review.
Tests
pnpm testandpnpm test:unitrun the Docker-free default suite.pnpm test:integrationruns PostgreSQL/Testcontainers suites and prints an explicit skipped-tier reason when Docker is unavailable.pnpm test:fundedruns strict real-mint, funded-wallet, restart, and relay lanes; missing prerequisites fail the command.pnpm test:allruns unit, integration, and funded tiers in order.pnpm lab doctorprints tier readiness and the exact runnable commands.- Rust tests:
cargo test --manifest-path adapters/cdk/Cargo.toml.
Commit messages
Follow conventional commits: feat:, fix:, docs:, test:, refactor:.
Reporting issues
Open an issue on GitHub with:
- The scenario, seed, and command that failed
- The artifact file (
artifacts/latest.json) if available - Your environment (Node version, OS)