Skip to content

Commit 611b76b

Browse files
docs: add CLAUDE.md for development guidance
1 parent db0027b commit 611b76b

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed

CLAUDE.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Commands
6+
7+
### Build and Development
8+
9+
```bash
10+
# Initial setup (installs deps, builds, and configures)
11+
yarn setup
12+
13+
# Start local development environment
14+
yarn start
15+
16+
# Stop local environment
17+
yarn stop
18+
19+
# Restart services
20+
yarn restart
21+
22+
# Rebuild after changes
23+
yarn build
24+
25+
# Complete reset of data and builds
26+
yarn reset
27+
```
28+
29+
### Testing
30+
31+
```bash
32+
# Run full test suite (requires running node from yarn start)
33+
yarn test
34+
35+
# Test specific packages
36+
yarn test:suite # Platform test suite
37+
yarn test:dapi # DAPI components
38+
yarn test:sdk # JavaScript SDK
39+
yarn test:dpp # Dash Platform Protocol
40+
yarn test:drive # Drive storage layer
41+
yarn test:wallet-lib # Wallet library
42+
yarn test:dapi-client # DAPI client
43+
44+
# Test specific workspace
45+
yarn workspace <package_name> test
46+
```
47+
48+
### Rust Development
49+
50+
```bash
51+
# Run Rust tests for a specific package
52+
cargo test -p <package_name>
53+
54+
# Run all Rust tests
55+
cargo test --workspace
56+
57+
# Check Rust code
58+
cargo check --workspace
59+
60+
# Run clippy linter
61+
cargo clippy --workspace
62+
63+
# Format Rust code
64+
cargo fmt --all
65+
```
66+
67+
### Other Commands
68+
69+
```bash
70+
# Run linters
71+
yarn lint
72+
73+
# Access dashmate CLI
74+
yarn dashmate
75+
76+
# Configure test suite network
77+
yarn configure:tests:network
78+
```
79+
80+
## Architecture
81+
82+
### Technology Stack
83+
84+
- **Rust**: Core platform components (Drive, DAPI server, DPP implementation)
85+
- **JavaScript/TypeScript**: Client SDKs, developer tools, test suite
86+
- **WebAssembly**: Bridge between Rust and JavaScript implementations
87+
- **gRPC**: Service communication protocol
88+
- **Docker**: Local development environment
89+
90+
### Key Components
91+
92+
**Drive** (`packages/rs-drive`): Platform's decentralized storage component, implementing a replicated state machine for storing and retrieving application data.
93+
94+
**DAPI** (`packages/dapi`): Decentralized API server that provides a unified interface for interacting with the Dash network and Platform.
95+
96+
**DPP** (`packages/rs-dpp`, `packages/wasm-dpp`): Dash Platform Protocol implementation that defines data structures and validation rules.
97+
98+
**SDK** (`packages/js-dash-sdk`, `packages/rs-sdk`): Client libraries providing high-level interfaces for building applications on Dash Platform.
99+
100+
**Dashmate** (`packages/dashmate`): Node management tool for setting up and managing Dash Platform nodes.
101+
102+
### Data Contracts
103+
104+
Platform uses data contracts to define application data schemas:
105+
- `dpns-contract`: Dash Platform Naming Service
106+
- `dashpay-contract`: Social payments functionality
107+
- `feature-flags-contract`: System feature toggles
108+
- `masternode-reward-shares-contract`: Masternode reward distribution
109+
- `withdrawals-contract`: Platform credit withdrawals
110+
111+
### Development Workflow
112+
113+
1. **Monorepo Structure**: Uses Yarn workspaces to manage multiple packages
114+
2. **Cross-language Integration**: WASM bindings connect Rust and JavaScript code
115+
3. **Local Development**: Docker Compose environment managed by dashmate
116+
4. **Testing**: Comprehensive test suites at unit, integration, and e2e levels
117+
118+
### Important Patterns
119+
120+
- **Platform Versioning**: Uses `rs-platform-version` for protocol versioning
121+
- **Serialization**: Custom serialization with `rs-platform-serialization`
122+
- **Value Handling**: `rs-platform-value` for cross-language data representation
123+
- **Proof Verification**: `rs-drive-proof-verifier` for cryptographic proofs
124+
- **State Transitions**: Documents and data contracts use state transitions for updates

0 commit comments

Comments
 (0)