From 2f6e12d152b5fba0b5e259ad232a8003a064a5b3 Mon Sep 17 00:00:00 2001 From: StillHammer Date: Sun, 1 Feb 2026 10:18:12 +0800 Subject: [PATCH] Add CLAUDE.md project context --- CLAUDE.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..44c20ae --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,55 @@ +# Claude - blockchain-core + +## Projet +Rust workspace : blockchain core library + REST API node. +Partie d'un ecosysteme de 3 repos (blockchain-core, blockchain-cli, blockchain-flutter). + +## Architecture +``` +blockchain-core/ (Rust workspace) +├── core/ Library crate - blockchain primitives +│ └── src/ block, chain, wallet, transaction, mining, state, persistence, config, error +├── node/ Binary crate - axum REST API (port 3000) +│ └── src/ main, state (Arc), api/ (blocks, transactions, wallets, mining, chain, errors) +└── tests/ Integration tests +``` + +## Decisions techniques +- **Account-based** (HashMap), pas UTXO +- **SHA-256** (sha2) pour hashing +- **Ed25519** (ed25519-dalek) pour signatures +- **axum 0.8** pour l'API REST +- **JSON files** pour persistence (pas de DB) +- **u64** pour montants (comme satoshis, pas de floats) + +## API Endpoints (port 3000) +- `GET /api/blocks` - List blocks (paginated) +- `GET /api/blocks/:hash` - Block by hash +- `POST /api/transactions` - Submit signed tx +- `GET /api/transactions/pending` - Pending pool +- `POST /api/wallets` - Generate wallet +- `GET /api/wallets/:address/balance` - Balance + nonce +- `POST /api/mine` - Mine block +- `GET /api/mining/status` - Difficulty, reward +- `GET /api/chain/info` - Chain info +- `POST /api/chain/validate` - Validate chain +- `GET /api/health` - Health check + +## Commandes +```bash +cargo build # Build tout +cargo test # Tests unitaires +cargo run -p blockchain-node # Lancer le node +cargo clippy # Lint +``` + +## Phase actuelle +Phase 1-3 complètes : core lib + node API implémentés. +Prochaine étape : installer Rust, compiler, lancer les tests. + +## Repos liés +- blockchain-cli (Rust CLI, HTTP only) +- blockchain-flutter (Flutter app, HTTP only) + +## Gitea +https://git.etheryale.com/StillHammer/blockchain-core