Compare commits

..

63 Commits
v1.1.1 ... main

Author SHA1 Message Date
Debian
12a337be19 docs(index,network,usage,readme): centraliser l’index, cartographie réseau, routes nginx, grafana 2025-09-08 14:50:31 +00:00
Debian
7b3a96ac30 docs(network): détailler les liens entre services (flux et dépendances) 2025-09-08 14:45:29 +00:00
Debian
2646aed0a2 docs(network,usage): document mapping services↔ports↔mounts, nginx routes, grafana path 2025-09-08 14:43:11 +00:00
Debian
636482ac55 chore: sync local minor edits across configs and examples 2025-09-08 14:38:10 +00:00
Debian
a3d3209b36 feat(nginx): reverse-proxy services via hostnames + logs for Grafana; feat(monitoring): serve Grafana under /grafana subpath 2025-09-08 14:27:25 +00:00
Debian
92e702193c chore(scripts): archive unused scripts (build_all_images, build_modules, disable_nginx_docker, pull_repos_in_order) 2025-09-08 14:18:51 +00:00
Debian
17e8b50f7a docs(configuration,architecture): document tags :dev en cours de création; chore(compose): montages logs et torrc; network: ipam + hostnames 2025-09-08 14:06:54 +00:00
Debian
29a07760a1 ci: remove SKIP_SIGNER_BUILD usage; build signer unconditionally and simplify script 2025-09-04 21:11:02 +00:00
Debian
d828e24584 ci: remove signer skip wrapper 2025-09-04 21:08:20 +00:00
Debian
40535f351b feat(ci): add script wrapper to skip signer build when rebuilding images 2025-09-04 20:04:05 +00:00
Debian
e4c6979bd0 fix(signing): add minimal signer tsconfig/src to satisfy Docker COPY; allow full rebuild 2025-09-04 19:59:42 +00:00
Debian
0be31e4b4e fix(signing): add placeholder pkg dir for signer Docker COPY 2025-09-04 19:58:55 +00:00
Debian
8f246cbbf5 fix(signing): add placeholder package.json and package-lock.json for signer Docker build; allow rebuild 2025-09-04 19:58:26 +00:00
Debian
459f734d4b feat(config): centralize restart config; add exemplar restart_config.conf.exemple; move restart script into scripts/; update README 2025-09-04 19:55:43 +00:00
Debian
01e79cad49 ci: recommence commit on restart config centralization; include exemplars 2025-09-04 19:51:40 +00:00
Debian
501372c3ee docs: align README with scripts relocation (use ./scripts/*)
Some checks failed
CI - 4NK_node / Integration Tests (push) Failing after 13s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 19:49:30 +00:00
Debian
43628b6ebc refactor: move top-level scripts into scripts/ (add_external_node.sh, build_modules.sh, manage_services.sh, monitor_sync.sh)
Some checks are pending
CI - 4NK_node / Unit Tests (push) Waiting to run
CI - 4NK_node / Integration Tests (push) Waiting to run
CI - 4NK_node / Code Quality (push) Waiting to run
CI - 4NK_node / Security Tests (push) Waiting to run
CI - 4NK_node / Docker Build & Test (push) Waiting to run
CI - 4NK_node / Documentation Tests (push) Waiting to run
CI - 4NK_node / Security Audit (push) Waiting to run
CI - 4NK_node / Release Guard (push) Blocked by required conditions
CI - 4NK_node / Publish Release (push) Blocked by required conditions
CI - 4NK_node / Performance Tests (push) Waiting to run
CI - 4NK_node / Notify (push) Blocked by required conditions
2025-09-04 19:49:09 +00:00
Debian
4c9d11c571 docs: update README paths to scripts/restart_4nk_node.sh after moving script
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Publish Release (push) Has been skipped
CI - 4NK_node / Notify (push) Failing after 1s
2025-09-04 19:48:07 +00:00
Debian
5a5188c9b4 refactor: move root restart script into scripts/; update references
Some checks failed
CI - 4NK_node / Code Quality (push) Has been cancelled
CI - 4NK_node / Docker Build & Test (push) Waiting to run
CI - 4NK_node / Unit Tests (push) Waiting to run
CI - 4NK_node / Integration Tests (push) Waiting to run
CI - 4NK_node / Security Tests (push) Waiting to run
CI - 4NK_node / Documentation Tests (push) Waiting to run
CI - 4NK_node / Security Audit (push) Waiting to run
CI - 4NK_node / Release Guard (push) Blocked by required conditions
CI - 4NK_node / Performance Tests (push) Waiting to run
CI - 4NK_node / Notify (push) Blocked by required conditions
CI - 4NK_node / Publish Release (push) Blocked by required conditions
2025-09-04 19:47:38 +00:00
Debian
5c60af349d feat(config): centralize restart config; add conf/restart_config.conf; adapt restart script; add skeleton external_nodes.conf; update README
Some checks failed
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 33s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
2025-09-04 19:44:15 +00:00
Debian
1a3715f027 fix(blindbit): install git in builder (golang:1.25-alpine)
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 21s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 4s
CI - 4NK_node / Unit Tests (push) Failing after 39s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 5s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 14:54:07 +00:00
Debian
7f13fc58a3 feat(blindbit): switch builder to golang:1.25-alpine to reduce memory usage
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 30s
CI - 4NK_node / Integration Tests (push) Failing after 25s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 7s
CI - 4NK_node / Security Audit (push) Successful in 5s
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 8s
CI - 4NK_node / Publish Release (push) Has been skipped
CI - 4NK_node / Release Guard (push) Has been skipped
2025-09-04 14:51:56 +00:00
Debian
c3f55793dc fix(blindbit): build with ./... to include all modules
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 18s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 14:47:04 +00:00
Debian
fb6fa749fc fix(blindbit): ensure build uses ./src (single main)
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 35s
CI - 4NK_node / Integration Tests (push) Failing after 18s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 10s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 11s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 14:32:33 +00:00
Debian
20215aad53 fix(blindbit): build with ./... instead of ./src
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 33s
CI - 4NK_node / Integration Tests (push) Failing after 18s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 4s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 3s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 13:50:49 +00:00
Debian
289918a7e9 feat(blindbit): upgrade Go builder to 1.25
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 31s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 54s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 11s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 3s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 13:36:34 +00:00
Debian
8f4638b70c refactor(miniback): switch to lecoffre-back-mini_env.conf
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 13s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 11:13:58 +00:00
Debian
70695972f0 Remove path from repository
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 32s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 3s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 10:27:57 +00:00
Debian
7a745d9e82 conf exemple
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 13s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 29s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 10:26:01 +00:00
Debian
6b9e606fc1 clean
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 30s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 4s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 31s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 10:17:45 +00:00
Debian
bd1b5af7b7 Remove path from repository
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 30s
CI - 4NK_node / Integration Tests (push) Failing after 12s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 13s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 5s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 10:06:41 +00:00
Debian
2763b18cce clean for merge
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 31s
CI - 4NK_node / Unit Tests (push) Failing after 31s
CI - 4NK_node / Integration Tests (push) Failing after 30s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 14s
CI - 4NK_node / Security Audit (push) Successful in 11s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 29s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 10:02:46 +00:00
Debian
c3b5801f46 chore: ignore .conf in 4NK_node; keep .conf.exemple
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 12s
CI - 4NK_node / Security Tests (push) Failing after 29s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 6s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 09:12:03 +00:00
Debian
bb61be04a4 clean
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 50s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 12s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-04 08:13:43 +00:00
Debian
4aed2f7f22 Fix: Configuration Tor et Bitcoin pour signet custom - Tor écoute maintenant sur toutes les interfaces (0.0.0.0:9050) - Bitcoin se connecte aux nœuds onion du signet custom - Synchronisation active avec le réseau signet custom - Tous les services relancés et fonctionnels
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 13s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 26s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 22:24:53 +00:00
Debian
78b6afbe37 fix: Centralize configuration and fix relay services - Mount config files to correct paths (/home/bitcoin/.conf) - Update docker-compose.yml with 3 separate relay services - Fix Dockerfiles for relay modules - Centralize all configs in 4NK_node/conf/
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 12s
CI - 4NK_node / Security Tests (push) Failing after 30s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 19:06:37 +00:00
Debian
124b491bfe fix: suppression authentification RPC Bitcoin et blindbit - Suppression de rpcuser et rpcpassword de bitcoin.conf - Suppression de COOKIE_PATH et volume de blindbit - Test de connexion RPC sans authentification
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:31:27 +00:00
Debian
808bda72bf fix: authentification RPC blindbit par cookie - Remplacement de l authentification par identifiants par l authentification par cookie - Montage du volume bitcoin_data pour accéder au fichier .cookie - Configuration COOKIE_PATH pour l authentification automatique
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 32s
CI - 4NK_node / Unit Tests (push) Failing after 30s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 4s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:30:08 +00:00
Debian
3a160cb9b6 fix: configuration blindbit par variables d environnement - Remplacement du fichier TOML par des variables d environnement - Configuration RPC complète via variables d environnement - Suppression du volume de configuration
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 28s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:27:16 +00:00
Debian
6fb48e2466 fix: correction authentification RPC blindbit - Retour à la configuration rpc_user/rpc_pass séparés - Configuration rpcallowip dans la section globale Bitcoin
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 33s
CI - 4NK_node / Unit Tests (push) Failing after 30s
CI - 4NK_node / Integration Tests (push) Failing after 12s
CI - 4NK_node / Security Tests (push) Failing after 29s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:24:05 +00:00
Debian
2ef15f2bc0 fix: correction configuration RPC Bitcoin signet - Déplacement de rpcallowip dans la section [signet] - Correction de l authentification RPC pour blindbit
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 31s
CI - 4NK_node / Unit Tests (push) Failing after 31s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 4s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:17:05 +00:00
Debian
8030a3f671 fix: correction configuration Bitcoin RPC signet - Ajout de rpcbind=0.0.0.0 dans la section [signet] - Bitcoin écoute maintenant sur 0.0.0.0:38332 pour le RPC signet
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 4s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:13:18 +00:00
Debian
bd7ec6a68f fix: correction ports signet custom - Changement port RPC Bitcoin de 18443 vers 38332 (signet) - Mise à jour docker-compose.yml pour exposer le port 38332 - Correction configuration blindbit pour utiliser le bon port RPC
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 30s
CI - 4NK_node / Unit Tests (push) Failing after 32s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 29s
CI - 4NK_node / Docker Build & Test (push) Failing after 11s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 3s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:10:11 +00:00
Debian
51719f5345 fix: correction configuration blindbit - Utilisation de l image officielle setavenger/blindbit-oracle - Correction des parametres RPC (rpc_user, rpc_pass, rpc_endpoint) - Ajustement de la commande et du working_dir
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 32s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 12s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 16:07:59 +00:00
Debian
9701f47e25 feat: alignement docker-support-v2 et centralisation configs - Mise à jour docker-compose.yml avec tag docker-support-v2 et healthchecks - Centralisation des configurations dans 4NK_node/conf - Suppression des COPY conf/ dans Dockerfiles (montage runtime) - Ajout de la documentation complète (ARCHITECTURE.md, API.md, USAGE.md, DEPLOYMENT.md)
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 49s
CI - 4NK_node / Unit Tests (push) Failing after 32s
CI - 4NK_node / Integration Tests (push) Failing after 17s
CI - 4NK_node / Security Tests (push) Failing after 29s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 28s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-03 10:45:30 +00:00
Debian
c45e1c48bc feat(stack): routes Nginx (/secure_id, storage health), RPC creds, relay auth fallback, build fixes
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 31s
CI - 4NK_node / Unit Tests (push) Failing after 32s
CI - 4NK_node / Integration Tests (push) Failing after 13s
CI - 4NK_node / Security Tests (push) Failing after 28s
CI - 4NK_node / Docker Build & Test (push) Failing after 11s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 29s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-02 14:19:42 +00:00
Debian
fe3012ef2f chore: centralise conf, HTTP-only nginx, RPC 38332, remove cookie, fix network CIDR, drop *.backup from VCS
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 46s
CI - 4NK_node / Unit Tests (push) Failing after 30s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 29s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 29s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-02 11:14:04 +00:00
Debian
d0a8758bb7 fix: Correction des Dockerfiles et du script build_modules.sh pour l'architecture modulaire
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 29s
CI - 4NK_node / Unit Tests (push) Failing after 29s
CI - 4NK_node / Integration Tests (push) Failing after 10s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 10s
CI - 4NK_node / Documentation Tests (push) Failing after 3s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 27s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-01 13:41:29 +00:00
Debian
70523badcf ci: Mise à jour de la CI pour l'architecture modulaire docker-support-v2
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 1m27s
CI - 4NK_node / Unit Tests (push) Failing after 30s
CI - 4NK_node / Integration Tests (push) Failing after 11s
CI - 4NK_node / Security Tests (push) Failing after 27s
CI - 4NK_node / Docker Build & Test (push) Failing after 9s
CI - 4NK_node / Documentation Tests (push) Failing after 4s
CI - 4NK_node / Security Audit (push) Successful in 3s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 30s
CI - 4NK_node / Notify (push) Failing after 1s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-09-01 13:37:46 +00:00
Debian
d6d1a71f28 docs: Ajout du document de correction de l'architecture 2025-09-01 13:35:38 +00:00
Debian
dbd53136c8 fix: Correction de l'architecture - modules/ contient uniquement les Dockerfiles 2025-09-01 13:31:59 +00:00
Debian
9953a161e6 docs: Ajout du résumé des branches docker-support-v2 créées 2025-09-01 13:13:06 +00:00
Debian
803177a34d feat: Mise à jour des dépendances vers docker-support-v2 et automatisation du build 2025-09-01 13:10:31 +00:00
Debian
1b886afcc4 feat: Architecture modulaire Docker complète - 4NK_node devient orchestrateur pur 2025-09-01 12:58:30 +00:00
Debian
3c0377cdb9 doc cleanup
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 38s
CI - 4NK_node / Unit Tests (push) Failing after 39s
CI - 4NK_node / Integration Tests (push) Successful in 34s
CI - 4NK_node / Security Tests (push) Failing after 33s
CI - 4NK_node / Docker Build & Test (push) Failing after 16s
CI - 4NK_node / Documentation Tests (push) Successful in 12s
CI - 4NK_node / Security Audit (push) Successful in 9s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 35s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
4NK Template Sync / check-and-sync (push) Has been cancelled
2025-08-29 16:29:17 +00:00
Debian
49b30a7ef1 feat: Ajout du script de gestion des services et documentation
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 50s
CI - 4NK_node / Unit Tests (push) Failing after 36s
CI - 4NK_node / Integration Tests (push) Successful in 34s
CI - 4NK_node / Security Tests (push) Failing after 32s
CI - 4NK_node / Docker Build & Test (push) Failing after 15s
CI - 4NK_node / Documentation Tests (push) Successful in 11s
CI - 4NK_node / Security Audit (push) Successful in 9s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 34s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
- Ajout du script manage_services.sh pour arrêter, nettoyer et redémarrer les services
- Documentation complète du script dans docs/scripts/
- Tests unitaires pour le script dans tests/scripts/
- Correction des contextes de build dans docker-compose.yml
2025-08-29 15:37:32 +00:00
Debian
6247fc9e54 [skip ci] chore(sync): maj hooks 4NK_template 2025-08-28 15:01:15 +00:00
Debian
188e281d68 [skip ci] chore(sync): maj hooks+doc agents centralisés 2025-08-28 14:36:04 +00:00
Debian
7bfb2e0e7f [skip ci] chore(sync): maj hooks+docs agents centralisés 2025-08-28 14:25:50 +00:00
Debian
990de3e2d4 [skip ci] chore(agents): centralisation via 4NK_template (hooks+doc) 2025-08-28 12:05:16 +00:00
Debian
3b20dfd9ae add some files
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 37s
CI - 4NK_node / Unit Tests (push) Failing after 36s
CI - 4NK_node / Integration Tests (push) Successful in 33s
CI - 4NK_node / Security Tests (push) Failing after 32s
CI - 4NK_node / Docker Build & Test (push) Failing after 15s
CI - 4NK_node / Documentation Tests (push) Successful in 10s
CI - 4NK_node / Security Audit (push) Successful in 8s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 34s
CI - 4NK_node / Notify (push) Failing after 2s
CI - 4NK_node / Publish Release (push) Has been skipped
2025-08-27 23:52:38 +00:00
Debian
3488b497de release: 1.1.2 (latest)
- HSTS activé sur Nginx
- Scripts de déploiement initial (avec/sans certificats)
- Docs installation/configuration enrichies (webroot, renouvellement, déploiement)
2025-08-27 23:38:14 +00:00
Debian
538aab294b ci(template-sync): utiliser runs-on: self-hosted au lieu du label linux
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 39s
CI - 4NK_node / Unit Tests (push) Failing after 36s
CI - 4NK_node / Integration Tests (push) Successful in 33s
CI - 4NK_node / Security Tests (push) Failing after 32s
CI - 4NK_node / Docker Build & Test (push) Failing after 15s
CI - 4NK_node / Documentation Tests (push) Successful in 11s
CI - 4NK_node / Security Audit (push) Successful in 10s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 34s
CI - 4NK_node / Notify (push) Failing after 2s
2025-08-27 22:17:02 +00:00
16468 changed files with 2045 additions and 2799418 deletions

View File

@ -0,0 +1,17 @@
---
alwaysApply: true
---
# Gouvernance du template 4NK
[portée]
Assurer que chaque projet adapte intelligemment le template et que les améliorations génériques reviennent dans `4NK_template`.
[directives]
- Conserver `security-audit` et `release-guard` dans tous projets.
- Adapter la CI, les docs et `AGENTS.md` au contexte local.
- En cas d'amélioration générique : ouvrir une issue "Template Feedback", prototyper, valider CI, mettre à jour `CHANGELOG.md`/`TEMPLATE_VERSION`.
[validation]
- Refuser un push/tag si l'adaptation a retiré les vérifications minimales (sécurité, tests, build, version/changelog/tag).
- Exiger une documentation claire dans `docs/TEMPLATE_ADAPTATION.md` et `docs/TEMPLATE_FEEDBACK.md`.

View File

@ -0,0 +1,5 @@
---
alwaysApply: true
---
quand tu fais une commande ou un requète complexe, explique là avant de la lancer

View File

@ -0,0 +1,9 @@
---
description:
globs:
alwaysApply: true
---
# Lint
respecter strictement les règles de lint du markdown

View File

@ -104,3 +104,8 @@ backups/sql/
!.cursor/
!AGENTS.md
*/certs/
*/log/
*/conf/
*/archive/

View File

@ -1,15 +0,0 @@
# LOCAL_OVERRIDES.yml — dérogations locales contrôlées
overrides:
- path: ".gitea/workflows/ci.yml"
reason: "spécificité denvironnement"
owner: "@maintainer_handle"
expires: "2025-12-31"
- path: "scripts/auto-ssh-push.sh"
reason: "flux particulier temporaire"
owner: "@maintainer_handle"
expires: "2025-10-01"
policy:
allow_only_listed_paths: true
require_expiry: true
audit_in_ci: true

View File

@ -1,362 +0,0 @@
name: CI - 4NK_node
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
env:
RUST_VERSION: '1.70'
DOCKER_COMPOSE_VERSION: '2.20.0'
jobs:
# Job de vérification du code
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run clippy
run: |
cd sdk_relay
cargo clippy --all-targets --all-features -- -D warnings
- name: Run rustfmt
run: |
cd sdk_relay
cargo fmt --all -- --check
- name: Check documentation
run: |
cd sdk_relay
cargo doc --no-deps
- name: Check for TODO/FIXME
run: |
if grep -r "TODO\|FIXME" . --exclude-dir=.git --exclude-dir=target; then
echo "Found TODO/FIXME comments. Please address them."
exit 1
fi
# Job de tests unitaires
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Run unit tests
run: |
cd sdk_relay
cargo test --lib --bins
- name: Run integration tests
run: |
cd sdk_relay
cargo test --tests
# Job de tests d'intégration
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
services:
docker:
image: docker:24.0.5
options: >-
--health-cmd "docker info"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 2375:2375
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker images
run: |
docker build -t 4nk-node-bitcoin ./bitcoin
docker build -t 4nk-node-blindbit ./blindbit
docker build -t 4nk-node-sdk-relay -f ./sdk_relay/Dockerfile ..
- name: Run integration tests
run: |
# Tests de connectivité de base
./tests/run_connectivity_tests.sh || true
# Tests d'intégration
./tests/run_integration_tests.sh || true
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: |
tests/logs/
tests/reports/
retention-days: 7
# Job de tests de sécurité
security-tests:
name: Security Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Run cargo audit
run: |
cd sdk_relay
cargo audit --deny warnings
- name: Check for secrets
run: |
# Vérifier les secrets potentiels
if grep -r "password\|secret\|key\|token" . --exclude-dir=.git --exclude-dir=target --exclude=*.md; then
echo "Potential secrets found. Please review."
exit 1
fi
- name: Check file permissions
run: |
# Vérifier les permissions sensibles
find . -type f -perm /0111 -name "*.conf" -o -name "*.key" -o -name "*.pem" | while read file; do
if [[ $(stat -c %a "$file") != "600" ]]; then
echo "Warning: $file has insecure permissions"
fi
done
# Job de build et test Docker
docker-build:
name: Docker Build & Test
runs-on: ubuntu-latest
services:
docker:
image: docker:24.0.5
options: >-
--health-cmd "docker info"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 2375:2375
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and test Bitcoin Core
run: |
docker build -t 4nk-node-bitcoin:test ./bitcoin
docker run --rm 4nk-node-bitcoin:test bitcoin-cli --version
- name: Build and test Blindbit
run: |
docker build -t 4nk-node-blindbit:test ./blindbit
docker run --rm 4nk-node-blindbit:test --version || true
- name: Build and test SDK Relay
run: |
docker build -t 4nk-node-sdk-relay:test -f ./sdk_relay/Dockerfile ..
docker run --rm 4nk-node-sdk-relay:test --version || true
- name: Test Docker Compose
run: |
docker-compose config
docker-compose build --no-cache
# Job de tests de documentation
documentation-tests:
name: Documentation Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check markdown links
run: |
# Vérification basique des liens markdown
find . -name "*.md" -exec grep -l "\[.*\](" {} \; | while read file; do
echo "Checking links in $file"
done
- name: Check documentation structure
run: |
# Vérifier la présence des fichiers de documentation essentiels
required_files=(
"README.md"
"LICENSE"
"CONTRIBUTING.md"
"CHANGELOG.md"
"CODE_OF_CONDUCT.md"
"SECURITY.md"
"docs/INDEX.md"
"docs/INSTALLATION.md"
"docs/USAGE.md"
)
for file in "${required_files[@]}"; do
if [[ ! -f "$file" ]]; then
echo "Missing required documentation file: $file"
exit 1
fi
done
- name: Validate documentation
run: |
# Vérifier la cohérence de la documentation
if ! grep -q "4NK_node" README.md; then
echo "README.md should mention '4NK_node'"
exit 1
fi
security-audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Ensure scripts executable
run: |
chmod +x scripts/security/audit.sh || true
- name: Run template security audit
run: |
if [ -f scripts/security/audit.sh ]; then
./scripts/security/audit.sh
else
echo "No security audit script (ok)"
fi
# Job de release guard (cohérence release)
release-guard:
name: Release Guard
runs-on: ubuntu-latest
needs: [code-quality, unit-tests, documentation-tests, security-audit]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Ensure guard scripts are executable
run: |
chmod +x scripts/release/guard.sh || true
chmod +x scripts/checks/version_alignment.sh || true
- name: Version alignment check
run: |
if [ -f scripts/checks/version_alignment.sh ]; then
./scripts/checks/version_alignment.sh
else
echo "No version alignment script (ok)"
fi
- name: Release guard (CI verify)
env:
RELEASE_TYPE: ci-verify
run: |
if [ -f scripts/release/guard.sh ]; then
./scripts/release/guard.sh
else
echo "No guard script (ok)"
fi
# Job de tests de performance
performance-tests:
name: Performance Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
override: true
- name: Run performance tests
run: |
cd sdk_relay
cargo test --release --test performance_tests || true
- name: Check memory usage
run: |
# Tests de base de consommation mémoire
echo "Performance tests completed"
# Job de notification
notify:
name: Notify
runs-on: ubuntu-latest
needs: [code-quality, unit-tests, integration-tests, security-tests, docker-build, documentation-tests]
if: always()
steps:
- name: Notify success
if: needs.code-quality.result == 'success' && needs.unit-tests.result == 'success' && needs.integration-tests.result == 'success' && needs.security-tests.result == 'success' && needs.docker-build.result == 'success' && needs.documentation-tests.result == 'success'
run: |
echo "✅ All tests passed successfully!"
- name: Notify failure
if: needs.code-quality.result == 'failure' || needs.unit-tests.result == 'failure' || needs.integration-tests.result == 'failure' || needs.security-tests.result == 'failure' || needs.docker-build.result == 'failure' || needs.documentation-tests.result == 'failure'
run: |
echo "❌ Some tests failed!"
exit 1

View File

@ -1,40 +0,0 @@
# .gitea/workflows/template-sync.yml — synchronisation et contrôles dintégrité
name: 4NK Template Sync
on:
schedule: # planification régulière
- cron: "0 4 * * 1" # exécution hebdomadaire (UTC)
workflow_dispatch: {} # déclenchement manuel
jobs:
check-and-sync:
runs-on: linux
steps:
- name: Lire TEMPLATE_VERSION et .4nk-sync.yml
# Doit charger ref courant, source_repo et périmètre paths
- name: Récupérer la version publiée du template/4NK_rules
# Doit comparer TEMPLATE_VERSION avec ref amont
- name: Créer branche de synchronisation si divergence
# Doit créer chore/template-sync-<date> et préparer un commit
- name: Synchroniser les chemins autoritatifs
# Doit mettre à jour .cursor/**, .gitea/**, AGENTS.md, scripts/**, docs/SSH_UPDATE.md
- name: Contrôles post-sync (bloquants)
# 1) Vérifier présence et exécutable des scripts/*.sh
# 2) Vérifier mise à jour CHANGELOG.md et docs/INDEX.md
# 3) Vérifier docs/SSH_UPDATE.md si scripts/** a changé
# 4) Vérifier absence de secrets en clair dans scripts/**
# 5) Vérifier manifest_checksum si publié
- name: Tests, lint, sécurité statique
# Doit exiger un état vert
- name: Ouvrir PR de synchronisation
# Titre: "[template-sync] chore: aligner .cursor/.gitea/AGENTS.md/scripts"
# Doit inclure résumé des fichiers modifiés et la version appliquée
- name: Mettre à jour TEMPLATE_VERSION (dans PR)
# Doit remplacer la valeur par la ref appliquée

29
.gitignore vendored
View File

@ -1,3 +1,5 @@
archive/
# Dépendances
node_modules/
@ -17,7 +19,6 @@ pnpm-debug.log*
# Environnements
.env
.env.*
# Éditeurs / OS
.DS_Store
@ -28,8 +29,26 @@ pnpm-debug.log*
tests/logs/
tests/reports/
# Ne pas ignorer .cursor ni AGENTS.md
# Sauvegardes locales
*.backup
*.conf
*.toml
*.yml
*.yaml
*.json
*.csv
*.txt
*.log
*.log.*
*.log.*.*
*.log.*.*.*
*.log.*.*.*.*
*.log.*.*.*.*.*
*.log.*.*.*.*.*.*
*.log.*.*.*.*.*.*.*
*.log.*.*.*.*.*.*.*.*
!.cursor/
!AGENTS.md
certs/
*.log
# Ignore real configuration files, but keep example configs
tor_data/

14
.markdownlint.json Normal file
View File

@ -0,0 +1,14 @@
{
"MD013": {
"line_length": 200,
"code_blocks": false,
"tables": false,
"headings": false
},
"MD007": {
"indent": 2
},
"MD024": {
"siblings_only": true
}
}

View File

@ -1,5 +1,23 @@
## Changed (2025-09-08)
# Changelog - 4NK Node
## [1.1.3] - 2025-09-07
### Added
- Mise à jour mineure de versionnage et documentation (ALIGNEMENT VERSION / TESTS)
## [1.1.2] - 2025-08-27
### Added
- Scripts de déploiement initial:
- `scripts/deploy_first_install_with_certs.sh` (Lets Encrypt webroot + cron de renouvellement)
- `scripts/deploy_first_install_no_certs.sh` (autosigné)
### Changed
- Nginx: activation de HSTS (StrictTransportSecurity) sur lhôte public
- Documentation: INSTALLATION.md et CONFIGURATION.md enrichies (webroot ACME, renouvellement, déploiement automatisé)
Tous les changements notables de ce projet seront documentés dans ce fichier.
Le format est basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/),
@ -63,10 +81,16 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Changed
- `docker-compose.yml` : ajout dun mini serveur HTTP (busybox httpd) sur `sdk_signer` pour lendpoint de santé interne 9092, exposé via Nginx en `/signer/health`.
- `sdk_relay/healthcheck.sh` : assouplissement du healthcheck (attente dun indicateur de démarrage) pour éviter les faux négatifs durant la phase de rescan/initialisation.
- CI : publication automatique des releases sur push de tag `v*` via secret `RELEASE_TOKEN`.
### Fixed
- `/signer/health` retournait 502 via le reverse proxy; désormais HTTP 200 avec corps `ok`.
### Added
- Scripts de déploiement initial:
- `scripts/deploy_first_install_with_certs.sh` (Lets Encrypt webroot, cron de renouvellement)
- `scripts/deploy_first_install_no_certs.sh` (autosigné)
## [1.0.0] - 2024-12-19
### Added

View File

@ -51,11 +51,11 @@ git clone git@git.4nkweb.com:4nk/4NK_node.git
cd 4NK_node
# 2. Amorcer lenvironnement (git, Docker, Compose, Node/npm)
./scripts/bootstrap.sh
./scripts/orchestrate_start.sh
# Astuce: se déconnecter/reconnecter pour activer le groupe docker
# 3. Démarrer tous les services
./restart_4nk_node.sh
./scripts/restart_4nk_node.sh
# 4. Vérifier le statut
docker ps
@ -81,10 +81,10 @@ cat ~/.ssh/id_ed25519_4nk.pub
### 📖 Guides Principaux
- **[Guide d'Installation](docs/INSTALLATION.md)** - Installation et configuration complète
- **[Index de la documentation](docs/INDEX.md)** - Table des matières centrale
- **[Guide d'Utilisation](docs/USAGE.md)** - Utilisation quotidienne et cas d'usage
- **[Guide de Configuration](docs/CONFIGURATION.md)** - Configuration avancée
- **[Guide de Développement](docs/DEVELOPMENT.md)** - Développement et contribution
- **[Architecture](docs/ARCHITECTURE.md)** - Architecture détaillée
### 🔧 Guides Techniques
@ -101,9 +101,7 @@ cat ~/.ssh/id_ed25519_4nk.pub
### 🌐 Guides Réseau
- **[Réseau de Relais](docs/RELAY_NETWORK.md)** - Configuration du réseau mesh
- **[Nœuds Externes](docs/EXTERNAL_NODES.md)** - Ajout et gestion de nœuds externes
- **[Synchronisation](docs/SYNCHRONIZATION.md)** - Protocole de synchronisation
- **[Réseau et cartographie](docs/NETWORK.md)** - Hostnames, IP, ports, montages et routes Nginx
## 🔧 Configuration
@ -182,13 +180,13 @@ L'infrastructure supporte un réseau mesh de relais avec :
```bash
# Ajouter un nœud externe
./add_external_node.sh add external-relay-1 external-relay-1.example.com:8090
./scripts/add_external_node.sh add external-relay-1 external-relay-1.example.com:8090
# Lister les nœuds configurés
./add_external_node.sh list
./scripts/add_external_node.sh list
# Tester la connectivité
./add_external_node.sh test external-relay-1
./scripts/add_external_node.sh test external-relay-1
```
### Configuration Externe

1
TEMPLATE_VERSION Normal file
View File

@ -0,0 +1 @@
v2025.08.6

View File

@ -1 +1 @@
v1.1.1
v1.1.3

View File

@ -1,65 +0,0 @@
# Dockerfile optimisé pour l'intégration dans 4NK_node
FROM node:20-alpine AS builder
WORKDIR /app
# Installation des dépendances système
RUN apk update && apk add --no-cache \
git \
build-base \
python3 \
make \
g++ \
curl \
ca-certificates
# Copie des fichiers de dépendances
COPY package*.json ./
# Installation des dépendances (inclut les devDependencies nécessaires au build)
RUN npm install
# Copie du code source
COPY . .
# Préparation des dépendances wasm (pkg/sdk_client)
ARG SDK_CLIENT_PKG_URL=""
ARG SDK_CLIENT_PKG_TARBALL=""
ARG SDK_CLIENT_PKG_BASE="https://git.4nkweb.com/4nk/ihm_client/raw/branch/docker-support/pkg"
ENV SDK_CLIENT_PKG_URL=${SDK_CLIENT_PKG_URL}
ENV SDK_CLIENT_PKG_TARBALL=${SDK_CLIENT_PKG_TARBALL}
ENV SDK_CLIENT_PKG_BASE=${SDK_CLIENT_PKG_BASE}
RUN chmod +x ./scripts/setup-remote-deps.sh && npm run build_wasm
# Build de l'application
RUN npm run build
# Image de production
FROM nginx:alpine
# Installation de Node.js pour les scripts de démarrage
RUN apk update && apk add --no-cache nodejs npm wget
# Copie des fichiers buildés
COPY --from=builder /app/dist /usr/share/nginx/html
COPY --from=builder /app/package*.json /app/
# Copie de la configuration nginx optimisée pour 4NK_node
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN sed -i 's|types_hash_max_size .*;|types_hash_max_size 4096;|' /etc/nginx/nginx.conf || true
# Script de démarrage
COPY start.sh /start-4nk-node.sh
RUN chmod +x /start-4nk-node.sh
# Exposition des ports
EXPOSE 80 3003
# Variables d'environnement pour 4NK_node
ENV SDK_RELAY_WS_URL=ws://sdk_relay_1:8090
ENV SDK_RELAY_HTTP_URL=http://sdk_relay_1:8091
ENV BITCOIN_RPC_URL=http://bitcoin:18443
ENV BLINDBIT_URL=http://blindbit:8000
# Point d'entrée
CMD ["/start-4nk-node.sh"]

View File

@ -1,123 +0,0 @@
#!/bin/sh
set -e
echo "🚀 Démarrage de l'interface utilisateur 4NK..."
# Variables d'environnement avec valeurs par défaut
SDK_RELAY_WS_URL=${SDK_RELAY_WS_URL:-"ws://sdk_relay_1:8090"}
SDK_RELAY_HTTP_URL=${SDK_RELAY_HTTP_URL:-"http://sdk_relay_1:8091"}
BITCOIN_RPC_URL=${BITCOIN_RPC_URL:-"http://bitcoin:18443"}
BLINDBIT_URL=${BLINDBIT_URL:-"http://blindbit:8000"}
# Fonction pour attendre qu'un service soit disponible
wait_for_service() {
local service_name=$1
local service_url=$2
local max_attempts=30
local attempt=1
echo "⏳ Attente du service $service_name ($service_url)..."
while [ $attempt -le $max_attempts ]; do
if wget --quiet --tries=1 --timeout=5 --spider "$service_url" 2>/dev/null; then
echo "✅ Service $service_name disponible"
return 0
fi
echo " Tentative $attempt/$max_attempts - Service $service_name non disponible"
sleep 2
attempt=$((attempt + 1))
done
echo "❌ Service $service_name non disponible après $max_attempts tentatives"
return 1
}
# Fonction pour vérifier la connectivité WebSocket
check_websocket() {
local service_name=$1
local ws_url=$2
local max_attempts=10
local attempt=1
echo "🔌 Vérification WebSocket $service_name ($ws_url)..."
while [ $attempt -le $max_attempts ]; do
if nc -z $(echo $ws_url | sed 's|ws://||' | sed 's|wss://||' | cut -d: -f1) $(echo $ws_url | cut -d: -f3) 2>/dev/null; then
echo "✅ WebSocket $service_name accessible"
return 0
fi
echo " Tentative $attempt/$max_attempts - WebSocket $service_name non accessible"
sleep 3
attempt=$((attempt + 1))
done
echo "⚠️ WebSocket $service_name non accessible (continuera sans)"
return 0
}
# Vérification des services critiques
echo "🔍 Vérification des services 4NK_node..."
# Les relays sont disponibles, l'interface utilisateur se connectera via WebSocket
echo "✅ Services 4NK_node prêts"
echo "🔄 L'interface utilisateur démarrera et se connectera aux relais via WebSocket"
# Vérifier sdk_relay WebSocket (optionnel)
check_websocket "sdk_relay WebSocket" "$SDK_RELAY_WS_URL"
# Bitcoin Core est disponible, l'interface utilisateur se connectera directement
echo "✅ Bitcoin Core disponible"
echo "🔄 L'interface utilisateur se connectera directement à Bitcoin Core"
# Blindbit est disponible, l'interface utilisateur se connectera directement
echo "✅ Blindbit disponible"
echo "🔄 L'interface utilisateur se connectera directement à Blindbit"
# Génération de la configuration dynamique
echo "⚙️ Génération de la configuration dynamique..."
# Créer un fichier de configuration JavaScript pour l'application
# Pour l'accès via reverse proxy public, utiliser des chemins relatifs /ws et /api
cat > /usr/share/nginx/html/config.js << 'EOF'
window.ENV_CONFIG = {
SDK_RELAY_WS_URL: '/ws',
SDK_RELAY_HTTP_URL: '/api',
ENVIRONMENT: '4nk-node'
};
EOF
# Démarrage de nginx
echo "🌐 Démarrage de nginx..."
nginx -g "daemon off;" &
# Attendre que nginx soit prêt
sleep 2
# Vérifier que nginx fonctionne
if ! wget --quiet --tries=1 --timeout=5 --spider http://localhost 2>/dev/null; then
echo "❌ Nginx n'a pas démarré correctement"
exit 1
fi
echo "✅ Interface utilisateur 4NK démarrée avec succès"
echo " 📍 URL: http://localhost"
echo " 🔌 WebSocket: $SDK_RELAY_WS_URL"
echo " 🌐 API: $SDK_RELAY_HTTP_URL"
# Maintenir le conteneur en vie
while true; do
sleep 30
# Vérification périodique de la santé
if ! wget --quiet --tries=1 --timeout=5 --spider http://localhost 2>/dev/null; then
echo "❌ Nginx ne répond plus, redémarrage..."
nginx -s reload
fi
# Vérification périodique des relais (optionnel)
echo "✅ Interface utilisateur opérationnelle"
echo "🌐 Accessible sur http://localhost:8080"
done

View File

@ -1,77 +0,0 @@
#!/bin/bash
set -e
echo "🚀 Démarrage de l'infrastructure 4NK_node avec interface utilisateur..."
# Vérifier que nous sommes dans le bon répertoire
if [[ ! -f "docker-compose.yml" ]]; then
echo "❌ Ce script doit être exécuté depuis le répertoire 4NK_node"
exit 1
fi
# Arrêter et nettoyer les conteneurs existants
echo "🧹 Nettoyage des conteneurs existants..."
docker-compose down
# Démarrer tous les services
echo "📦 Démarrage de tous les services..."
docker-compose up -d
# Attendre que les services critiques soient prêts
echo "⏳ Attente du démarrage des services critiques..."
sleep 30
# Vérifier la santé des services
echo "🔍 Vérification de la santé des services..."
# Bitcoin
if docker-compose ps bitcoin | grep -q "Up"; then
echo "✅ Bitcoin démarré"
else
echo "❌ Bitcoin n'est pas démarré"
docker-compose logs bitcoin
fi
# Blindbit
if docker-compose ps blindbit | grep -q "Up"; then
echo "✅ Blindbit démarré"
else
echo "❌ Blindbit n'est pas démarré"
docker-compose logs blindbit
fi
# SDK Relays
for i in {1..3}; do
if docker-compose ps "sdk_relay_$i" | grep -q "Up"; then
echo "✅ SDK Relay $i démarré"
else
echo "❌ SDK Relay $i n'est pas démarré"
docker-compose logs "sdk_relay_$i"
fi
done
# Interface utilisateur
if docker-compose ps ihm_client | grep -q "Up"; then
echo "✅ Interface utilisateur démarrée"
else
echo "❌ Interface utilisateur n'est pas démarrée"
docker-compose logs ihm_client
fi
echo ""
echo "🎉 Infrastructure 4NK_node démarrée avec succès !"
echo ""
echo "📍 URLs d'accès :"
echo " 🌐 Interface utilisateur: http://localhost:8080"
echo " 🔗 Bitcoin RPC: http://localhost:18443"
echo " 🔗 Blindbit: http://localhost:8000"
echo " 🔗 SDK Relay 1: http://localhost:8091"
echo " 🔗 SDK Relay 2: http://localhost:8093"
echo " 🔗 SDK Relay 3: http://localhost:8095"
echo ""
echo "🔍 Commandes utiles :"
echo " 📋 Statut des services: docker-compose ps"
echo " 📋 Logs d'un service: docker-compose logs <service_name>"
echo " 📋 Arrêter l'infrastructure: docker-compose down"
echo " 📋 Redémarrer un service: docker-compose restart <service_name>"

View File

@ -1,30 +0,0 @@
#!/bin/bash
set -e
echo "🚀 Démarrage de l'interface utilisateur 4NK..."
# Vérifier que nous sommes dans le bon répertoire
if [[ ! -f "docker-compose.yml" ]]; then
echo "❌ Ce script doit être exécuté depuis le répertoire 4NK_node"
exit 1
fi
# Démarrer uniquement le service ihm_client
echo "📦 Démarrage du service ihm_client..."
docker-compose up -d ihm_client
# Attendre que le service soit prêt
echo "⏳ Attente du démarrage..."
sleep 10
# Vérifier la santé du service
if docker-compose ps ihm_client | grep -q "Up"; then
echo "✅ Interface utilisateur démarrée avec succès"
echo " 📍 URL: http://localhost:8080"
echo " 🔍 Logs: docker logs 4nk-ihm-client"
else
echo "❌ Échec du démarrage de l'interface utilisateur"
docker-compose logs ihm_client
exit 1
fi

View File

@ -1,663 +0,0 @@
# Commandes Exactes - Arrêt et Redémarrage 4NK Node
## 📅 Date : $(date)
## 🎯 Motif : Redémarrage propre pour intégrer dev3.4nkweb.com
---
## 🛑 **1. ARRÊT DE TOUS LES SERVICES**
```bash
# Arrêt de tous les conteneurs
docker stop $(docker ps -q) 2>/dev/null || true
# Arrêt de docker-compose
docker-compose down -v 2>/dev/null || true
# Vérification qu'aucun conteneur ne tourne
docker ps
```
**Output attendu :**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
```
---
## 🧹 **2. NETTOYAGE COMPLET**
```bash
# Suppression de tous les conteneurs
docker rm -f $(docker ps -aq) 2>/dev/null || true
```
**Output reçu :**
```
38b00bb9a73d
82832dff9e65
27eb26cf34de
dcc0733ff65a
cf89e4d5d99a
8f5815486a1d
```
```bash
# Nettoyage des réseaux
docker network prune -f
```
**Output reçu :**
```
Deleted Networks:
4nk_node_btcnet
```
---
## 🌐 **3. CRÉATION DU RÉSEAU**
```bash
# Création du réseau Docker
docker network create 4nk_node_btcnet
```
**Output reçu :**
```
5242f77defc3539b050defd7e1a144e1e066b28010ae97ad6b4e4a1eb553bfe7
```
---
## 🚀 **4. DÉMARRAGE DANS L'ORDRE LOGIQUE**
### **4.1 Tor Proxy**
```bash
docker run -d --name tor-proxy --network 4nk_node_btcnet --network-alias tor -p 9050:9050 -p 9051:9051 dperson/torproxy:latest
```
**Output reçu :**
```
b2ae583570d4435cd5dcc41f44df8ff33445d4bf2bcbbfcdee0e0a239e7c3a28
```
```bash
sleep 5 && docker ps | grep tor
```
**Output reçu :**
```
b2ae583570d4 dperson/torproxy:latest "/sbin/tini -- /usr/…" 10 seconds ago Up 9 seconds (health: starting) 8118/tcp, 0.0.0.0:9050-9051->9050-9051/tcp, :::9050-9051->9050-9051/tcp tor-proxy
```
---
### **4.2 Bitcoin Core**
```bash
docker run -d --name bitcoin-signet --network 4nk_node_btcnet --network-alias bitcoin -p 38333:38333 -p 18443:18443 -p 29000:29000 -v bitcoin_data:/home/bitcoin/.bitcoin -v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf 4nk_node_bitcoin
```
**Output reçu :**
```
166a88e6817ecd680a41cf4a0a34b654df19fdd15ed408a53338ebb5bf4bbb98
```
```bash
sleep 10 && docker ps | grep bitcoin
```
**Output reçu :**
```
166a88e6817e 4nk_node_bitcoin "bitcoind -conf=/hom…" 17 seconds ago Up 17 seconds 0.0.0.0:18443->18443/tcp, :::18443->18443/tcp, 0.0.0.0:29000->29000/tcp, :::29000->29000/tcp, 0.0.0.0:38333->38333/tcp, :::38333->38333/tcp, 38332/tcp bitcoin-signet
```
---
### **4.3 Blindbit Oracle**
```bash
docker run -d --name blindbit-oracle --network 4nk_node_btcnet --network-alias blindbit -p 8000:8000 -v blindbit_data:/data -v /home/desk/Téléchargements/code/4NK/4NK_node/blindbit/blindbit.toml:/data/blindbit.toml -v bitcoin_data:/home/bitcoin/.bitcoin 4nk_node_blindbit
```
**Output reçu :**
```
34e41782e0633b140be2c2c330a1a769a6d1359938e1e5ea71b63153ab518422
```
```bash
sleep 10 && docker ps | grep blindbit
```
**Output reçu :**
```
34e41782e063 4nk_node_blindbit "blindbit-oracle -da…" 17 seconds ago Up 16 seconds 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp
blindbit-oracle
```
---
### **4.4 Construction de l'image sdk_relay**
```bash
docker build -f sdk_relay/Dockerfile -t 4nk_node_sdk_relay_1 ..
```
**Output reçu :**
```
Sending build context to Docker daemon 3.565GB
Step 1/18 : FROM rust:1.89 as builder
---> 981f4ce4cc18
Step 2/18 : WORKDIR /app
---> Running in 573f36d06e36
Removing intermediate container 573f36d06e36
---> aa59cfb8256c
Step 3/18 : RUN git clone --branch docker-support --depth 1 https://git.4nkweb.com/4nk/sdk_relay.git /app/sdk_relay
---> Running in a2ccf06e69ad
Cloning into '/app/sdk_relay'...
Removing intermediate container a2ccf06e69ad
---> 5f2a42297ff5
Step 4/18 : RUN git clone --branch docker-support --depth 1 https://git.4nkweb.com/4nk/sdk_common.git /app/sdk_common
---> Running in 8c005a625047
Cloning into '/app/sdk_common'...
Removing intermediate container 8c005a625047
---> 69692c0f4cd8
Step 5/18 : WORKDIR /app/sdk_relay
---> Running in fca1b2a220ec
Removing intermediate container fca1b2a220ec
---> 871a1bfc3172
Step 6/18 : RUN sed -i 's|git = "https://git.4nkweb.com/4nk/sdk_common.git", branch = "dev"|path = "/app/sdk_common"|' Cargo.toml && cargo build --release
---> Running in 6758cf72abe6
Updating crates.io index
Updating git repository `https://git.4nkweb.com/4nk/sdk_common.git`
Updating git repository `https://github.com/Sosthene00/sp-client.git`
Updating git repository `https://github.com/Sosthene00/tsify`
Downloading crates ...
Downloaded aead v0.5.2
Downloaded adler2 v2.0.1
Downloaded untrusted v0.9.0
Downloaded want v0.3.1
Downloaded universal-hash v0.5.1
Downloaded async-trait v0.1.89
Downloaded asynchronous-codec v0.7.0
Downloaded anyhow v1.0.99
Downloaded version_check v0.9.5
Downloaded utf8_iter v1.0.4
Downloaded utf-8 v0.7.6
Downloaded aes-gcm v0.10.3
Downloaded base64 v0.13.1
Downloaded uuid v1.18.0
Downloaded bitcoin-internals v0.2.0
Downloaded futures-core v0.3.31
Downloaded futures-macro v0.3.31
Downloaded futures-executor v0.3.31
Downloaded ident_case v1.0.1
Downloaded hex v0.4.3
Downloaded aes v0.8.4
Downloaded bech32 v0.9.1
Downloaded num-traits v0.2.19
Downloaded once_cell v1.21.3
Downloaded proc-macro2 v1.0.101
Downloaded quote v1.0.40
Downloaded dyn-clone v1.0.20
Downloaded gloo-utils v0.1.7
Downloaded hex_lit v0.1.1
Downloaded autocfg v1.5.0
Downloaded cfg_aliases v0.2.1
Downloaded equivalent v1.0.2
Downloaded darling_macro v0.20.11
Downloaded fnv v1.0.7
Downloaded displaydoc v0.2.5
Downloaded either v1.15.0
Downloaded crossbeam-utils v0.8.21
Downloaded rand_core v0.6.4
Downloaded rand_chacha v0.3.1
Downloaded futures-sink v0.3.31
Downloaded futures-io v0.3.31
Downloaded ghash v0.5.1
Downloaded futures v0.3.31
Downloaded http-body v1.0.1
Downloaded getrandom v0.3.3
Downloaded rustversion v1.0.22
Downloaded inout v0.1.4
Downloaded indexmap v1.9.3
Downloaded scopeguard v1.2.0
Downloaded ryu v1.0.20
Downloaded bumpalo v3.19.0
Downloaded byteorder v1.5.0
Downloaded serde_derive v1.0.219
Downloaded cipher v0.4.4
Downloaded bitcoin_hashes v0.13.0
Downloaded sha2 v0.10.9
Downloaded shlex v1.3.0
Downloaded crossbeam-epoch v0.9.18
Downloaded sha1 v0.10.6
Downloaded futures-task v0.3.31
Downloaded env_logger v0.9.3
Downloaded http-body-util v0.1.3
Downloaded iana-time-zone v0.1.63
Downloaded hyper-rustls v0.27.7
Downloaded iri-string v0.7.8
Downloaded jobserver v0.1.33
Downloaded url v2.5.6
Downloaded jsonrpc v0.14.1
Downloaded polyval v0.6.2
Downloaded zerofrom v0.1.6
Downloaded zerofrom-derive v0.1.6
Downloaded try-lock v0.2.5
Downloaded humantime v2.2.0
Downloaded form_urlencoded v1.2.2
Downloaded wasm-bindgen-macro-support v0.2.100
Downloaded hex-conservative v0.1.2
Downloaded zeroize v1.8.1
Downloaded wasm-bindgen-backend v0.2.100
Downloaded crc32fast v1.5.0
Downloaded zstd v0.13.3
Downloaded zstd-safe v7.2.4
Downloaded subtle v2.6.1
Downloaded slab v0.4.11
Downloaded tokio-macros v2.5.0
Downloaded tinyvec v1.10.0
Downloaded stable_deref_trait v1.2.0
Downloaded thiserror-impl v1.0.69
Downloaded num-conv v0.1.0
Downloaded tokio-rustls v0.26.2
Downloaded lru-slab v0.1.2
Downloaded js-sys v0.3.77
Downloaded zerovec-derive v0.11.1
Downloaded futures-util v0.3.31
Downloaded thiserror-impl v2.0.16
Downloaded tokio-stream v0.1.17
Downloaded socket2 v0.5.10
Downloaded smallvec v1.15.1
Downloaded flate2 v1.1.2
Downloaded unicode-ident v1.0.18
Downloaded rand_core v0.9.3
Downloaded idna v1.1.0
Downloaded rand_chacha v0.9.0
Downloaded chrono v0.4.41
Downloaded thiserror v1.0.69
Downloaded hashbrown v0.14.5
Downloaded rustls-pki-types v1.12.0
Downloaded rustc-hash v2.1.1
Downloaded icu_properties_data v2.0.1
Downloaded strsim v0.11.1
Downloaded tokio-tungstenite v0.21.0
Downloaded indexmap v2.10.0
Downloaded typenum v1.18.0
Downloaded tower-http v0.6.6
Downloaded bitcoin v0.31.2
Downloaded writeable v0.6.1
Downloaded itoa v1.0.15
Downloaded lock_api v0.4.13
Downloaded yoke v0.8.0
Downloaded litemap v0.8.0
Downloaded time v0.3.41
Downloaded log v0.4.27
Downloaded tower v0.5.2
Downloaded pin-project-lite v0.2.16
Downloaded parking_lot_core v0.9.11
Downloaded serde_urlencoded v0.7.1
Downloaded hyper v1.7.0
Downloaded icu_normalizer_data v2.0.0
Downloaded signal-hook-registry v1.4.6
Downloaded opaque-debug v0.3.1
Downloaded wasm-bindgen-macro v0.2.100
Downloaded wasm-bindgen-shared v0.2.100
Downloaded wasm-bindgen v0.2.100
Downloaded icu_locale_core v2.0.0
Downloaded icu_collections v2.0.0
Downloaded icu_provider v2.0.0
Downloaded icu_properties v2.0.1
Downloaded icu_normalizer v2.0.0
Downloaded futures-executor v0.3.31
Downloaded asynchronous-codec v0.7.0
Downloaded futures v0.3.31
Downloaded idna_adapter v1.2.1
Downloaded idna v1.1.0
Downloaded web-sys v0.3.77
Downloaded bitcoin_hashes v0.13.0
Downloaded hyper v1.7.0
Downloaded url v2.5.6
Downloaded secp256k1 v0.28.2
Downloaded rustls-webpki v0.103.4
Downloaded hyper-util v0.1.16
Downloaded tokio-util v0.7.16
Downloaded tower v0.5.2
Downloaded hex v0.4.3
Downloaded silentpayments v0.4.1
Downloaded async-compression v0.4.27
Downloaded serde_urlencoded v0.7.1
Downloaded tower-http v0.6.6
Downloaded gloo-utils v0.1.7
Downloaded tsify v0.4.5 (https://github.com/Sosthene00/tsify?branch=next#8a5a550d)
Downloaded jsonrpc v0.14.1
Downloaded tungstenite v0.21.0
Downloaded zeromq v0.4.1
Downloaded tokio-stream v0.1.17
Downloaded serde_with v3.14.0
Downloaded tokio-tungstenite v0.21.0
Downloaded tokio-rustls v0.26.2
Downloaded hyper-rustls v0.27.7
Downloaded reqwest v0.12.23
Downloaded bitcoincore-rpc-json v0.18.0
Downloaded zstd v0.13.3
Downloaded backend-blindbit-native v0.1.0 (https://github.com/Sosthene00/sp-client.git?branch=dev#878228f6)
Downloaded bitcoincore-rpc v0.18.0
Downloaded sdk_common v0.1.0 (https://git.4nkweb.com/4nk/sdk_common.git?branch=docker-support#a4c2fd20)
Downloaded sdk_relay v0.1.0 (/app/sdk_relay)
warning: unused imports: `OutPoint`, `Psbt`, `Sequence`, `TxIn`, `TxOut`, and `block`
--> src/daemon.rs:10:5
|
10 | block, Address, Amount, Block, BlockHash, Network, OutPoint, Psbt, ScriptBuf, Sequence,
| ^^^^^ ^^^^^^^^ ^^^^ ^^^^^^^^
11 | Transaction, TxIn, TxOut, Txid,
| ^^^^ ^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `collections::HashMap`
--> src/faucet.rs:1:11
|
1 | use std::{collections::HashMap, str::FromStr};
| ^^^^^^^^^^^^^^^^^
warning: unused import: `std::str::FromStr`
--> src/scan.rs:3:5
|
3 | use std::str::FromStr;
| ^^^^^^^^^
warning: unused imports: `All`, `Scalar`, and `Secp256k1`
--> src/scan.rs:22:49
|
22 | use sdk_common::sp_client::bitcoin::secp256k1::{All, PublicKey, Scalar, Secp256k1, SecretKey};
| ^^^ ^^^^^^ ^^^^^^^^^
warning: unused imports: `OutPointMemberMap` and `OutPointProcessMap`
--> src/sync.rs:17:21
|
17 | serialization::{OutPointMemberMap, OutPointProcessMap},
| ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
warning: unused import: `std::fs`
--> src/sync.rs:1043:13
|
1043 | use std::fs;
| ^^^^^^^
warning: multiple methods are never used
--> src/daemon.rs:413:8
|
406 | pub(crate) trait RpcCall: Send + Sync + std::fmt::Debug {
| ------- methods in this trait
...
413 | fn get_relay_fee(&self) -> Result<Amount>;
| ^^^^^^^^^
...
417 | fn get_block(&self, block_hash: BlockHash) -> Result<Block>;
| ^^^^^^^^^
419 |
420 | fn get_filters(&self, block_height: u32) -> Result<(u32, BlockHash, BlockFilter)>;
| ^^^^^^^^^^^
...
446 | fn get_transaction_info(&self, txid: &Txid, blockhash: Option<BlockHash>) -> Result<Value>;
| ^^^^^^^^^
...
448 | fn get_transaction_hex(&self, txid: &Txid, blockhash: Option<BlockHash>) -> Result<Value>;
| ^^^^^^^^^
...
452 | fn get_block_txids(&self, blockhash: BlockHash) -> Result<Vec<Txid>>;
| ^^^^^^^^^
...
454 | fn get_mempool_txids(&self) -> Result<Vec<Txid>>;
| ^^^^^^^^^
...
456 | fn get_mempool_entries(
| ^^^^^^^^^
...
461 | fn get_mempool_transactions(&self, txids: &[Txid]) -> Result<Vec<Result<Transaction>>>;
| ^^^^^^^^^
...
463 | |
| = note: `#[warn(dead_code)]` on by default
warning: function `check_block` is never used
--> src/scan.rs:105:4
|
105 | fn check_block(
| ^^^^^^^^^
warning: function `scan_block_outputs` is never used
--> src/scan.rs:105:4
|
125 | fn scan_block_outputs(
| ^^^^^^^^^^^
warning: function `scan_block_inputs` is never used
--> src/scan.rs:211:4
|
211 | fn scan_block_inputs(
| ^^^^^^^^^
warning: associated items `new` and `to_string` are never used
--> src/sync.rs:212:12
|
211 | impl SyncRequest {
| ---------------- associated items in this implementation
212 | pub fn new(request_id: String, relay_id: String, sync_types: Vec<SyncType>) -> Self {
| ^^^^^^^^^
...
222 | pub fn to_string(&self) -> String {
| ^^^^^^^^^
warning: field `last_sync` is never read
--> src/sync.rs:261:5
|
257 | pub struct SyncManager {
| ------------ field in this struct
...
261 | last_sync: Arc<Mutex<HashMap<SyncType, u64>>>,
| ^^^^^^^^^
|
| note: `SyncManager` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
warning: fields `sync_requests` and `sync_responses` are never read
--> src/sync.rs:272:9
|
269 | pub struct SyncMetrics {
| ------------ fields in this struct
...
272 | pub sync_requests: u64,
| ^^^^^^^^^
273 | pub sync_responses: u64,
| ^^^^^^^^^^^
|
| note: `SyncMetrics` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
warning: methods `create_peer_sync`, `request_sync`, `get_known_relays`, and `get_network_topology` are never used
--> src/sync.rs:481:12
|
293 | impl SyncManager {
| ---------------- methods in this implementation
...
481 | pub fn create_peer_sync(&self) -> Result<SyncMessage> {
| ^^^^^^^^^
...
923 | pub fn request_sync(&self, sync_types: Vec<SyncType>, target_addr: SocketAddr) -> Result<()> {
| ^^^^^^^^^
...
953 | pub fn get_known_relays(&self) -> Vec<RelayInfo> {
| ^^^^^^^^^
...
958 | pub fn get_network_topology(&self) -> NetworkTopology {
| ^^^^^^^^^
...
960 | |
| = note: `#[warn(dead_code)]` on by default
warning: `sdk_relay` (bin "sdk_relay") generated 14 warnings (run `cargo fix --bin "sdk_relay"` to apply 6 suggestions)
Finished `release` profile [optimized] target(s) in 43.55s
Removing intermediate container 6758cf72abe6
---> ff00567ef787
Step 7/18 : FROM debian:bookworm-slim
---> f813b63f015b
Step 8/18 : RUN apt-get update && apt-get install -y ca-certificates curl strace net-tools procps && rm -rf /var/lib/apt/lists/*
---> Using cache
---> a90ceb3ece09
Step 9/18 : COPY --from=builder /app/sdk_relay/target/release/sdk_relay /usr/local/bin/sdk_relay
---> d3f8fcd8d1aa
Step 10/18 : RUN groupadd -g 1000 bitcoin && useradd -m -d /home/bitcoin -g bitcoin bitcoin
---> Running in a44a5d1a164b
Removing intermediate container a44a5d1a164b
---> c03f33299aa3
Step 11/18 : WORKDIR /home/bitcoin
---> Running in 3e59a64e6564
Removing intermediate container 3e59a64e6564
---> 1ec4365679c4
Step 12/18 : RUN mkdir -p /home/bitcoin/.4nk
---> Running in 62f7f23623a3
Removing intermediate container 62f7f23623a3
---> 33b4878b4736
Step 13/18 : COPY 4NK_node/sdk_relay/.conf /home/bitcoin/.conf
---> 094a575cb271
Step 14/18 : COPY 4NK_node/sdk_relay/healthcheck.sh /usr/local/bin/healthcheck.sh
---> ff2a9e65d8ac
Step 15/18 : RUN chown -R bitcoin:bitcoin /home/bitcoin
---> Running in 4b7bb423717d
Removing intermediate container 4b7bb423717d
---> 7bd220b71d06
Step 16/18 : USER bitcoin
---> Running in 292ab8a8bbb0
Removing intermediate container 292ab8a8bbb0
---> 7d840368144b
Step 17/18 : EXPOSE 8090 8091
---> Running in da20b09606c4
Removing intermediate container da20b09606c4
---> 3539f4c41a52
Step 18/18 : CMD ["/bin/bash"]
---> Running in 2adcdd633e62
Removing intermediate container 2adcdd633e62
---> 70c4624704d3
Successfully built 70c4624704d3
Successfully tagged 4nk_node_sdk_relay_1:latest
```
---
### **4.5 Relay 1**
```bash
docker run -d --name sdk_relay_1 --network 4nk_node_btcnet --network-alias sdk_relay_1 -p 8090:8090 -p 8091:8091 -v bitcoin_data:/home/bitcoin/.bitcoin -v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf -v sdk_relay_1_data:/home/bitcoin/.4nk -v /home/desk/Téléchargements/code/4NK/4NK_node/sdk_relay/.conf.docker.relay1:/home/bitcoin/.conf.docker -e RUST_LOG=debug,bitcoincore_rpc=trace -e HOME=/home/bitcoin -e BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie -e ENABLE_SYNC_TEST=1 4nk_node_sdk_relay_1 /bin/sh -c "cp /home/bitcoin/.conf.docker /home/bitcoin/.conf && cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie && chmod 600 /home/bitcoin/.4nk/bitcoin.cookie && /usr/local/bin/sdk_relay --config .conf"
```
**Output reçu :**
```
2f8b0dd684e18cc2850a74238d673b012b29d875106ba5c94d08d8d17ea7d933
```
```bash
sleep 10 && docker ps | grep sdk_relay_1
```
**Output reçu :**
```
2f8b0dd684e1 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 19 seconds ago Up 18 seconds 0.0.0.0:8090-8091->8090-8091/tcp, :::8090-8091->8090-8091/tcp
sdk_relay_1
```
---
### **4.6 Relay 2**
```bash
docker run -d --name sdk_relay_2 --network 4nk_node_btcnet --network-alias sdk_relay_2 -p 8092:8090 -p 8093:8091 -v bitcoin_data:/home/bitcoin/.bitcoin -v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf -v sdk_relay_2_data:/home/bitcoin/.4nk -v /home/desk/Téléchargements/code/4NK/4NK_node/sdk_relay/.conf.docker.relay2:/home/bitcoin/.conf.docker -e RUST_LOG=debug,bitcoincore_rpc=trace -e HOME=/home/bitcoin -e BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie -e ENABLE_SYNC_TEST=1 4nk_node_sdk_relay_1 /bin/sh -c "cp /home/bitcoin/.conf.docker /home/bitcoin/.conf && cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie && chmod 600 /home/bitcoin/.4nk/bitcoin.cookie && /usr/local/bin/sdk_relay --config .conf"
```
**Output reçu :**
```
e8f2907a4ba38424787fd90427aa7f1ccf0d6fb5eb0f7dc434a0d6a0d9d1494f
```
```bash
sleep 10 && docker ps | grep sdk_relay_2
```
**Output reçu :**
```
e8f2907a4ba3 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 17 seconds ago Up 16 seconds 0.0.0.0:8092->8090/tcp, :::8092->8090/tcp, 0.0.0.0:8093->8091/tcp, :::8093->8091/tcp
sdk_relay_2
```
---
### **4.7 Relay 3**
```bash
docker run -d --name sdk_relay_3 --network 4nk_node_btcnet --network-alias sdk_relay_3 -p 8094:8090 -p 8095:8091 -v bitcoin_data:/home/bitcoin/.bitcoin -v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf -v sdk_relay_3_data:/home/bitcoin/.4nk -v /home/desk/Téléchargements/code/4NK/4NK_node/sdk_relay/.conf.docker.relay3:/home/bitcoin/.conf.docker -e RUST_LOG=debug,bitcoincore_rpc=trace -e HOME=/home/bitcoin -e BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie -e ENABLE_SYNC_TEST=1 4nk_node_sdk_relay_1 /bin/sh -c "cp /home/bitcoin/.conf.docker /home/bitcoin/.conf && cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie && chmod 600 /home/bitcoin/.4nk/bitcoin.cookie && /usr/local/bin/sdk_relay --config .conf"
```
**Output reçu :**
```
e969cb2ead8151e74dfd3cd8eabddcedac551c2a52f0377a182c3ffe15305b90
```
```bash
sleep 10 && docker ps | grep sdk_relay_3
```
**Output reçu :**
```
e969cb2ead81 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 16 seconds ago Up 15 seconds 0.0.0.0:8094->8090/tcp, :::8094->8090/tcp, 0.0.0.0:8095->8091/tcp, :::8095->8091/tcp
sdk_relay_3
```
---
## 🎯 **5. VÉRIFICATION FINALE**
```bash
docker ps
```
**Output reçu :**
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e969cb2ead81 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 21 seconds ago Up 20 seconds 0.0.0.0:8094->8090/tcp, :::8094->8090/tcp, 0.0.0.0:8095->8091/tcp, :::8095->8091/tcp sdk_relay_3
e8f2907a4ba3 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 46 seconds ago Up 45 seconds 0.0.0.0:8092->8090/tcp, :::8092->8090/tcp, 0.0.0.0:8093->8091/tcp, :::8093->8091/tcp sdk_relay_2
2f8b0dd684e1 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" About a minute ago Up About a minute 0.0.0.0:8090-8091->8090-8091/tcp, :::8090-8091->8090-8091/tcp sdk_relay_1
34e41782e063 4nk_node_blindbit "blindbit-oracle -da…" 3 minutes ago Up 3 minutes 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp blindbit-oracle
166a88e6817e 4nk_node_bitcoin "bitcoind -conf=/hom…" 3 minutes ago Up 3 minutes 0.0.0.0:18443->18443/tcp, :::18443->18443/tcp, 0.0.0.0:29000->29000/tcp, :::29000->29000/tcp, 0.0.0.0:38333->38333/tcp, :::38333->38333/tcp, 38332/tcp bitcoin-signet
b2ae583570d4 dperson/torproxy:latest "/sbin/tini -- /usr/…" 3 minutes ago Up 3 minutes (healthy) 8118/tcp, 0.0.0.0:9050-9051->9050-9051/tcp, :::9050-9051->9050-9051/tcp tor-proxy
```
---
## 📊 **RÉSUMÉ DES SERVICES ACTIFS**
| Service | Conteneur | Ports | Statut |
|---------|-----------|-------|---------|
| **Tor Proxy** | `tor-proxy` | 9050, 9051 | ✅ Healthy |
| **Bitcoin Core** | `bitcoin-signet` | 38333, 18443, 29000 | ✅ Running |
| **Blindbit Oracle** | `blindbit-oracle` | 8000 | ✅ Running |
| **Relay 1** | `sdk_relay_1` | 8090, 8091 | ✅ Running |
| **Relay 2** | `sdk_relay_2` | 8092, 8093 | ✅ Running |
| **Relay 3** | `sdk_relay_3` | 8094, 8095 | ✅ Running |
---
## 🎉 **RÉSULTAT FINAL**
**6 services** en cours d'exécution
**3 relais** configurés pour la synchronisation
**Configuration externe** prête pour dev3.4nkweb.com
**Tous les ports** correctement exposés
**Volumes persistants** préservés
**L'infrastructure 4NK Node est maintenant complètement opérationnelle !**

View File

@ -1,218 +0,0 @@
# Configuration du Relais dev3.4nkweb.com
## 📋 Informations du Relais
- **Nom** : dev3-relay
- **URL** : dev3.4nkweb.com
- **Port** : 443 (HTTPS/WSS)
- **Chemin WebSocket** : `/ws/`
- **URL complète** : `wss://dev3.4nkweb.com:443/ws/`
- **Version** : Ancienne version (sans synchronisation)
- **SSL/TLS** : Activé (Let's Encrypt)
## 🔧 Configuration Actuelle
### Fichier de configuration externe
```toml
# external_nodes.conf
[relays]
dev3-relay = "dev3.4nkweb.com:443"
```
### Configuration spéciale requise
Le relais dev3.4nkweb.com nécessite une configuration spéciale car :
1. **WSS au lieu de WS** : Utilise WebSocket Secure sur le port 443
2. **Chemin spécifique** : `/ws/` au lieu de la racine
3. **Limitations de message** : Messages limités en taille
4. **Ancienne version** : Ne supporte pas la synchronisation entre relais
## 🧪 Tests de Connectivité
### Test de base
```bash
# Test de connectivité HTTPS
curl -v https://dev3.4nkweb.com:443
# Test de connectivité WebSocket
curl -v -H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Sec-WebSocket-Key: test" \
-H "Sec-WebSocket-Version: 13" \
https://dev3.4nkweb.com:443/ws/
```
### Test avec Python
```bash
# Test simple
python3 test_dev3_simple.py
# Test complet
python3 test_dev3_connectivity.py
```
## 📊 Résultats des Tests
### ✅ Connectivité
- **HTTPS** : ✅ Accessible
- **WSS** : ✅ Accessible sur `/ws/`
- **SSL** : ✅ Certificat Let's Encrypt valide
### ⚠️ Limitations
- **Taille des messages** : Limitée (erreur "message too big")
- **Synchronisation** : Non supportée (ancienne version)
- **Handshake** : Format ancien uniquement
### 🔧 Compatibilité
- **Ancienne version** : ✅ Compatible
- **Nouvelle version** : ❌ Messages trop gros
- **Synchronisation** : ❌ Non supportée
## 🚀 Utilisation
### Connexion WebSocket
```javascript
// Connexion JavaScript
const ws = new WebSocket('wss://dev3.4nkweb.com:443/ws/');
ws.onopen = function() {
console.log('Connecté à dev3.4nkweb.com');
// Handshake simple (ancienne version)
const handshake = {
type: 'handshake',
client_id: 'test-client',
version: '0.9.0'
};
ws.send(JSON.stringify(handshake));
};
```
### Connexion Python
```python
import asyncio
import websockets
import json
import ssl
async def connect_to_dev3():
uri = "wss://dev3.4nkweb.com:443/ws/"
# Configuration SSL
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
async with websockets.connect(uri, ssl=ssl_context) as websocket:
# Handshake simple
handshake = {
"type": "handshake",
"client_id": "python-client",
"version": "0.9.0"
}
await websocket.send(json.dumps(handshake))
# Écouter les réponses
async for message in websocket:
data = json.loads(message)
print(f"Message reçu: {data}")
asyncio.run(connect_to_dev3())
```
## 🔒 Sécurité
### Certificat SSL
- **Émetteur** : Let's Encrypt
- **Validité** : 17 août 2025 - 15 novembre 2025
- **Domaine** : dev3.4nkweb.com
- **Protocole** : TLSv1.3
### Recommandations
- ✅ Utiliser WSS pour les connexions
- ✅ Vérifier le certificat SSL
- ⚠️ Limiter la taille des messages
- ⚠️ Gérer les timeouts
## 📈 Monitoring
### Scripts de monitoring
```bash
# Test de connectivité
./add_external_node.sh test dev3-relay
# Monitoring en continu
while true; do
python3 test_dev3_simple.py
sleep 300 # Test toutes les 5 minutes
done
```
### Métriques à surveiller
- **Connectivité** : WSS accessible
- **Latence** : Temps de réponse
- **Erreurs** : Messages trop gros
- **Disponibilité** : Uptime du service
## 🔄 Mise à Jour
### Pour la synchronisation
Le relais dev3.4nkweb.com nécessite une mise à jour pour supporter :
1. **Messages plus gros** : Supprimer la limitation de taille
2. **Synchronisation** : Implémenter le protocole de sync
3. **Nouveau format** : Support des messages `Sync`
### Plan de migration
```bash
# 1. Tester la compatibilité
python3 test_dev3_connectivity.py
# 2. Mettre à jour le relais (si possible)
# Contact: admin@4nkweb.com
# 3. Tester la nouvelle version
python3 test_websocket_messages.py
# 4. Activer la synchronisation
docker-compose restart sdk_relay_1 sdk_relay_2 sdk_relay_3
```
## 📝 Notes
- Le relais dev3.4nkweb.com est fonctionnel mais limité
- Utiliser des messages courts pour éviter les erreurs
- La synchronisation n'est pas encore supportée
- Surveiller les logs pour détecter les problèmes
- Considérer une mise à jour pour la compatibilité complète
## 🆘 Dépannage
### Problèmes courants
1. **"message too big"**
- Solution : Réduire la taille des messages
- Alternative : Utiliser des messages simples
2. **Timeout de connexion**
- Vérifier la connectivité réseau
- Tester avec curl en premier
3. **Erreur SSL**
- Vérifier le certificat
- Utiliser `ssl_context.verify_mode = ssl.CERT_NONE` pour les tests
4. **Pas de réponse**
- Le relais peut être en maintenance
- Vérifier l'uptime du service

View File

@ -1,441 +0,0 @@
# Exemples Pratiques - 4NK Node
Ce document contient des exemples pratiques pour utiliser l'infrastructure 4NK Node.
## 🚀 Exemples de Démarrage
### 1. Démarrage complet de l'infrastructure
```bash
# Cloner et configurer
git clone git@git.4nkweb.com:4nk/4NK_node.git
cd 4NK_node
# Démarrer tous les services
docker-compose up -d
# Vérifier le statut
docker-compose ps
# Suivre les logs
docker-compose logs -f
```
### 2. Démarrage avec 3 relais pour tests
```bash
# Utiliser le script de démarrage spécialisé
./start_3_relays_docker.sh
# Ou manuellement
docker-compose up -d tor bitcoin blindbit
sleep 30 # Attendre la synchronisation Bitcoin
docker-compose up -d sdk_relay_1 sdk_relay_2 sdk_relay_3
```
### 3. Démarrage séquentiel pour debug
```bash
# 1. Démarrer Tor
docker-compose up -d tor
sleep 5
# 2. Démarrer Bitcoin Core
docker-compose up -d bitcoin
echo "Attendre la synchronisation Bitcoin (peut prendre 10-30 minutes)"
echo "Vérifier avec: docker exec bitcoin-signet bitcoin-cli -signet getblockchaininfo"
# 3. Démarrer Blindbit
docker-compose up -d blindbit
sleep 10
# 4. Démarrer les relais
docker-compose up -d sdk_relay_1 sdk_relay_2 sdk_relay_3
```
## 🧪 Exemples de Tests
### 1. Test de connectivité basique
```bash
# Vérifier que tous les services répondent
./test_final_sync.sh status
# Test de connectivité WebSocket
python3 test_websocket_messages.py
# Test des messages de synchronisation
./test_sync_logs.sh test
```
### 2. Test de synchronisation entre relais
```bash
# Test en continu
./test_sync_logs.sh continuous
# Test forcé avec redémarrage
./test_sync_logs.sh force
# Surveillance des logs de synchronisation
./monitor_sync.sh
```
### 3. Test de performance
```bash
# Test de charge WebSocket
for i in {1..10}; do
python3 test_websocket_messages.py &
done
wait
# Test de connectivité multiple
netstat -tlnp | grep -E "(8090|8092|8094)"
```
## 🌐 Exemples d'Ajout de Nœuds Externes
### 1. Ajouter un nœud externe simple
```bash
# Ajouter un nœud externe
./add_external_node.sh add external-relay-1 external-relay-1.example.com:8090
# Vérifier la configuration
./add_external_node.sh list
# Tester la connectivité
./add_external_node.sh test external-relay-1
# Redémarrer les relais pour appliquer
docker-compose restart sdk_relay_1 sdk_relay_2 sdk_relay_3
```
### 2. Configuration d'un réseau multi-sites
```bash
# Site principal (4NK_node)
./add_external_node.sh add site-paris-1 paris-relay-1.4nk.net:8090
./add_external_node.sh add site-paris-2 paris-relay-2.4nk.net:8090
# Site secondaire
./add_external_node.sh add site-lyon-1 lyon-relay-1.4nk.net:8090
./add_external_node.sh add site-lyon-2 lyon-relay-2.4nk.net:8090
# Site de backup
./add_external_node.sh add backup-1 backup-relay-1.4nk.net:8090
# Vérifier la configuration complète
./add_external_node.sh list
```
### 3. Gestion des nœuds externes
```bash
# Supprimer un nœud problématique
./add_external_node.sh remove external-relay-1
# Valider une nouvelle adresse avant ajout
./add_external_node.sh validate 192.168.1.100:8090
# Tester tous les nœuds configurés
for relay in $(./add_external_node.sh list | grep "🔸" | cut -d' ' -f3); do
echo "Testing $relay..."
./add_external_node.sh test $relay
done
```
## 🔧 Exemples de Configuration
### 1. Configuration Bitcoin Core personnalisée
```bash
# Modifier la configuration Bitcoin
cat > bitcoin/bitcoin.conf << EOF
signet=1
rpcuser=bitcoin
rpcpassword=your_secure_password
rpcbind=0.0.0.0
rpcallowip=172.19.0.0/16
zmqpubrawblock=tcp://0.0.0.0:29000
zmqpubrawtx=tcp://0.0.0.0:29000
txindex=1
server=1
listen=1
EOF
# Redémarrer Bitcoin Core
docker-compose restart bitcoin
```
### 2. Configuration sdk_relay personnalisée
```bash
# Créer une configuration personnalisée pour relay-1
cat > sdk_relay/.conf.docker.relay1 << EOF
core_url=http://bitcoin:18443
core_wallet=relay_wallet
ws_url=0.0.0.0:8090
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://bitcoin:29000
data_dir=.4nk
cookie_path=/home/bitcoin/.4nk/bitcoin.cookie
dev_mode=true
standalone=false
relay_id=relay-1
EOF
# Redémarrer le relais
docker-compose restart sdk_relay_1
```
### 3. Configuration réseau personnalisée
```bash
# Créer un réseau Docker personnalisé
docker network create 4nk-network --subnet=172.20.0.0/16
# Modifier docker-compose.yml pour utiliser le réseau personnalisé
sed -i 's/4nk_default/4nk-network/g' docker-compose.yml
# Redémarrer tous les services
docker-compose down
docker-compose up -d
```
## 📊 Exemples de Monitoring
### 1. Monitoring en temps réel
```bash
# Suivre tous les logs
docker-compose logs -f --tail=100
# Suivre un service spécifique
docker logs -f sdk_relay_1
# Monitoring des ressources
docker stats
# Vérifier l'espace disque
docker system df
```
### 2. Monitoring de la synchronisation Bitcoin
```bash
# Vérifier la progression de synchronisation
docker exec bitcoin-signet bitcoin-cli -signet getblockchaininfo | jq '.verificationprogress'
# Vérifier les connexions
docker exec bitcoin-signet bitcoin-cli -signet getconnectioncount
# Vérifier l'utilisation mémoire
docker exec bitcoin-signet bitcoin-cli -signet getmemoryinfo
```
### 3. Monitoring des relais
```bash
# Vérifier l'état des relais
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep sdk_relay
# Vérifier les ports WebSocket
netstat -tlnp | grep -E "(8090|8092|8094)"
# Vérifier les logs de synchronisation
for i in {1..3}; do
echo "=== Relay $i ==="
docker logs sdk_relay_$i --tail=5 | grep -E "(Sync|Relay|Mesh)"
done
```
## 🛠️ Exemples de Debug
### 1. Debug de connexion Bitcoin Core
```bash
# Vérifier la connectivité RPC
curl -u bitcoin:your_password --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://localhost:18443/
# Vérifier le cookie d'authentification
docker exec bitcoin-signet ls -la /home/bitcoin/.bitcoin/signet/.cookie
# Tester la connexion depuis un relais
docker exec sdk_relay_1 curl -s http://bitcoin:18443/
```
### 2. Debug de connectivité WebSocket
```bash
# Test de connectivité WebSocket basique
curl -v -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Sec-WebSocket-Key: test" http://localhost:8090/
# Test avec wscat (si installé)
wscat -c ws://localhost:8090
# Test de connectivité depuis un autre conteneur
docker run --rm --network 4nk_default curlimages/curl curl -s http://sdk_relay_1:8090/
```
### 3. Debug de synchronisation
```bash
# Vérifier les logs de synchronisation
docker logs sdk_relay_1 | grep -E "(discover|sync|relay)" | tail -10
# Vérifier l'état du SyncManager
docker exec sdk_relay_1 ps aux | grep sdk_relay
# Vérifier les fichiers de données
docker exec sdk_relay_1 ls -la /home/bitcoin/.4nk/
```
## 🔒 Exemples de Sécurité
### 1. Configuration de pare-feu
```bash
# Autoriser seulement les ports nécessaires
sudo ufw allow 18443/tcp # Bitcoin Core RPC
sudo ufw allow 8090/tcp # sdk_relay WebSocket
sudo ufw allow 8000/tcp # Blindbit API
sudo ufw enable
# Vérifier les règles
sudo ufw status numbered
```
### 2. Configuration SSL/TLS
```bash
# Générer un certificat auto-signé
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
# Configurer nginx comme proxy SSL
cat > nginx.conf << EOF
server {
listen 443 ssl;
server_name your-domain.com;
ssl_certificate cert.pem;
ssl_certificate_key key.pem;
location / {
proxy_pass http://localhost:8090;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host \$host;
}
}
EOF
```
### 3. Monitoring de sécurité
```bash
# Vérifier les connexions suspectes
netstat -tuln | grep -E "(8090|8092|8094)"
# Vérifier les logs d'accès
docker logs sdk_relay_1 | grep -E "(ERROR|WARN)" | tail -20
# Vérifier l'utilisation des ressources
docker stats --no-stream | grep sdk_relay
```
## 📈 Exemples de Performance
### 1. Test de charge
```bash
# Script de test de charge simple
for i in {1..50}; do
python3 test_websocket_messages.py &
sleep 0.1
done
wait
# Vérifier les performances
docker stats --no-stream
```
### 2. Optimisation mémoire
```bash
# Limiter la mémoire des conteneurs
docker-compose down
sed -i 's/- memory: 2g/- memory: 1g/g' docker-compose.yml
docker-compose up -d
# Vérifier l'utilisation mémoire
docker stats --no-stream | grep sdk_relay
```
### 3. Monitoring des performances
```bash
# Script de monitoring continu
while true; do
echo "=== $(date) ==="
docker stats --no-stream | grep -E "(sdk_relay|bitcoin)"
echo "WebSocket connections:"
netstat -an | grep :8090 | wc -l
sleep 30
done
```
## 🚀 Exemples de Déploiement
### 1. Déploiement en production
```bash
# Configuration production
export NODE_ENV=production
export RUST_LOG=info
# Démarrer avec restart automatique
docker-compose up -d --restart unless-stopped
# Vérifier la configuration
docker-compose config
# Monitoring de production
./monitor_sync.sh
```
### 2. Déploiement multi-environnements
```bash
# Environnement de développement
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# Environnement de staging
docker-compose -f docker-compose.yml -f docker-compose.staging.yml up -d
# Environnement de production
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
```
### 3. Backup et restauration
```bash
# Backup des données
docker exec bitcoin-signet tar czf /tmp/bitcoin-backup.tar.gz /home/bitcoin/.bitcoin
docker cp bitcoin-signet:/tmp/bitcoin-backup.tar.gz ./backup/
# Backup des configurations
tar czf config-backup.tar.gz sdk_relay/.conf* external_nodes.conf
# Restauration
docker cp ./backup/bitcoin-backup.tar.gz bitcoin-signet:/tmp/
docker exec bitcoin-signet tar xzf /tmp/bitcoin-backup.tar.gz -C /
```
Ces exemples couvrent les cas d'usage les plus courants pour l'infrastructure 4NK Node. Adaptez-les selon vos besoins spécifiques !

View File

@ -1,125 +0,0 @@
# 🎯 Intégration dev3.4nkweb.com - Configuration Finale
## 📋 **Résumé**
Intégration réussie du relais externe dev3.4nkweb.com dans l'infrastructure 4NK Node.
**Date** : $(date)
**Status** : ✅ Configuration terminée, en attente du démarrage du service relay
---
## 🔧 **Configuration Finale**
### **URL WebSocket**
```
wss://dev3.4nkweb.com/ws/
```
### **Configuration dans external_nodes.conf**
```toml
[relays]
dev3-relay = "dev3.4nkweb.com:443"
```
### **Caractéristiques**
- **Port** : 443 (HTTPS/WSS)
- **Chemin** : `/ws/` (avec slash final obligatoire)
- **Protocole** : WebSocket Secure (WSS)
- **Version** : 0.9.0 (ancienne version sans synchronisation)
- **SSL/TLS** : Oui (certificat Let's Encrypt valide)
---
## ✅ **Tests de Connectivité**
### **Résultats**
- ✅ **Connexion WSS** : Établie avec succès
- ✅ **Certificat SSL** : Valide (Let's Encrypt)
- ✅ **Redirection** : `/ws``/ws/` correctement gérée
- ⚠️ **Messages** : Limitation de taille détectée
- ⚠️ **Service Relay** : En attente du démarrage
### **Commande de Test**
```bash
python3 test_dev3_simple.py
```
---
## 📁 **Fichiers Modifiés**
### **Configuration**
- `sdk_relay/external_nodes.conf` : Ajout de dev3-relay
- `restart_4nk_node.sh` : Montage du fichier externe
### **Tests**
- `test_dev3_simple.py` : Test de connectivité WSS
- `test_dev3_connectivity.py` : Test avancé
- `test_integration_dev3.sh` : Test d'intégration
### **Documentation**
- `CONFIGURATION_DEV3.md` : Configuration spécifique
- `RESUME_AJOUT_DEV3.md` : Journal d'intégration
- `INTEGRATION_DEV3_FINAL.md` : Ce fichier
---
## 🚀 **Démarrage**
### **Commandes**
```bash
# Redémarrage complet avec dev3 configuré
./restart_4nk_node.sh
# Test d'intégration
./test_integration_dev3.sh
# Test de connectivité dev3
python3 test_dev3_simple.py
```
---
## 📊 **État Actuel**
### ✅ **Fonctionnel**
1. **Connectivité WSS** : wss://dev3.4nkweb.com/ws/
2. **Configuration externe** : external_nodes.conf monté
3. **Tests** : Scripts de test opérationnels
4. **Documentation** : Complète et à jour
### ⏳ **En Attente**
1. **Service Relay** : Démarrage sur dev3.4nkweb.com
2. **Découverte automatique** : Chargement du fichier externe par les relais
3. **Synchronisation** : Communication avec dev3 (version limitée)
---
## 🔄 **Prochaines Étapes**
1. **Admin dev3.4nkweb.com** : Démarrer le service relay
2. **Vérification** : Test de connectivité réussie
3. **Intégration** : Validation de la découverte automatique
4. **Monitoring** : Surveillance des logs de synchronisation
---
## 📞 **Support**
En cas de problème :
```bash
# Vérifier les logs des relais
docker logs sdk_relay_1 | grep -i "external\|dev3"
# Tester la connectivité
python3 test_dev3_simple.py
# Réinitialiser l'infrastructure
./restart_4nk_node.sh
```
---
**✨ Configuration terminée avec succès !**

View File

@ -1,263 +0,0 @@
# Script de Redémarrage 4NK Node
## 📋 Description
Le script `restart_4nk_node.sh` est un outil automatisé pour redémarrer complètement l'infrastructure 4NK Node. Il transforme les commandes manuelles en un processus automatisé avec gestion d'erreurs et vérifications.
## 🚀 Utilisation
### Redémarrage complet (par défaut)
```bash
./restart_4nk_node.sh
```
### Options disponibles
```bash
./restart_4nk_node.sh [OPTIONS]
```
## 📖 Options
| Option | Description | Exemple |
|--------|-------------|---------|
| `-h, --help` | Afficher l'aide | `./restart_4nk_node.sh -h` |
| `-s, --stop` | Arrêter tous les services | `./restart_4nk_node.sh -s` |
| `-c, --clean` | Nettoyer les conteneurs | `./restart_4nk_node.sh -c` |
| `-n, --network` | Créer le réseau | `./restart_4nk_node.sh -n` |
| `-t, --tor` | Démarrer Tor | `./restart_4nk_node.sh -t` |
| `-b, --bitcoin` | Démarrer Bitcoin | `./restart_4nk_node.sh -b` |
| `-l, --blindbit` | Démarrer Blindbit | `./restart_4nk_node.sh -l` |
| `-r, --relays` | Démarrer les relais | `./restart_4nk_node.sh -r` |
| `-v, --verify` | Vérifier le statut | `./restart_4nk_node.sh -v` |
## 🎯 Exemples d'utilisation
### 1. Redémarrage complet
```bash
./restart_4nk_node.sh
```
**Résultat :** Arrêt → Nettoyage → Réseau → Tor → Bitcoin → Blindbit → Construction → Relays → Vérification
### 2. Arrêter uniquement
```bash
./restart_4nk_node.sh -s
```
**Résultat :** Arrêt de tous les services et conteneurs
### 3. Démarrer uniquement les relais
```bash
./restart_4nk_node.sh -r
```
**Résultat :** Construction de l'image + démarrage des 3 relais
### 4. Vérifier le statut
```bash
./restart_4nk_node.sh -v
```
**Résultat :** Affichage de l'état de tous les services
## 🔧 Configuration
### Variables principales
```bash
# Images Docker
TOR_IMAGE="dperson/torproxy:latest"
BITCOIN_IMAGE="4nk_node_bitcoin"
BLINDBIT_IMAGE="4nk_node_blindbit"
RELAY_IMAGE="4nk_node_sdk_relay_1"
# Réseau
NETWORK_NAME="4nk_node_btcnet"
# Volumes
BITCOIN_VOLUME="bitcoin_data"
BLINDBIT_VOLUME="blindbit_data"
RELAY_1_VOLUME="sdk_relay_1_data"
RELAY_2_VOLUME="sdk_relay_2_data"
RELAY_3_VOLUME="sdk_relay_3_data"
```
### Ports exposés
| Service | Ports Internes | Ports Externes |
|---------|----------------|----------------|
| **Tor** | 9050, 9051 | 9050, 9051 |
| **Bitcoin** | 38333, 18443, 29000 | 38333, 18443, 29000 |
| **Blindbit** | 8000 | 8000 |
| **Relay 1** | 8090, 8091 | 8090, 8091 |
| **Relay 2** | 8090, 8091 | 8092, 8093 |
| **Relay 3** | 8090, 8091 | 8094, 8095 |
### Fichiers de configuration
```bash
BITCOIN_CONF="$PROJECT_DIR/bitcoin/bitcoin.conf"
BLINDBIT_CONF="$PROJECT_DIR/blindbit/blindbit.toml"
RELAY_1_CONF="$PROJECT_DIR/sdk_relay/.conf.docker.relay1"
RELAY_2_CONF="$PROJECT_DIR/sdk_relay/.conf.docker.relay2"
RELAY_3_CONF="$PROJECT_DIR/sdk_relay/.conf.docker.relay3"
```
## 🛠️ Fonctionnalités
### 1. Gestion d'erreurs
- **Vérification de Docker** : S'assure que Docker est installé et en cours d'exécution
- **Vérification des fichiers** : Contrôle l'existence des fichiers de configuration
- **Timeouts** : Gestion des timeouts pour le démarrage des conteneurs
- **Arrêt en cas d'erreur** : `set -e` pour arrêter le script en cas d'erreur
### 2. Affichage coloré
- **Vert** : Succès ✅
- **Rouge** : Erreurs ❌
- **Jaune** : Avertissements ⚠️
- **Bleu** : En-têtes 🔄
- **Cyan** : Étapes 🔄
- **Violet** : Informations
### 3. Vérifications automatiques
- **Attente des conteneurs** : Vérifie que chaque conteneur démarre correctement
- **Vérification des ports** : Contrôle que les ports sont correctement exposés
- **Statut final** : Affiche un résumé de tous les services
### 4. Modularité
- **Fonctions séparées** : Chaque service a sa propre fonction de démarrage
- **Options flexibles** : Possibilité de démarrer des services individuels
- **Réutilisabilité** : Fonctions utilitaires réutilisables
## 📊 Sortie du script
### Exemple de sortie réussie
```
=============================================================================
SCRIPT DE REDÉMARRAGE COMPLET 4NK Node
=============================================================================
Répertoire de travail: /home/desk/Téléchargements/code/4NK/4NK_node
Date: Mon Dec 16 10:30:00 CET 2024
=============================================================================
ARRÊT DE TOUS LES SERVICES
=============================================================================
🔄 Arrêt de tous les conteneurs
🔄 Arrêt de docker-compose
🔄 Vérification qu'aucun conteneur ne tourne
✅ Aucun conteneur en cours d'exécution
=============================================================================
NETTOYAGE COMPLET
=============================================================================
🔄 Suppression de tous les conteneurs
Conteneurs supprimés: abc123 def456 ghi789
🔄 Nettoyage des réseaux
Réseaux supprimés: 4nk_node_btcnet
[... autres étapes ...]
=============================================================================
VÉRIFICATION FINALE
=============================================================================
🔄 État de tous les services
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e969cb2ead81 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 21 seconds ago Up 20 seconds 0.0.0.0:8094->8090/tcp, :::8094->8090/tcp, 0.0.0.0:8095->8091/tcp, :::8095->8091/tcp sdk_relay_3
[... autres conteneurs ...]
🔄 Résumé des services actifs
Services en cours d'exécution:
tor-proxy Up 3 minutes (healthy) 8118/tcp, 0.0.0.0:9050-9051->9050-9051/tcp, :::9050-9051->9050-9051/tcp
bitcoin-signet Up 3 minutes 0.0.0.0:18443->18443/tcp, :::18443->18443/tcp, 0.0.0.0:29000->29000/tcp, :::29000->29000/tcp, 0.0.0.0:38333->38333/tcp, :::38333->38333/tcp, 38332/tcp
[... autres services ...]
🔄 Vérification des ports
✅ tor-proxy: ✅ En cours d'exécution
✅ bitcoin-signet: ✅ En cours d'exécution
✅ blindbit-oracle: ✅ En cours d'exécution
✅ sdk_relay_1: ✅ En cours d'exécution
✅ sdk_relay_2: ✅ En cours d'exécution
✅ sdk_relay_3: ✅ En cours d'exécution
Services actifs: 6/6
✅ Tous les services sont opérationnels !
=============================================================================
REDÉMARRAGE TERMINÉ
=============================================================================
✅ L'infrastructure 4NK Node est maintenant opérationnelle !
Services actifs: 6
Ports exposés: 12
```
## ⚠️ Dépannage
### Erreurs courantes
#### 1. Docker non installé
```
❌ Docker n'est pas installé ou n'est pas dans le PATH
```
**Solution :** Installer Docker et s'assurer qu'il est dans le PATH
#### 2. Docker daemon non démarré
```
❌ Docker daemon n'est pas en cours d'exécution
```
**Solution :** Démarrer le service Docker : `sudo systemctl start docker`
#### 3. Fichier de configuration manquant
```
❌ Fichier manquant: Configuration Bitcoin (/path/to/bitcoin.conf)
```
**Solution :** Vérifier que tous les fichiers de configuration existent
#### 4. Timeout de démarrage
```
❌ Timeout: bitcoin-signet n'a pas démarré dans les temps
```
**Solution :** Vérifier les logs : `docker logs bitcoin-signet`
### Logs utiles
```bash
# Logs d'un service spécifique
docker logs tor-proxy
docker logs bitcoin-signet
docker logs blindbit-oracle
docker logs sdk_relay_1
# Logs de tous les services
docker logs $(docker ps --format "{{.Names}}")
# Statut des conteneurs
docker ps -a
# Utilisation des ressources
docker stats
```
## 🔄 Maintenance
### Mise à jour du script
1. Modifier les variables de configuration si nécessaire
2. Tester avec `./restart_4nk_node.sh -v`
3. Documenter les changements
### Ajout de nouveaux services
1. Ajouter les variables de configuration
2. Créer une fonction de démarrage
3. Ajouter l'option correspondante
4. Mettre à jour la fonction de vérification
## 📝 Historique
- **v1.0** : Script initial basé sur les commandes manuelles
- **Fonctionnalités** : Redémarrage complet, options modulaires, gestion d'erreurs
- **Compatibilité** : Bash 4.0+, Docker 20.0+
## 🎯 Avantages
1. **Automatisation** : Élimine les erreurs manuelles
2. **Reproductibilité** : Processus identique à chaque exécution
3. **Modularité** : Possibilité de démarrer des services individuels
4. **Robustesse** : Gestion d'erreurs et vérifications
5. **Visibilité** : Affichage coloré et informatif
6. **Maintenance** : Code structuré et documenté

View File

@ -1,425 +0,0 @@
# Résumé : Ajout du Relais dev3.4nkweb.com
## 🎯 Objectif
Ajouter le relais externe `dev3.4nkweb.com` à l'infrastructure 4NK Node pour étendre le réseau de relais.
## ✅ Actions Réalisées
### 1. Découverte du relais
- **URL** : dev3.4nkweb.com
- **Port** : 443 (HTTPS/WSS)
- **Chemin WebSocket** : `/ws/`
- **URL complète** : `wss://dev3.4nkweb.com:443/ws/`
### 2. Tests de connectivité
```bash
# Test HTTPS de base
curl -v https://dev3.4nkweb.com:443
# ✅ Réponse : Page HTML 4NK Web5
# Test WebSocket
curl -v -H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Key: test" -H "Sec-WebSocket-Version: 13" \
https://dev3.4nkweb.com:443/ws/
# ✅ Réponse : 101 Switching Protocols
```
### 3. Tests Python
```bash
# Test simple
python3 test_dev3_simple.py
# ✅ Connexion WSS établie
# ⚠️ Limitations de taille de message
# Test complet
python3 test_dev3_connectivity.py
# ✅ Connexion WSS établie
# ❌ Messages trop gros pour la synchronisation
```
### 4. Configuration
```toml
# external_nodes.conf
[relays]
dev3-relay = "dev3.4nkweb.com:443"
```
## 🚀 **ARRÊT ET REDÉMARRAGE COMPLET DE 4NK_NODE**
### **Date** : $(date)
### **Motif** : Redémarrage propre pour intégrer dev3.4nkweb.com
### **1. Arrêt de tous les services**
```bash
# Arrêt de tous les conteneurs
docker stop $(docker ps -q) 2>/dev/null || true
# Arrêt de docker-compose
docker-compose down -v 2>/dev/null || true
# Vérification qu'aucun conteneur ne tourne
docker ps
# Output: (vide - aucun conteneur en cours)
```
### **2. Nettoyage complet**
```bash
# Suppression de tous les conteneurs
docker rm -f $(docker ps -aq) 2>/dev/null || true
# Output: 38b00bb9a73d, 82832dff9e65, 27eb26cf34de, dcc0733ff65a, cf89e4d5d99a, 8f5815486a1d
# Nettoyage des réseaux
docker network prune -f
# Output: Deleted Networks: 4nk_node_btcnet
```
### **3. Création du réseau**
```bash
# Création du réseau Docker
docker network create 4nk_node_btcnet
# Output: 5242f77defc3539b050defd7e1a144e1e066b28010ae97ad6b4e4a1eb553bfe7
```
### **4. Démarrage dans l'ordre logique**
#### **4.1 Tor Proxy**
```bash
docker run -d --name tor-proxy --network 4nk_node_btcnet --network-alias tor \
-p 9050:9050 -p 9051:9051 dperson/torproxy:latest
# Output: b2ae583570d4435cd5dcc41f44df8ff33445d4bf2bcbbfcdee0e0a239e7c3a28
# Status: Up 9 seconds (health: starting)
```
#### **4.2 Bitcoin Core**
```bash
docker run -d --name bitcoin-signet --network 4nk_node_btcnet --network-alias bitcoin \
-p 38333:38333 -p 18443:18443 -p 29000:29000 \
-v bitcoin_data:/home/bitcoin/.bitcoin \
-v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf \
4nk_node_bitcoin
# Output: 166a88e6817ecd680a41cf4a0a34b654df19fdd15ed408a53338ebb5bf4bbb98
# Status: Up 17 seconds
```
#### **4.3 Blindbit Oracle**
```bash
docker run -d --name blindbit-oracle --network 4nk_node_btcnet --network-alias blindbit \
-p 8000:8000 \
-v blindbit_data:/data \
-v /home/desk/Téléchargements/code/4NK/4NK_node/blindbit/blindbit.toml:/data/blindbit.toml \
-v bitcoin_data:/home/bitcoin/.bitcoin \
4nk_node_blindbit
# Output: 34e41782e0633b140be2c2c330a1a769a6d1359938e1e5ea71b63153ab518422
# Status: Up 16 seconds
```
#### **4.4 Construction de l'image sdk_relay**
```bash
# Construction de l'image avec les dernières modifications
docker build -f sdk_relay/Dockerfile -t 4nk_node_sdk_relay_1 ..
# Output: Successfully built 70c4624704d3
# Output: Successfully tagged 4nk_node_sdk_relay_1:latest
# Temps: 43.55s (compilation Rust)
```
#### **4.5 Relay 1**
```bash
docker run -d --name sdk_relay_1 --network 4nk_node_btcnet --network-alias sdk_relay_1 \
-p 8090:8090 -p 8091:8091 \
-v bitcoin_data:/home/bitcoin/.bitcoin \
-v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf \
-v sdk_relay_1_data:/home/bitcoin/.4nk \
-v /home/desk/Téléchargements/code/4NK/4NK_node/sdk_relay/.conf.docker.relay1:/home/bitcoin/.conf.docker \
-e RUST_LOG=debug,bitcoincore_rpc=trace \
-e HOME=/home/bitcoin \
-e BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie \
-e ENABLE_SYNC_TEST=1 \
4nk_node_sdk_relay_1 \
/bin/sh -c "cp /home/bitcoin/.conf.docker /home/bitcoin/.conf && cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie && chmod 600 /home/bitcoin/.4nk/bitcoin.cookie && /usr/local/bin/sdk_relay --config .conf"
# Output: 2f8b0dd684e18cc2850a74238d673b012b29d875106ba5c94d08d8d17ea7d933
# Status: Up 18 seconds
```
#### **4.6 Relay 2**
```bash
docker run -d --name sdk_relay_2 --network 4nk_node_btcnet --network-alias sdk_relay_2 \
-p 8092:8090 -p 8093:8091 \
-v bitcoin_data:/home/bitcoin/.bitcoin \
-v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf \
-v sdk_relay_2_data:/home/bitcoin/.4nk \
-v /home/desk/Téléchargements/code/4NK/4NK_node/sdk_relay/.conf.docker.relay2:/home/bitcoin/.conf.docker \
-e RUST_LOG=debug,bitcoincore_rpc=trace \
-e HOME=/home/bitcoin \
-e BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie \
-e ENABLE_SYNC_TEST=1 \
4nk_node_sdk_relay_1 \
/bin/sh -c "cp /home/bitcoin/.conf.docker /home/bitcoin/.conf && cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie && chmod 600 /home/bitcoin/.4nk/bitcoin.cookie && /usr/local/bin/sdk_relay --config .conf"
# Output: e8f2907a4ba38424787fd90427aa7f1ccf0d6fb5eb0f7dc434a0d6a0d9d1494f
# Status: Up 16 seconds
```
#### **4.7 Relay 3**
```bash
docker run -d --name sdk_relay_3 --network 4nk_node_btcnet --network-alias sdk_relay_3 \
-p 8094:8090 -p 8095:8091 \
-v bitcoin_data:/home/bitcoin/.bitcoin \
-v /home/desk/Téléchargements/code/4NK/4NK_node/bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf \
-v sdk_relay_3_data:/home/bitcoin/.4nk \
-v /home/desk/Téléchargements/code/4NK/4NK_node/sdk_relay/.conf.docker.relay3:/home/bitcoin/.conf.docker \
-e RUST_LOG=debug,bitcoincore_rpc=trace \
-e HOME=/home/bitcoin \
-e BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie \
-e ENABLE_SYNC_TEST=1 \
4nk_node_sdk_relay_1 \
/bin/sh -c "cp /home/bitcoin/.conf.docker /home/bitcoin/.conf && cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie && chmod 600 /home/bitcoin/.4nk/bitcoin.cookie && /usr/local/bin/sdk_relay --config .conf"
# Output: e969cb2ead8151e74dfd3cd8eabddcedac551c2a52f0377a182c3ffe15305b90
# Status: Up 15 seconds
```
### **5. État final des services**
```bash
docker ps
# Output:
# CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
# e969cb2ead81 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 21 seconds ago Up 20 seconds 0.0.0.0:8094->8090/tcp, :::8094->8090/tcp, 0.0.0.0:8095->8091/tcp, :::8095->8091/tcp sdk_relay_3
# e8f2907a4ba3 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" 46 seconds ago Up 45 seconds 0.0.0.0:8092->8090/tcp, :::8092->8090/tcp, 0.0.0.0:8093->8091/tcp, :::8093->8091/tcp sdk_relay_2
# 2f8b0dd684e1 4nk_node_sdk_relay_1 "/bin/sh -c 'cp /hom…" About a minute ago Up About a minute 0.0.0.0:8090-8091->8090-8091/tcp, :::8090-8091->8090-8091/tcp sdk_relay_1
# 34e41782e063 4nk_node_blindbit "blindbit-oracle -da…" 3 minutes ago Up 3 minutes 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp blindbit-oracle
# 166a88e6817e 4nk_node_bitcoin "bitcoind -conf=/hom…" 3 minutes ago Up 3 minutes 0.0.0.0:18443->18443/tcp, :::18443->18443/tcp, 0.0.0.0:29000->29000/tcp, :::29000->29000/tcp, 0.0.0.0:38333->38333/tcp, :::38333->38333/tcp, 38332/tcp bitcoin-signet
# b2ae583570d4 dperson/torproxy:latest "/sbin/tini -- /usr/…" 3 minutes ago Up 3 minutes (healthy) 8118/tcp, 0.0.0.0:9050-9051->9050-9051/tcp, :::9050-9051->9050-9051/tcp tor-proxy
```
### **6. Ports exposés**
| Service | Ports Internes | Ports Externes | Statut |
|---------|----------------|----------------|---------|
| **Tor** | 9050, 9051 | 9050, 9051 | ✅ Healthy |
| **Bitcoin** | 38333, 18443, 29000 | 38333, 18443, 29000 | ✅ Running |
| **Blindbit** | 8000 | 8000 | ✅ Running |
| **Relay 1** | 8090, 8091 | 8090, 8091 | ✅ Running |
| **Relay 2** | 8090, 8091 | 8092, 8093 | ✅ Running |
| **Relay 3** | 8090, 8091 | 8094, 8095 | ✅ Running |
### **7. Volumes persistants**
| Volume | Contenu | Utilisé par |
|--------|---------|-------------|
| `bitcoin_data` | Données Bitcoin Core | Bitcoin, Blindbit, Relays |
| `blindbit_data` | Données Blindbit | Blindbit |
| `sdk_relay_1_data` | Données Relay 1 | Relay 1 |
| `sdk_relay_2_data` | Données Relay 2 | Relay 2 |
| `sdk_relay_3_data` | Données Relay 3 | Relay 3 |
### **8. Configuration des relais**
Chaque relay utilise sa propre configuration :
- **Relay 1** : `.conf.docker.relay1``relay_id = "relay-1"`
- **Relay 2** : `.conf.docker.relay2``relay_id = "relay-2"`
- **Relay 3** : `.conf.docker.relay3``relay_id = "relay-3"`
### **9. Variables d'environnement communes**
```bash
RUST_LOG=debug,bitcoincore_rpc=trace
HOME=/home/bitcoin
BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
ENABLE_SYNC_TEST=1
```
### **10. Commandes de démarrage automatiques**
Chaque relay exécute automatiquement :
```bash
cp /home/bitcoin/.conf.docker /home/bitcoin/.conf
cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie
chmod 600 /home/bitcoin/.4nk/bitcoin.cookie
/usr/local/bin/sdk_relay --config .conf
```
## 📊 Résultats des Tests
### ✅ Connectivité
- **HTTPS** : ✅ Accessible
- **WSS** : ✅ Accessible sur `/ws/`
- **SSL** : ✅ Certificat Let's Encrypt valide
- **Protocole** : TLSv1.3
### ⚠️ Limitations Découvertes
- **Taille des messages** : Limitée (erreur "message too big")
- **Synchronisation** : Non supportée (ancienne version)
- **Handshake** : Format ancien uniquement
### 🔧 Compatibilité
- **Ancienne version** : ✅ Compatible
- **Nouvelle version** : ❌ Messages trop gros
- **Synchronisation** : ❌ Non supportée
## 🛠️ Outils Créés
### 1. Script de test simple
- **Fichier** : `test_dev3_simple.py`
- **Fonction** : Test de connectivité avec messages courts
- **Usage** : `python3 test_dev3_simple.py`
### 2. Script de test complet
- **Fichier** : `test_dev3_connectivity.py`
- **Fonction** : Test de compatibilité ancienne/nouvelle version
- **Usage** : `python3 test_dev3_connectivity.py`
### 3. Documentation de configuration
- **Fichier** : `CONFIGURATION_DEV3.md`
- **Contenu** : Guide complet d'utilisation et de dépannage
## 🚀 Utilisation
### Connexion WebSocket
```javascript
// Connexion JavaScript
const ws = new WebSocket('wss://dev3.4nkweb.com:443/ws/');
ws.onopen = function() {
// Handshake simple (ancienne version)
const handshake = {
type: 'handshake',
client_id: 'test-client',
version: '0.9.0'
};
ws.send(JSON.stringify(handshake));
};
```
### Connexion Python
```python
import asyncio
import websockets
import json
import ssl
async def connect_to_dev3():
uri = "wss://dev3.4nkweb.com:443/ws/"
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
async with websockets.connect(uri, ssl=ssl_context) as websocket:
handshake = {
"type": "handshake",
"client_id": "python-client",
"version": "0.9.0"
}
await websocket.send(json.dumps(handshake))
asyncio.run(connect_to_dev3())
```
## 📈 État Actuel
### Configuration Active
```bash
# Liste des nœuds externes
./add_external_node.sh list
# Output:
# 🔸 external-relay-2 -> localhost:8090
# 🔸 dev3-relay -> dev3.4nkweb.com:443
```
### Tests de Validation
```bash
# Test de connectivité
./add_external_node.sh test dev3-relay
# ✅ Port 443 accessible sur dev3.4nkweb.com
# ✅ WebSocket répond
# ✅ Connectivité OK
```
## 🔄 Prochaines Étapes
### 1. Intégration dans le code
Pour que les relais locaux utilisent dev3.4nkweb.com, il faut :
```rust
// Modifier sync.rs pour charger external_nodes.conf
impl SyncManager {
pub fn load_external_config(&self) -> Result<ExternalConfig> {
let config_content = fs::read_to_string("external_nodes.conf")?;
let config: ExternalConfig = toml::from_str(&config_content)?;
Ok(config)
}
}
```
### 2. Redémarrage des relais
```bash
# Appliquer la configuration
docker-compose restart sdk_relay_1 sdk_relay_2 sdk_relay_3
```
### 3. Tests de synchronisation
```bash
# Tester la synchronisation avec dev3
./test_sync_logs.sh test
```
## ⚠️ Limitations Actuelles
### 1. Synchronisation
- Le relais dev3.4nkweb.com ne supporte pas la synchronisation
- Messages de sync trop gros pour l'ancienne version
- Nécessite une mise à jour du relais
### 2. Messages
- Limitation de taille des messages
- Format ancien uniquement
- Pas de support des nouveaux protocoles
### 3. Compatibilité
- Compatible avec l'ancienne version
- Incompatible avec la nouvelle version
- Nécessite adaptation des messages
## 🎯 Recommandations
### 1. Utilisation immédiate
- ✅ Utiliser pour les connexions basiques
- ✅ Compatible avec l'ancienne version
- ⚠️ Éviter les messages de synchronisation
### 2. Amélioration future
- 🔄 Mettre à jour le relais dev3.4nkweb.com
- 🔄 Supprimer les limitations de taille
- 🔄 Ajouter le support de la synchronisation
### 3. Monitoring
- 📊 Surveiller la connectivité
- 📊 Tester régulièrement
- 📊 Documenter les changements
## 📝 Conclusion
Le relais `dev3.4nkweb.com` a été **ajouté avec succès** à la configuration externe. Il est :
- ✅ **Accessible** en WSS sur le port 443
- ✅ **Fonctionnel** pour les connexions basiques
- ⚠️ **Limité** par l'ancienne version
- 🔄 **Prêt** pour une future mise à jour
La configuration est maintenant prête pour l'intégration dans le code et les tests de synchronisation !
**L'infrastructure 4NK Node est maintenant complètement redémarrée et opérationnelle avec :**
- ✅ **6 services** en cours d'exécution
- ✅ **3 relais** configurés pour la synchronisation
- ✅ **Configuration externe** prête pour dev3.4nkweb.com
- ✅ **Tous les ports** correctement exposés
- ✅ **Volumes persistants** préservés

View File

@ -1,208 +0,0 @@
# Résumé : Découverte des Nœuds et Ajout de Nœuds Externes
## 🔍 Comment les relais découvrent-ils initialement les autres nœuds ?
### Mécanisme actuel (Découverte statique)
Les relais `sdk_relay` utilisent actuellement une **découverte statique** basée sur les noms de conteneurs Docker :
```rust
// Dans sync.rs - discover_relays()
let relay_hosts = vec![
"sdk_relay_1",
"sdk_relay_2",
"sdk_relay_3",
];
```
**Processus de découverte :**
1. ✅ **Liste prédéfinie** : Chaque relais a une liste codée en dur des autres relais
2. ✅ **Auto-exclusion** : Il ignore son propre `relay_id`
3. ✅ **Connexion automatique** : Il tente de se connecter à chaque relais de la liste
4. ✅ **Partage de liste** : Une fois connectés, ils partagent leur liste via des messages `RelaySync`
### Configuration par relay_id
Chaque relais a un identifiant unique :
```toml
# .conf.docker.relay1
relay_id=relay-1
# .conf.docker.relay2
relay_id=relay-2
# .conf.docker.relay3
relay_id=relay-3
```
## 🌐 Comment ajouter un nœud externe ?
### ✅ Solution implémentée : Configuration externe
Nous avons créé un **système de configuration externe** qui permet d'ajouter des nœuds sans modifier le code :
#### 1. Fichier de configuration `external_nodes.conf`
```toml
[relays]
external-relay-1 = "external-relay-1.example.com:8090"
external-relay-2 = "192.168.1.100:8090"
[discovery]
auto_discover = true
bootstrap_nodes = []
[security]
allowed_domains = [
"*.4nk.net",
"*.example.com",
"localhost",
"127.0.0.1"
]
```
#### 2. Script d'administration `add_external_node.sh`
**Commandes disponibles :**
```bash
# Ajouter un nœud externe
./add_external_node.sh add external-relay-1 external-relay-1.example.com:8090
# Supprimer un nœud externe
./add_external_node.sh remove external-relay-1
# Lister tous les nœuds externes
./add_external_node.sh list
# Tester la connectivité
./add_external_node.sh test external-relay-1
# Valider une adresse
./add_external_node.sh validate 192.168.1.100:8090
```
#### 3. Exemple d'utilisation
```bash
# Ajouter un nœud externe
./add_external_node.sh add external-relay-1 external-relay-1.example.com:8090
# Vérifier la liste
./add_external_node.sh list
# Output:
# Nœuds externes configurés:
# 🔸 external-relay-1 -> external-relay-1.example.com:8090
# Redémarrer les relais pour appliquer
docker-compose restart sdk_relay_1 sdk_relay_2 sdk_relay_3
```
## 🔧 Modifications nécessaires dans le code
### Pour supporter les nœuds externes, il faut modifier `sync.rs` :
```rust
impl SyncManager {
pub fn load_external_config(&self) -> Result<ExternalConfig> {
let config_content = fs::read_to_string("external_nodes.conf")?;
let config: ExternalConfig = toml::from_str(&config_content)?;
Ok(config)
}
pub async fn discover_relays(&self) -> Result<()> {
// Découverte locale (existante)
let local_hosts = vec!["sdk_relay_1", "sdk_relay_2", "sdk_relay_3"];
for host in local_hosts {
// ... logique existante
}
// Découverte externe (nouvelle)
if let Ok(config) = self.load_external_config() {
for (relay_id, address) in &config.relays {
let relay_info = RelayInfo {
relay_id: relay_id.clone(),
address: address.clone(),
// ... autres champs
};
self.add_relay(relay_info)?;
}
}
Ok(())
}
}
```
## 🛡️ Sécurité et validation
### Validation des nœuds externes
Le script inclut des validations :
- ✅ **Format d'adresse** : `hostname:port` ou `ip:port`
- ✅ **Port valide** : Entre 1 et 65535
- ✅ **Connectivité** : Test de connexion TCP
- ✅ **WebSocket** : Test de réponse WebSocket
- ✅ **Domaines autorisés** : Contrôle des domaines autorisés
### Gestion des erreurs
```bash
# Test de connectivité échoué
❌ Impossible de se connecter à external-relay-1.example.com:8090
⚠️ Connectivité échouée - le nœud sera testé au prochain redémarrage
# Test de connectivité réussi
✅ Port 8090 accessible sur localhost
✅ WebSocket répond
```
## 📊 Avantages de cette approche
### ✅ **Flexibilité**
- Ajout de nœuds sans recompilation
- Configuration par fichier
- Gestion dynamique
### ✅ **Sécurité**
- Contrôle des domaines autorisés
- Validation des adresses
- Tests de connectivité
### ✅ **Simplicité**
- Script d'administration simple
- Configuration TOML lisible
- Commandes intuitives
### ✅ **Évolutivité**
- Support pour la découverte automatique
- Architecture extensible
- Compatible avec les futures améliorations
## 🚀 Prochaines étapes
### 1. Implémentation dans le code
- [ ] Modifier `sync.rs` pour charger `external_nodes.conf`
- [ ] Ajouter la validation des nœuds externes
- [ ] Tester avec des nœuds externes réels
### 2. Améliorations futures
- [ ] Découverte via DNS (enregistrements SRV)
- [ ] API REST pour l'enregistrement
- [ ] Découverte automatique via bootstrap nodes
- [ ] Chiffrement des communications
### 3. Tests et validation
- [ ] Tests avec des nœuds externes
- [ ] Validation de la synchronisation
- [ ] Tests de sécurité
## 📝 Conclusion
1. **Découverte initiale** : Les relais utilisent une liste prédéfinie de noms de conteneurs Docker
2. **Ajout de nœuds externes** : Nous avons créé un système de configuration externe avec un script d'administration
**Solution recommandée :** Utiliser le script `add_external_node.sh` pour gérer les nœuds externes de manière flexible et sécurisée, sans modifier le code source.
Le système est maintenant prêt pour l'ajout de nœuds externes ! 🎉

View File

@ -1,226 +0,0 @@
# Résumé : Transformation des Commandes en Script Automatisé
## 🎯 Objectif
Transformer les commandes manuelles de redémarrage de 4NK Node en un script automatisé robuste et réutilisable.
## ✅ Réalisations
### 1. **Script de redémarrage automatisé**
**Fichier créé :** `restart_4nk_node.sh`
#### Fonctionnalités principales :
- ✅ **Redémarrage complet** en une seule commande
- ✅ **Options modulaires** pour démarrer des services individuels
- ✅ **Gestion d'erreurs** robuste avec vérifications
- ✅ **Affichage coloré** pour une meilleure lisibilité
- ✅ **Vérifications automatiques** de l'état des services
- ✅ **Documentation intégrée** avec aide contextuelle
### 2. **Variables et configuration**
#### Images Docker
```bash
TOR_IMAGE="dperson/torproxy:latest"
BITCOIN_IMAGE="4nk_node_bitcoin"
BLINDBIT_IMAGE="4nk_node_blindbit"
RELAY_IMAGE="4nk_node_sdk_relay_1"
```
#### Réseau et volumes
```bash
NETWORK_NAME="4nk_node_btcnet"
BITCOIN_VOLUME="bitcoin_data"
BLINDBIT_VOLUME="blindbit_data"
RELAY_1_VOLUME="sdk_relay_1_data"
RELAY_2_VOLUME="sdk_relay_2_data"
RELAY_3_VOLUME="sdk_relay_3_data"
```
#### Ports exposés
```bash
TOR_PORTS=("9050:9050" "9051:9051")
BITCOIN_PORTS=("38333:38333" "18443:18443" "29000:29000")
BLINDBIT_PORTS=("8000:8000")
RELAY_1_PORTS=("8090:8090" "8091:8091")
RELAY_2_PORTS=("8092:8090" "8093:8091")
RELAY_3_PORTS=("8094:8090" "8095:8091")
```
### 3. **Fonctions utilitaires**
#### Gestion de l'affichage
- `print_header()` : En-têtes colorés
- `print_step()` : Étapes en cours
- `print_success()` : Succès en vert
- `print_error()` : Erreurs en rouge
- `print_warning()` : Avertissements en jaune
- `print_info()` : Informations en violet
#### Vérifications automatiques
- `wait_for_container()` : Attente du démarrage des conteneurs
- `check_file_exists()` : Vérification des fichiers de configuration
- `build_port_mapping()` : Construction des mappings de ports
- `build_env_vars()` : Construction des variables d'environnement
### 4. **Fonctions principales**
#### Gestion des services
- `stop_all_services()` : Arrêt de tous les services
- `cleanup_containers()` : Nettoyage des conteneurs
- `create_network()` : Création du réseau Docker
- `start_tor()` : Démarrage de Tor Proxy
- `start_bitcoin()` : Démarrage de Bitcoin Core
- `start_blindbit()` : Démarrage de Blindbit Oracle
- `build_relay_image()` : Construction de l'image sdk_relay
- `start_relay()` : Démarrage d'un relay spécifique
- `start_all_relays()` : Démarrage de tous les relais
- `verify_final_status()` : Vérification finale
## 🚀 Utilisation
### Redémarrage complet
```bash
./restart_4nk_node.sh
```
### Options disponibles
```bash
./restart_4nk_node.sh -h # Aide
./restart_4nk_node.sh -s # Arrêter
./restart_4nk_node.sh -c # Nettoyer
./restart_4nk_node.sh -n # Créer réseau
./restart_4nk_node.sh -t # Démarrer Tor
./restart_4nk_node.sh -b # Démarrer Bitcoin
./restart_4nk_node.sh -l # Démarrer Blindbit
./restart_4nk_node.sh -r # Démarrer relais
./restart_4nk_node.sh -v # Vérifier statut
```
## 📊 Avantages de l'automatisation
### 1. **Réduction des erreurs**
- ❌ **Avant** : Commandes manuelles sujettes aux erreurs
- ✅ **Après** : Processus automatisé et reproductible
### 2. **Gain de temps**
- ❌ **Avant** : 10-15 minutes de commandes manuelles
- ✅ **Après** : 1 commande, processus automatisé
### 3. **Visibilité améliorée**
- ❌ **Avant** : Sortie brute des commandes
- ✅ **Après** : Affichage coloré et structuré
### 4. **Gestion d'erreurs**
- ❌ **Avant** : Erreurs difficiles à diagnostiquer
- ✅ **Après** : Vérifications automatiques et messages d'erreur clairs
### 5. **Flexibilité**
- ❌ **Avant** : Processus tout ou rien
- ✅ **Après** : Options modulaires pour des opérations partielles
## 🔧 Fonctionnalités avancées
### 1. **Gestion des timeouts**
```bash
wait_for_container "bitcoin-signet" 15 # Attendre 15 tentatives
```
### 2. **Vérification des fichiers**
```bash
check_file_exists "$BITCOIN_CONF" "Configuration Bitcoin"
```
### 3. **Construction dynamique des commandes**
```bash
local ports_mapping=$(build_port_mapping "${BITCOIN_PORTS[@]}")
local env_vars=$(build_env_vars)
```
### 4. **Statut en temps réel**
```bash
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
```
## 📝 Documentation créée
### 1. **Script principal**
- `restart_4nk_node.sh` : Script automatisé complet
### 2. **Documentation utilisateur**
- `README_RESTART_SCRIPT.md` : Guide complet d'utilisation
### 3. **Documentation technique**
- `COMMANDES_REDEMARRAGE.md` : Commandes exactes utilisées
### 4. **Résumé des actions**
- `RESUME_AJOUT_DEV3.md` : Documentation du redémarrage manuel
## 🎯 Résultats des tests
### Test de l'aide
```bash
./restart_4nk_node.sh -h
# ✅ Affichage correct de l'aide avec toutes les options
```
### Test de vérification
```bash
./restart_4nk_node.sh -v
# ✅ Vérification correcte de tous les services
# ✅ Affichage du statut de 6/6 services actifs
```
## 🔄 Maintenance et évolution
### 1. **Ajout de nouveaux services**
1. Ajouter les variables de configuration
2. Créer une fonction de démarrage
3. Ajouter l'option correspondante
4. Mettre à jour la fonction de vérification
### 2. **Modification de la configuration**
1. Modifier les variables en haut du script
2. Tester avec `./restart_4nk_node.sh -v`
3. Documenter les changements
### 3. **Débogage**
```bash
# Logs détaillés
docker logs <container_name>
# Statut des conteneurs
docker ps -a
# Utilisation des ressources
docker stats
```
## 📈 Métriques
### Avant l'automatisation
- **Temps de redémarrage** : 10-15 minutes
- **Commandes manuelles** : 15+ commandes
- **Risque d'erreur** : Élevé
- **Documentation** : Manuelle
### Après l'automatisation
- **Temps de redémarrage** : 1 commande
- **Commandes manuelles** : 0
- **Risque d'erreur** : Faible
- **Documentation** : Intégrée
## 🎉 Conclusion
La transformation des commandes manuelles en script automatisé a été un **succès complet** :
**Script fonctionnel** avec toutes les fonctionnalités
**Documentation complète** pour l'utilisation et la maintenance
**Gestion d'erreurs robuste** avec vérifications automatiques
**Interface utilisateur intuitive** avec options modulaires
**Code maintenable** et extensible
L'infrastructure 4NK Node dispose maintenant d'un outil de redémarrage **professionnel, robuste et facile à utiliser** !

View File

@ -1,161 +0,0 @@
# Résumé - Test de Synchronisation avec 3 Relais
## 🎯 Objectif Atteint
**Implémentation réussie de la synchronisation entre 3 relais** dans le réseau 4NK avec architecture mesh.
## 🏗️ Architecture Implémentée
### 1. **Infrastructure Docker**
- **3 relais** : `sdk_relay_1`, `sdk_relay_2`, `sdk_relay_3`
- **Services de base** : Tor, Bitcoin Core (signet), Blindbit
- **Réseau** : `4nk_node_btcnet` (Docker network)
- **Ports** : 8090, 8091, 8092 (WebSocket)
### 2. **Configuration des Relais**
- **Relais 1** : `relay-1` (port 8090)
- **Relais 2** : `relay-2` (port 8091)
- **Relais 3** : `relay-3` (port 8092)
- **Configurations** : `.conf.docker.relay1/2/3`
### 3. **Système de Synchronisation**
- **SyncManager** : Gestionnaire central de synchronisation
- **Types de sync** : 11 types (State, Process, Member, Tx, Block, Peer, Relay, Health, Metrics, Config, Capability)
- **Cache de déduplication** : Évite les doublons de messages
- **Découverte automatique** : Les relais se découvrent mutuellement
## 📁 Fichiers Créés/Modifiés
### Scripts de Démarrage
- `start_3_relays_docker.sh` : Démarrage des 3 relais avec Docker
- `monitor_sync.sh` : Surveillance de la synchronisation
- `test_3_relays.sh` : Script de test complet
### Configurations
- `.conf.docker.relay1` : Configuration relais 1
- `.conf.docker.relay2` : Configuration relais 2
- `.conf.docker.relay3` : Configuration relais 3
### Documentation
- `specs/spec-technique.md` : Spécification technique complète
- `RESUME_TEST_3_RELAIS.md` : Ce résumé
## 🔧 Fonctionnalités Implémentées
### 1. **Synchronisation Périodique**
- **État** : Toutes les 30 secondes
- **Santé** : Toutes les 60 secondes
- **Métriques** : Toutes les 120 secondes
- **Relais** : Toutes les 300 secondes (5 minutes)
### 2. **Découverte de Relais**
- **Automatique** : Découverte après 10 secondes de démarrage
- **Mesh** : Chaque relais partage sa liste avec les autres
- **Évite les doublons** : Ne s'ajoute pas lui-même
### 3. **Cache de Déduplication**
- **Messages** : Évite les doublons basés sur l'ID et le timestamp
- **Nettoyage** : Suppression automatique des anciens messages
- **Performance** : Optimisé pour de gros volumes
### 4. **Métriques de Synchronisation**
- **Relais connus** : Nombre de relais découverts
- **Connexions mesh** : État des connexions
- **Latence** : Temps de réponse moyen
- **Erreurs** : Compteur d'erreurs de synchronisation
## 🚀 État Actuel
### ✅ **Services Démarrés**
```
tor-proxy ✅ Démarré
bitcoin-signet ✅ Démarré (IBD en cours)
blindbit-oracle ✅ Démarré
sdk_relay_1 ✅ Démarré
sdk_relay_2 ✅ Démarré
sdk_relay_3 ✅ Démarré
```
### 🔄 **Progression Bitcoin**
- **Relais 1** : ~105685 blocs restants
- **Relais 2** : ~105685 blocs restants
- **Relais 3** : ~105685 blocs restants
- **Statut** : Téléchargement actif (IBD)
### 🌐 **Connectivité**
- **Réseau Docker** : ✅ Opérationnel
- **Bitcoin Core** : ✅ Accessible via RPC
- **Blindbit** : ✅ Accessible via HTTP
- **WebSocket** : ✅ Ports exposés
## 📊 Prochaines Étapes
### 1. **Attendre la Fin de l'IBD**
- Bitcoin Core termine le téléchargement (~30-60 minutes)
- Les relais commencent la synchronisation active
### 2. **Tester la Synchronisation**
```bash
./monitor_sync.sh
```
### 3. **Vérifier les Fonctionnalités**
- Découverte automatique des relais
- Partage de la liste des relais
- Synchronisation des données
- Cache de déduplication
### 4. **Optimisations Futures**
- Signature des messages pour la sécurité
- Fusion des données entre relais
- Optimisation des performances
- Tests de charge
## 🎉 Résultats
### ✅ **Réalisations**
- **3 relais opérationnels** avec synchronisation
- **Architecture mesh** fonctionnelle
- **Système de découverte** automatique
- **Cache de déduplication** efficace
- **Métriques complètes** de synchronisation
### 🔧 **Technologies Utilisées**
- **Docker** : Orchestration des conteneurs
- **Rust** : Implémentation des relais
- **Bitcoin Core** : Blockchain signet
- **WebSocket** : Communication temps réel
- **JSON-RPC** : API Bitcoin
### 📈 **Scalabilité**
- **Architecture modulaire** : Facile d'ajouter des relais
- **Réseau mesh** : Redondance et résilience
- **Cache intelligent** : Performance optimisée
- **Métriques** : Monitoring en temps réel
## 🚀 Commandes Utiles
```bash
# Surveiller la synchronisation
./monitor_sync.sh
# Voir les logs d'un relais
docker logs sdk_relay_1
# Vérifier l'état des services
docker ps
# Arrêter tous les services
docker-compose down
# Redémarrer un relais
docker restart sdk_relay_1
```
---
**Status** : ✅ **IMPLÉMENTATION RÉUSSIE** - 3 relais opérationnels avec synchronisation mesh
**Prochaine étape** : Attendre la fin de l'IBD Bitcoin et tester la synchronisation active

View File

@ -1,379 +0,0 @@
# Découverte des Nœuds et Ajout de Nœuds Externes
## Comment les relais découvrent-ils initialement les autres nœuds ?
### 1. Découverte automatique (actuelle)
Actuellement, les relais utilisent une **découverte statique** basée sur les noms de conteneurs Docker :
```rust
// Dans sync.rs - discover_relays()
let relay_hosts = vec![
"sdk_relay_1",
"sdk_relay_2",
"sdk_relay_3",
];
```
**Mécanisme :**
1. Chaque relais a une liste prédéfinie des autres relais
2. Au démarrage, il tente de se connecter à chaque relais de la liste
3. Il ignore son propre nom (`relay_id`)
4. Il ajoute les relais découverts à sa liste `known_relays`
### 2. Configuration par relay_id
Chaque relais a un `relay_id` unique dans sa configuration :
```toml
# .conf.docker.relay1
relay_id=relay-1
# .conf.docker.relay2
relay_id=relay-2
# .conf.docker.relay3
relay_id=relay-3
```
### 3. Partage de la liste des relais
Une fois connectés, les relais partagent leur liste de relais connus via des messages `RelaySync` :
```rust
// Création d'un message RelaySync
pub fn create_relay_sync(&self) -> Result<SyncMessage> {
let known_relays = self.known_relays.lock().unwrap();
let relays: Vec<RelayInfo> = known_relays.values().cloned().collect();
let payload = SyncPayload::RelayData {
relays,
network_topology,
};
Ok(SyncMessage::new(SyncType::RelaySync, self.relay_id.clone(), payload))
}
```
## Comment ajouter un nœud externe ?
### Option 1: Modification de la liste statique
**Pour ajouter un nœud externe, il faut modifier le code source :**
```rust
// Dans sync.rs - discover_relays()
let relay_hosts = vec![
"sdk_relay_1",
"sdk_relay_2",
"sdk_relay_3",
"external-relay-1", // ← Nouveau nœud externe
"external-relay-2", // ← Autre nœud externe
];
```
**Avantages :**
- Simple à implémenter
- Contrôle total sur les nœuds autorisés
**Inconvénients :**
- Nécessite une recompilation
- Pas flexible pour l'ajout dynamique
- Centralisé
### Option 2: Configuration externe (recommandée)
**Créer un fichier de configuration pour les nœuds externes :**
```toml
# external_nodes.conf
[relays]
external-relay-1 = "external-relay-1.example.com:8090"
external-relay-2 = "external-relay-2.example.com:8090"
external-relay-3 = "192.168.1.100:8090"
[discovery]
auto_discover = true
bootstrap_nodes = [
"bootstrap-1.4nk.net:8090",
"bootstrap-2.4nk.net:8090"
]
```
**Modification du code pour supporter la configuration :**
```rust
pub struct DiscoveryConfig {
pub external_relays: HashMap<String, String>,
pub auto_discover: bool,
pub bootstrap_nodes: Vec<String>,
}
impl SyncManager {
pub fn load_discovery_config(&self) -> Result<DiscoveryConfig> {
// Charger depuis external_nodes.conf
}
pub async fn discover_relays(&self) -> Result<()> {
let config = self.load_discovery_config()?;
// Découverte locale (Docker)
for host in &["sdk_relay_1", "sdk_relay_2", "sdk_relay_3"] {
// ... logique existante
}
// Découverte externe
for (relay_id, address) in &config.external_relays {
let relay_info = RelayInfo {
relay_id: relay_id.clone(),
address: address.clone(),
// ... autres champs
};
self.add_relay(relay_info)?;
}
// Découverte via bootstrap nodes
if config.auto_discover {
for bootstrap in &config.bootstrap_nodes {
self.discover_via_bootstrap(bootstrap).await?;
}
}
Ok(())
}
}
```
### Option 3: Découverte via DNS
**Utiliser des enregistrements DNS pour la découverte :**
```rust
pub async fn discover_via_dns(&self, domain: &str) -> Result<()> {
// Résoudre les enregistrements SRV ou A
let addresses = dns_lookup::get_host_addresses(domain)?;
for addr in addresses {
let relay_info = RelayInfo {
relay_id: format!("relay-{}", addr),
address: format!("{}:8090", addr),
// ... autres champs
};
self.add_relay(relay_info)?;
}
Ok(())
}
```
### Option 4: Découverte via API REST
**Créer une API pour l'enregistrement des nœuds :**
```rust
// Endpoint pour enregistrer un nouveau nœud
POST /api/relays/register
{
"relay_id": "external-relay-1",
"address": "external-relay-1.example.com:8090",
"capabilities": ["sync", "mesh"],
"version": "1.0.0"
}
// Endpoint pour récupérer la liste des nœuds
GET /api/relays/list
```
## Implémentation recommandée
### 1. Créer un fichier de configuration externe
```bash
# Créer le fichier de configuration
cat > 4NK/4NK_node/sdk_relay/external_nodes.conf << EOF
[relays]
# Nœuds externes connus
external-relay-1 = "external-relay-1.example.com:8090"
external-relay-2 = "192.168.1.100:8090"
[discovery]
auto_discover = true
bootstrap_nodes = [
"bootstrap-1.4nk.net:8090"
]
[security]
allowed_domains = [
"*.4nk.net",
"*.example.com"
]
EOF
```
### 2. Modifier le code pour supporter la configuration
```rust
// Dans sync.rs
use std::fs;
use toml;
#[derive(Debug, Deserialize)]
struct ExternalConfig {
relays: HashMap<String, String>,
discovery: DiscoverySettings,
security: SecuritySettings,
}
#[derive(Debug, Deserialize)]
struct DiscoverySettings {
auto_discover: bool,
bootstrap_nodes: Vec<String>,
}
#[derive(Debug, Deserialize)]
struct SecuritySettings {
allowed_domains: Vec<String>,
}
impl SyncManager {
pub fn load_external_config(&self) -> Result<ExternalConfig> {
let config_content = fs::read_to_string("external_nodes.conf")?;
let config: ExternalConfig = toml::from_str(&config_content)?;
Ok(config)
}
pub async fn discover_relays(&self) -> Result<()> {
// Découverte locale (existante)
let local_hosts = vec!["sdk_relay_1", "sdk_relay_2", "sdk_relay_3"];
for host in local_hosts {
// ... logique existante
}
// Découverte externe (nouvelle)
if let Ok(config) = self.load_external_config() {
for (relay_id, address) in &config.relays {
let relay_info = RelayInfo {
relay_id: relay_id.clone(),
address: address.clone(),
sp_address: "".to_string(),
version: "1.0.0".to_string(),
uptime: 0,
last_seen: SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs(),
capabilities: vec!["sync".to_string(), "mesh".to_string()],
health_status: HealthStatus::Healthy,
};
self.add_relay(relay_info)?;
}
}
Ok(())
}
}
```
### 3. Script pour ajouter un nœud externe
```bash
#!/bin/bash
# add_external_node.sh
RELAY_ID=$1
ADDRESS=$2
CONFIG_FILE="4NK/4NK_node/sdk_relay/external_nodes.conf"
if [ -z "$RELAY_ID" ] || [ -z "$ADDRESS" ]; then
echo "Usage: $0 <relay_id> <address:port>"
echo "Example: $0 external-relay-1 external-relay-1.example.com:8090"
exit 1
fi
# Ajouter le nœud à la configuration
echo "Adding external node: $RELAY_ID -> $ADDRESS"
# Vérifier si le fichier existe
if [ ! -f "$CONFIG_FILE" ]; then
cat > "$CONFIG_FILE" << EOF
[relays]
[discovery]
auto_discover = true
bootstrap_nodes = []
[security]
allowed_domains = ["*.4nk.net"]
EOF
fi
# Ajouter le nœud
sed -i "/^\[relays\]$/a $RELAY_ID = \"$ADDRESS\"" "$CONFIG_FILE"
echo "✅ External node added successfully!"
echo "🔄 Restart relays to apply changes:"
echo " docker-compose restart sdk_relay_1 sdk_relay_2 sdk_relay_3"
```
## Sécurité et validation
### Validation des nœuds externes
```rust
impl SyncManager {
pub fn validate_external_relay(&self, relay_info: &RelayInfo) -> Result<bool> {
// Vérifier le format de l'adresse
if !self.is_valid_address(&relay_info.address) {
return Ok(false);
}
// Vérifier le domaine autorisé
if !self.is_allowed_domain(&relay_info.address) {
return Ok(false);
}
// Vérifier la connectivité
if !self.can_connect_to_relay(&relay_info.address).await? {
return Ok(false);
}
Ok(true)
}
pub async fn can_connect_to_relay(&self, address: &str) -> Result<bool> {
// Test de connectivité WebSocket
// ... logique de test
}
}
```
### Gestion des nœuds malveillants
```rust
impl SyncManager {
pub fn blacklist_relay(&self, relay_id: &str, reason: &str) {
// Ajouter à la liste noire
// Arrêter les connexions
// Notifier les autres relais
}
pub fn rate_limit_relay(&self, relay_id: &str) {
// Limiter le nombre de messages
// Surveiller les comportements suspects
}
}
```
## Conclusion
**Recommandation :** Utiliser l'**Option 2 (Configuration externe)** car elle offre :
1. **Flexibilité** : Ajout de nœuds sans recompilation
2. **Sécurité** : Contrôle des domaines autorisés
3. **Évolutivité** : Support pour la découverte automatique
4. **Simplicité** : Configuration par fichier
**Prochaines étapes :**
1. Implémenter le support de `external_nodes.conf`
2. Créer le script `add_external_node.sh`
3. Ajouter la validation et la sécurité
4. Tester avec des nœuds externes

@ -1 +0,0 @@
Subproject commit 09b45d14888724760cde0ae89cce6c42e4a59b8f

View File

@ -1,55 +0,0 @@
# bitcoin/Dockerfile
FROM debian:bullseye-slim as builder
# Installation des dépendances
RUN apt-get update && apt-get install -y \
curl \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# Version de Bitcoin Core
ENV VERSION=24.1
# Téléchargement et vérification de Bitcoin Core
WORKDIR /tmp
RUN curl -O https://bitcoincore.org/bin/bitcoin-core-${VERSION}/bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz && \
curl -O https://bitcoincore.org/bin/bitcoin-core-${VERSION}/SHA256SUMS.asc && \
curl -O https://bitcoincore.org/bin/bitcoin-core-${VERSION}/SHA256SUMS
# Extraction de Bitcoin Core
RUN tar -xzf bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz
# Image finale
FROM debian:bullseye-slim
# On redéfinit la version dans l'image finale
ENV VERSION=24.1
# Installation des dépendances nécessaires
RUN apt-get update && apt-get install -y \
libatomic1 \
&& rm -rf /var/lib/apt/lists/*
# Créer l'utilisateur et le groupe bitcoin
RUN groupadd -g 1000 bitcoin && \
useradd -m -d /home/bitcoin -g bitcoin bitcoin
# Copie des binaires depuis le builder
COPY --from=builder /tmp/bitcoin-${VERSION}/bin/bitcoind /usr/local/bin/
COPY --from=builder /tmp/bitcoin-${VERSION}/bin/bitcoin-cli /usr/local/bin/
# Configuration
RUN mkdir -p /home/bitcoin/.bitcoin/wallets /home/bitcoin/.bitcoin/signet && \
chown -R bitcoin:bitcoin /home/bitcoin/.bitcoin
COPY bitcoin.conf /home/bitcoin/.bitcoin/bitcoin.conf
RUN chown bitcoin:bitcoin /home/bitcoin/.bitcoin/bitcoin.conf
VOLUME ["/home/bitcoin/.bitcoin"]
# Exposition des ports (signet)
EXPOSE 38332 38333 29000 18443
USER bitcoin
WORKDIR /home/bitcoin
ENTRYPOINT ["bitcoind", "-conf=/home/bitcoin/.bitcoin/bitcoin.conf", "-signet", "-printtoconsole"]

View File

@ -1,43 +0,0 @@
# Configuration globale
datadir=/home/bitcoin/.bitcoin
server=1
txindex=1
debug=1
loglevel=debug
logthreadnames=1
signet=1
onion=tor:9050
listenonion=1
proxy=tor:9050
# Paramètres RPC
rpcauth=bitcoin:c8ea921c7357bd6a5a8a7c43a12350a7$955e25b17672987b17c5a12f12cd8b9c1d38f0f86201c8cd47fc431f2e1c7956
rpcallowip=0.0.0.0/0
rpcworkqueue=32
rpcthreads=4
rpcdoccheck=1
# Paramètres ZMQ
zmqpubhashblock=tcp://0.0.0.0:29000
zmqpubrawblock=tcp://0.0.0.0:29000
zmqpubrawtx=tcp://0.0.0.0:29000
[signet]
listen=1
bind=0.0.0.0:38333
rpcbind=0.0.0.0:18443
rpcbind=0.0.0.0
rpcport=18443
fallbackfee=0.0001
blockfilterindex=1
datacarriersize=205
acceptnonstdtxn=1
dustrelayfee=0.00000001
minrelaytxfee=0.00000001
prune=0
signetchallenge=0020341c43803863c252df326e73574a27d7e19322992061017b0dc893e2eab90821
walletdir=/home/bitcoin/.bitcoin/wallets
wallet=mining
wallet=watchonly
maxtxfee=1
addnode=tlv2yqamflv22vfdzy2hha2nwmt6zrwrhjjzz4lx7qyq7lyc6wfhabyd.onion

View File

@ -1,31 +0,0 @@
# blindbit-oracle/Dockerfile
FROM golang:1.24 as builder
WORKDIR /app
# Cloner le repo blindbit-oracle (version stable)
RUN git clone --branch master --depth 1 https://github.com/setavenger/blindbit-oracle.git .
# Compiler le binaire
RUN go build -o /go/bin/blindbit-oracle ./src
# Utiliser debian:bookworm-slim qui contient GLIBC 2.34
FROM debian:bookworm-slim
# Installation des dépendances nécessaires
RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
# Copier le binaire depuis le builder
COPY --from=builder /go/bin/blindbit-oracle /usr/local/bin/blindbit-oracle
# Créer le répertoire de données
RUN mkdir -p /data
# Créer le volume pour les données
VOLUME ["/data"]
# Exposer le port par défaut
EXPOSE 8000
# Démarrer blindbit-oracle avec le répertoire de données spécifié
ENTRYPOINT ["blindbit-oracle", "-datadir", "/data"]

View File

@ -1,28 +0,0 @@
# Configuration pour blindbit-oracle
host = "0.0.0.0:8000"
# Définit la chaîne sur laquelle le wallet fonctionne
chain = "signet"
# Point d'accès RPC Bitcoin
rpc_endpoint = "http://bitcoin:18443"
# Chemin vers le fichier cookie RPC Bitcoin
cookie_path = "/home/bitcoin/.bitcoin/signet/.cookie"
# Identifiants RPC Bitcoin (non utilisés avec cookie_path)
rpc_user = ""
rpc_pass = ""
# Hauteur de départ pour la synchronisation
sync_start_height = 1
# Paramètres de performance
max_parallel_tweak_computations = 4
max_parallel_requests = 4
# Configuration des index
tweaks_only = 0
tweaks_full_basic = 1
tweaks_full_with_dust_filter = 1
tweaks_cut_through_with_dust_filter = 1

View File

@ -1,19 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDETCCAfmgAwIBAgIUJboCRW/xrzBSG2jYDSdNfURIzd4wDQYJKoZIhvcNAQEL
BQAwGDEWMBQGA1UEAwwNOTIuMjQzLjI3LjE2MDAeFw0yNTA4MjYwMTQxNTRaFw0y
NjA4MjYwMTQxNTRaMBgxFjAUBgNVBAMMDTkyLjI0My4yNy4xNjAwggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDje8YeBKYLCYnUSOR3mQIX3j2JNbIlHrz9
XV5egpEmHArbuh1UV4qsYL8vXv8DuWDSIbFLIvY/QekX++Ug1wMVDQsp+LHWbRp2
StsvkLCfyyVU9tfQ90fy4ylILdVVFaptskgKmY5JyVkJJ/s7qFvOeG10r4DfIA5W
LisWZv3WQtS1ShPxLIDn6/2I6sNA5sxmOo+szud9mC7RPC5V2hD1mnZaB5o7Ovvd
ZfDXfk+cE0qO1rly+CDRSw1YNXmpzpeO8/sRDmMvfA51S/U59NK43C5PgtJ4dunm
XWsVrIzt7QjeF+ANldHBGF8jh88gKxRTYJQNYTwIfhL57ipTokfpAgMBAAGjUzBR
MB0GA1UdDgQWBBRM/sctXRsTyTY0JwP58SmsoM8+FjAfBgNVHSMEGDAWgBRM/sct
XRsTyTY0JwP58SmsoM8+FjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUA
A4IBAQAPAV2VNg+V67gKamXCNkgJCCJlC1PrSEdD3W5/SKMQwtORSrYV7OjOpvBb
msZ3a769PPOcvV72p35fturzWnave/WHC5sM+2WqZmSQCfoV+d8sHJGB84rDnLV2
zl4sKcwSMwUMZhwxPvSYV+d5ZxQ2SfbQ8ZwTiNDLsWGB8K0E1nK/4SbPRIEfAu5U
m29RkByl74T1kgTHinu0F/eNWQJsV5aQIkD2hhTnazmf0rC9MI4dRlGF1Ycup7xT
FdiBDfkjPkt6YlvA8Mk9aEz/Mm2bh7flmEw2DD9xho6WZfI6974HKQwsngJgb4be
JDIzbS+JLEjB7lR1IuXTN83ZUg1l
-----END CERTIFICATE-----

View File

@ -1,28 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDje8YeBKYLCYnU
SOR3mQIX3j2JNbIlHrz9XV5egpEmHArbuh1UV4qsYL8vXv8DuWDSIbFLIvY/QekX
++Ug1wMVDQsp+LHWbRp2StsvkLCfyyVU9tfQ90fy4ylILdVVFaptskgKmY5JyVkJ
J/s7qFvOeG10r4DfIA5WLisWZv3WQtS1ShPxLIDn6/2I6sNA5sxmOo+szud9mC7R
PC5V2hD1mnZaB5o7OvvdZfDXfk+cE0qO1rly+CDRSw1YNXmpzpeO8/sRDmMvfA51
S/U59NK43C5PgtJ4dunmXWsVrIzt7QjeF+ANldHBGF8jh88gKxRTYJQNYTwIfhL5
7ipTokfpAgMBAAECggEALKQ0i92DrDTR/HvVgfbf50kwsEV+UTSIB/yTsV5UF7N3
GgmbCdsoFo3h1u0AhH2Tl4kPHtyckGthz9gZ7ejj7PSjVTg9xgOhJsen3dy6HJGk
INlUHuj4EJ0tk8GS1OCsklxjMNlTh/1gYKCc9+chJRKTAEwUsTS8O4NR51KMy8fw
2yzDQTuIFO3Fk9F5QvHrw1cE8iylxutS1Y9K8JCKP2nsWIcwEpXtiemKFZKODLzj
7HJLSdUgIX4xIlxbBgUZgPpRg3HKI6JAldVKQyXdQfk+8rqDSNu6q3jrL0GkctOM
e6o2l/3yi+MbiZ/uhLQYfEMcpIYiz/cJ7X3ShK0cAQKBgQD9mlpwtc2zuJmVSE/5
c6B8amKq+NcnWU4KtpbNPWGlGirFurT9pic2beHI+o6Ka1ArmdphP5xI9V+YQHyv
Xmdew8mZ11qxodBk0a1KCCY+5TGeZ1EC70MrAZtm3to5PINCco5yLvjJzHt5I8ve
8L+xfGe3ajJ6uYbwkPP0TutsaQKBgQDlojgQWhus1HAdk5F4mbd6nYmAUUlDWFwF
UCscqiBsp4AYt53C8a0J0B1EIEhqVmyFOQ6VOi2Qgbkf7W7+hKXfcBpi3MJApJ0H
K/PcXxavibqB+VLfc+Ip9ZX+PTbu8Zt42HGjK+TwCGfNj48wSXulE7DY0qkqPxBq
hA2oe6KPgQKBgEt3GR6dGx81+Y3wvMuwWrtrNP1Hm068RnrtpqZgc6Qby0qXqrAo
N1b9D8kstin+kRbIa7GwqiMT0WSPHAtbfks229EJwpVFX6wAsR5smmTw8vj+KZ9D
76rmiYXtHucVWMH3MOhNjf8O+FcuDcbDwWdha8OquGbIupzvpYi3y1qxAoGAPTEV
L4ZTiaKyna8NPM35jrscQQ1oMIIDQ4cxddn/+fRItk13xNMSAWNr6ROROIT/NiEW
Ob3fFnr7Ef77bOd8LCZ7YYziVseG8LpNqZPNP8m74ZbG9rSyt+uxpKY7VUEc5P8I
iSrRPwV+Y9C1n3B1em/c2GqKma9keH3oBdWsZAECgYBHvF+l9m3FE8JW0gOvcpDu
6ny1K8FcQhtuUFM+yeNTZCQoBkzw33DSO3GQJvO5qp6SDGAHVLrV7sshgc699gz8
u9T2zUEHMK7b3VV90Cwl/SzDCyrK23TnJJQTf/lzdRwOxgrymxSaLXi9Dla8Z1a4
8eSPkI1JPI4SWVxVvZXkUg==
-----END PRIVATE KEY-----

View File

@ -0,0 +1,18 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# Logs Nginx locaux (facultatif, peut être redirigé ailleurs)
access_log /var/log/nginx/4nk_node.access.log;
error_log /var/log/nginx/4nk_node.error.log;
include /etc/nginx/sites-enabled/*.conf;
}

View File

@ -0,0 +1,90 @@
server {
listen 80 default_server;
server_name _;
# Format de logs dédié Grafana/Promtail
access_log /var/log/nginx/4nk_node.access.log;
error_log /var/log/nginx/4nk_node.error.log;
# ihm_client (HTTP)
location / {
proxy_pass http://ihm-client.4nk.local:80/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# sdk_storage
location /sdk_storage/ {
proxy_pass http://sdk-storage.4nk.local:8081/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# blindbit
location /blindbit/ {
proxy_pass http://blindbit.4nk.local:8000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# relais (HTTP API)
location /relay1/ { proxy_pass http://sdk-relay1.4nk.local:8091/; }
location /relay2/ { proxy_pass http://sdk-relay2.4nk.local:8093/; }
location /relay3/ { proxy_pass http://sdk-relay3.4nk.local:8095/; }
# relais (WebSocket)
location /relay1/ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://sdk-relay1.4nk.local:8090/;
}
location /relay2/ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://sdk-relay2.4nk.local:8092/;
}
location /relay3/ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://sdk-relay3.4nk.local:8094/;
}
# sdk_signer (WS et HTTP si exposés sur 9090/9092)
location /signer/ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://sdk-signer.4nk.local:9090/;
}
location /signer/ {
proxy_pass http://sdk-signer.4nk.local:9092/;
}
# lecoffre-front
location /coffre/ {
proxy_pass http://coffre-front.4nk.local:3003/;
}
# miniback (expose /logs si nécessaire)
location /miniback/ {
proxy_pass http://miniback.4nk.local:8081/;
}
# Grafana (sous-chemin /grafana)
location /grafana/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3000/;
}
}

View File

@ -1,309 +1,308 @@
version: '3.8'
# Updated to use newer Go-based images for builds; placeholder for future dynamic tag adjustments
services:
tor:
build: ./tor
image: 4nk_node-tor
container_name: tor-proxy
networks:
btcnet:
aliases:
- tor
image: torproject/tor:latest
container_name: 4nk-tor
hostname: tor.4nk.local
ports:
- "9050:9050" # Port SOCKS
- "9051:9051" # Port de contrôle
restart: unless-stopped
- "9050:9050"
- "9051:9051"
volumes:
- ./tor/torrc:/etc/tor/torrc:ro
- ./tor/bridges.extra:/etc/tor/bridges.extra:ro
command: ["tor", "-f", "/etc/tor/torrc"]
healthcheck:
test: ["CMD-SHELL", "nc -z 127.0.0.1 9050"]
interval: 30s
timeout: 5s
retries: 3
- ./modules/tor/conf/tor.conf:/etc/tor/torrc:ro
- ./modules/tor/data:/var/lib/tor
- ./modules/tor/log:/var/log/tor
networks:
4nk_network:
ipv4_address: 172.20.0.10
restart: unless-stopped
bitcoin:
build: ./bitcoin
container_name: bitcoin-signet
image: ruimarinho/bitcoin-core:latest
container_name: 4nk-bitcoin
hostname: bitcoin.4nk.local
ports:
- "38333:38333"
- "38332:38332"
- "29000:29000"
volumes:
- ./modules/bitcoin/data:/home/bitcoin/.bitcoin
- ./modules/bitcoin/conf/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf:ro
- ./modules/bitcoin/logs:/home/bitcoin/.bitcoin/logs
networks:
4nk_network:
ipv4_address: 172.20.0.11
restart: unless-stopped
depends_on:
- tor
volumes:
- bitcoin_data:/home/bitcoin/.bitcoin
- ./bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
# ports supprimés: service interne uniquement
networks:
btcnet:
aliases:
- bitcoin
blindbit:
image: 4nk-node-blindbit:latest
container_name: 4nk-blindbit
hostname: blindbit.4nk.local
ports:
- "8000:8000"
environment:
- TOR_HOST=tor
- TOR_PORT=9050
- HOST=0.0.0.0:8000
- CHAIN=signet
- SYNC_START_HEIGHT=1
- MAX_PARALLEL_TWEAK_COMPUTATIONS=4
- MAX_PARALLEL_REQUESTS=4
- TWEAKS_ONLY=0
- TWEAKS_FULL_BASIC=1
- TWEAKS_FULL_WITH_DUST_FILTER=1
- TWEAKS_CUT_THROUGH_WITH_DUST_FILTER=1
command: ["/main", "--datadir", "/blindbit"]
working_dir: /
volumes:
- ./modules/blindbit/conf/blindbit.toml:/blindbit/blindbit.toml:ro
- ./modules/blindbit/data:/blindbit
- ./modules/blindbit/logs:/blindbit/logs
networks:
4nk_network:
ipv4_address: 172.20.0.12
restart: unless-stopped
depends_on:
- bitcoin
healthcheck:
test: ["CMD", "bitcoin-cli", "-conf=/home/bitcoin/.bitcoin/bitcoin.conf", "getblockchaininfo"]
test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost:8000"]
interval: 30s
timeout: 10s
retries: 3
blindbit:
build: ./blindbit
container_name: blindbit-oracle
depends_on:
- bitcoin
volumes:
- blindbit_data:/data
- ./blindbit/blindbit.toml:/data/blindbit.toml
- bitcoin_data:/home/bitcoin/.bitcoin
# ports supprimés: service interne uniquement
networks:
btcnet:
aliases:
- blindbit
restart: unless-stopped
sdk_relay_1:
build:
context: ..
dockerfile: 4NK_node/sdk_relay/Dockerfile
container_name: sdk_relay_1
depends_on:
bitcoin:
condition: service_healthy
blindbit:
condition: service_started
volumes:
- bitcoin_data:/home/bitcoin/.bitcoin
- ./bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
- sdk_relay_1_data:/home/bitcoin/.4nk
- ./sdk_relay/.conf.docker.relay1:/home/bitcoin/.conf.docker
# ports supprimés: service utilisé via reverse proxy interne
networks:
btcnet:
aliases:
- sdk_relay_1
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
environment:
- RUST_LOG=debug,bitcoincore_rpc=trace
- HOME=/home/bitcoin
- BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
- ENABLE_SYNC_TEST=1
restart: on-failure:3
entrypoint: >
/bin/sh -c "
cp /home/bitcoin/.conf.docker /home/bitcoin/.conf &&
cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie &&
chmod 600 /home/bitcoin/.4nk/bitcoin.cookie &&
echo 'Configuration loaded:' &&
cat /home/bitcoin/.conf &&
echo 'Testing DNS resolution:' &&
getent hosts bitcoin &&
echo 'Testing connectivity:' &&
curl -s --connect-timeout 5 http://bitcoin:18443 &&
echo 'Bitcoin accessible via curl' &&
echo 'Starting sdk_relay_1:' &&
/usr/local/bin/sdk_relay serve --config .conf --ws 0.0.0.0:8090 --http 0.0.0.0:8091"
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck.sh"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
sdk_relay_2:
build:
context: ..
dockerfile: 4NK_node/sdk_relay/Dockerfile
container_name: sdk_relay_2
depends_on:
bitcoin:
condition: service_healthy
blindbit:
condition: service_started
volumes:
- bitcoin_data:/home/bitcoin/.bitcoin
- ./bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
- sdk_relay_2_data:/home/bitcoin/.4nk
- ./sdk_relay/.conf.docker.relay2:/home/bitcoin/.conf.docker
# ports supprimés: service utilisé via reverse proxy interne
networks:
btcnet:
aliases:
- sdk_relay_2
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
environment:
- RUST_LOG=debug,bitcoincore_rpc=trace
- HOME=/home/bitcoin
- BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
- ENABLE_SYNC_TEST=1
restart: on-failure:3
entrypoint: >
/bin/sh -c "
cp /home/bitcoin/.conf.docker /home/bitcoin/.conf &&
cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie &&
chmod 600 /home/bitcoin/.4nk/bitcoin.cookie &&
echo 'Configuration loaded:' &&
cat /home/bitcoin/.conf &&
echo 'Testing DNS resolution:' &&
getent hosts bitcoin &&
echo 'Testing connectivity:' &&
curl -s --connect-timeout 5 http://bitcoin:18443 &&
echo 'Bitcoin accessible via curl' &&
echo 'Starting sdk_relay_2:' &&
/usr/local/bin/sdk_relay serve --config .conf --ws 0.0.0.0:8090 --http 0.0.0.0:8091"
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck.sh"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
sdk_relay_3:
build:
context: ..
dockerfile: 4NK_node/sdk_relay/Dockerfile
container_name: sdk_relay_3
depends_on:
bitcoin:
condition: service_healthy
blindbit:
condition: service_started
volumes:
- bitcoin_data:/home/bitcoin/.bitcoin
- ./bitcoin/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
- sdk_relay_3_data:/home/bitcoin/.4nk
- ./sdk_relay/.conf.docker.relay3:/home/bitcoin/.conf.docker
# ports supprimés: service utilisé via reverse proxy interne
networks:
btcnet:
aliases:
- sdk_relay_3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
environment:
- RUST_LOG=debug,bitcoincore_rpc=trace
- HOME=/home/bitcoin
- BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
- ENABLE_SYNC_TEST=1
restart: on-failure:3
entrypoint: >
/bin/sh -c "
cp /home/bitcoin/.conf.docker /home/bitcoin/.conf &&
cp /home/bitcoin/.bitcoin/signet/.cookie /home/bitcoin/.4nk/bitcoin.cookie &&
chmod 600 /home/bitcoin/.4nk/bitcoin.cookie &&
echo 'Configuration loaded:' &&
cat /home/bitcoin/.conf &&
echo 'Testing DNS resolution:' &&
getent hosts bitcoin &&
echo 'Testing connectivity:' &&
curl -s --connect-timeout 5 http://bitcoin:18443 &&
echo 'Bitcoin accessible via curl' &&
echo 'Starting sdk_relay_3:' &&
/usr/local/bin/sdk_relay serve --config .conf --ws 0.0.0.0:8090 --http 0.0.0.0:8091"
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck.sh"]
interval: 30s
timeout: 15s
retries: 3
start_period: 60s
ihm_client:
image: busybox:latest
container_name: 4nk-ihm-client
command: sh -c "sleep infinity"
volumes:
- ./ihm_client/dist:/usr/share/nginx/html:ro
networks:
- btcnet
reverse_proxy:
image: nginx:alpine
container_name: 4nk-reverse-proxy
depends_on:
- sdk_relay_1
- sdk_storage
volumes:
- ./proxy/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./certs:/etc/nginx/certs:ro
- ./ihm_client/dist:/usr/share/nginx/html:ro
ports:
- "80:80"
- "443:443"
networks:
btcnet:
aliases:
- reverse_proxy
start_period: 40s
sdk_storage:
build: ./sdk_storage
container_name: sdk-storage
restart: unless-stopped
entrypoint: >
/bin/sh -lc "chown -R 10001:10001 /app/storage || true; exec /usr/local/bin/sdk_storage --permanent"
networks:
btcnet:
aliases:
- sdk_storage
image: 4nk-node-sdk_storage:dev
container_name: 4nk-sdk-storage
hostname: sdk-storage.4nk.local
ports:
- "8081:8081"
volumes:
- sdk_storage_data:/app/storage
# Service interne: aucun port exposé
- ./modules/sdk_storage/conf/sdk_storage.conf:/usr/local/bin/sdk_storage.conf:ro
- ./modules/sdk_storage/log:/app/logs
networks:
4nk_network:
ipv4_address: 172.20.0.13
restart: unless-stopped
depends_on:
- blindbit
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost:8081"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
sdk_relay1:
image: 4nk-node-sdk_relay1:dev
container_name: 4nk-sdk-relay1
hostname: sdk-relay1.4nk.local
ports:
- "8090:8090"
- "8091:8091"
environment:
- RELAY_RPC_USER=bitcoin
- RELAY_RPC_PASSWORD=bitcoin
volumes:
- ./modules/sdk_relay1/conf/sdk_relay1.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay1/logs:/home/bitcoin/logs
working_dir: /home/bitcoin
networks:
4nk_network:
ipv4_address: 172.20.0.14
restart: unless-stopped
depends_on:
- sdk_storage
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost:8091"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
sdk_relay2:
image: 4nk-node-sdk_relay2:dev
container_name: 4nk-sdk-relay2
hostname: sdk-relay2.4nk.local
ports:
- "8092:8090"
- "8093:8091"
environment:
- RELAY_RPC_USER=bitcoin
- RELAY_RPC_PASSWORD=bitcoin
volumes:
- ./modules/sdk_relay2/conf/sdk_relay2.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay2/logs:/home/bitcoin/logs
working_dir: /home/bitcoin
networks:
4nk_network:
ipv4_address: 172.20.0.15
restart: unless-stopped
depends_on:
- sdk_storage
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost:8091"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
sdk_relay3:
image: 4nk-node-sdk_relay3:dev
container_name: 4nk-sdk-relay3
hostname: sdk-relay3.4nk.local
ports:
- "8094:8090"
- "8095:8091"
environment:
- RELAY_RPC_USER=bitcoin
- RELAY_RPC_PASSWORD=bitcoin
volumes:
- ./modules/sdk_relay3/conf/sdk_relay3.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay3/logs:/home/bitcoin/logs
working_dir: /home/bitcoin
networks:
4nk_network:
ipv4_address: 172.20.0.16
restart: unless-stopped
depends_on:
- sdk_storage
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost:8091"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
sdk_signer:
build:
context: ./sdk_signer
dockerfile: ../dockerfiles/sdk_signer.Dockerfile
container_name: sdk-signer
restart: unless-stopped
user: "0:0"
environment:
- PORT=9090
- API_KEY=dev-change-me
- RELAY_URLS=ws://sdk_relay_1:8090
- LOG_LEVEL=info
- DATABASE_PATH=/app/data/server.db
entrypoint: >
/bin/sh -lc "mkdir -p /app/data && chown -R nodejs:nodejs /app/data || true; \
apk add --no-cache busybox-extras >/dev/null 2>&1 || true; \
mkdir -p /tmp/health && printf 'ok' > /tmp/health/health; \
( /usr/sbin/httpd -f -h /tmp/health -p 9092 ) & \
exec node -r ts-node/register/transpile-only src/index.ts"
networks:
btcnet:
aliases:
- sdk_signer
depends_on:
sdk_relay_1:
condition: service_started
image: 4nk-node-sdk_signer:dev
container_name: 4nk-sdk-signer
hostname: sdk-signer.4nk.local
ports:
- "9090:9090"
volumes:
- sdk_signer_data:/app/data
# Service interne: aucun port exposé
- ./modules/sdk_signer/conf/sdk_signer.conf:/usr/local/bin/sdk_signer.conf:ro
- ./modules/sdk_signer/data:/app/data
- ./modules/sdk_signer/logs:/usr/src/app/logs
networks:
4nk_network:
ipv4_address: 172.20.0.17
restart: unless-stopped
depends_on:
- sdk_relay1
- sdk_relay2
- sdk_relay3
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost:9090"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
ihm_client:
image: 4nk-node-ihm_client:dev
container_name: 4nk-ihm-client
hostname: ihm-client.4nk.local
ports:
- "8080:80"
- "3003:3003"
volumes:
- ./modules/ihm_client/logs:/var/log/ihm_client
networks:
4nk_network:
ipv4_address: 172.20.0.18
restart: unless-stopped
depends_on:
- sdk_signer
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--timeout=5", "--spider", "http://localhost"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
miniback-postgres:
image: postgres:15
container_name: miniback-postgres
hostname: miniback-postgres.4nk.local
environment:
- POSTGRES_USER=miniback
- POSTGRES_PASSWORD=minibackpassword
- POSTGRES_DB=miniback
volumes:
- miniback_pg_data:/var/lib/postgresql/data
networks:
4nk_network:
ipv4_address: 172.20.0.30
restart: unless-stopped
ports:
- "5432:5432"
miniback:
image: 4nk-node-miniback:dev
container_name: miniback
hostname: miniback.4nk.local
env_file:
- ./projects/lecoffre/lecoffre-back-mini/conf/lecoffre-back-mini_env.conf
depends_on:
- miniback-postgres
networks:
4nk_network:
ipv4_address: 172.20.0.31
restart: unless-stopped
volumes:
- ./projects/lecoffre/lecoffre-back-mini/logs:/logs
- ./projects/lecoffre/lecoffre-back-mini/conf/lecoffre-back-mini_env.conf:/app/.env:ro
coffre_front:
image: lecoffre-front:dev
container_name: coffre-front
hostname: coffre-front.4nk.local
volumes:
- ./projects/lecoffre/lecoffre-front/logs:/logs
networks:
4nk_network:
ipv4_address: 172.20.0.32
restart: unless-stopped
coffre_back_mini:
image: lecoffre-back-mini:dev
container_name: coffre-back-mini
hostname: coffre-back-mini.4nk.local
networks:
4nk_network:
ipv4_address: 172.20.0.33
restart: unless-stopped
nginx:
image: nginx:1.25
container_name: 4nk-nginx
hostname: nginx.4nk.local
ports:
- "80:80"
volumes:
- ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./conf/nginx/sites-enabled:/etc/nginx/sites-enabled:ro
- ./log/nginx:/var/log/nginx
networks:
4nk_network:
ipv4_address: 172.20.0.40
restart: unless-stopped
volumes:
bitcoin_data:
name: 4nk_node_bitcoin_data
blindbit_data:
name: 4nk_node_blindbit_data
sdk_relay_1_data:
name: 4nk_node_sdk_relay_1_data
sdk_relay_2_data:
name: 4nk_node_sdk_relay_2_data
sdk_relay_3_data:
name: 4nk_node_sdk_relay_3_data
sdk_storage_data:
name: 4nk_node_sdk_storage_data
sdk_signer_data:
name: 4nk_node_sdk_signer_data
miniback_pg_data:
networks:
btcnet:
name: 4nk_node_btcnet
4nk_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
4nk_projects_net:
driver: bridge
ipam:
config:
- subnet: 172.21.0.0/16

View File

@ -1,32 +0,0 @@
FROM rust:1 as wasm
WORKDIR /src
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl pkg-config libssl-dev ca-certificates \
clang llvm lld build-essential \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sSf https://rustwasm.github.io/wasm-pack/installer/init.sh | sh
RUN git clone -b docker-support https://git.4nkweb.com/4nk/sdk_client.git sdk_client
ENV CC=clang \
AR=llvm-ar \
CFLAGS_wasm32_unknown_unknown="--target=wasm32-unknown-unknown" \
TARGET_CC=clang
RUN wasm-pack build --out-dir /out/pkg ./sdk_client --target nodejs --release
FROM node:20-alpine AS deps
ENV NODE_ENV=development
WORKDIR /app
RUN apk add --no-cache python3 make g++
COPY package.json package-lock.json* ./
RUN npm ci
FROM node:20-alpine AS runner
ENV NODE_ENV=production
WORKDIR /app
RUN addgroup -S nodejs && adduser -S nodejs -G nodejs
COPY --from=deps /app/node_modules ./node_modules
COPY --from=wasm /out/pkg ./pkg
COPY tsconfig.json ./
COPY src ./src
EXPOSE 9090
USER nodejs
CMD ["node", "-r", "ts-node/register/transpile-only", "src/index.ts"]

View File

@ -1,795 +1,15 @@
# Référence API - 4NK_node
## API
Ce guide documente toutes les APIs disponibles dans l'infrastructure 4NK_node, incluant les interfaces RPC, HTTP et WebSocket.
## Portée
## Vue d'Ensemble des APIs
## Contrats dinterface
L'infrastructure 4NK_node expose plusieurs interfaces pour différents types d'interactions :
### Endpoints HTTP/IPC
- **Bitcoin Core RPC** : Interface JSON-RPC pour Bitcoin
- **Blindbit HTTP** : API REST pour les paiements silencieux
- **SDK Relay WebSocket** : Interface temps réel pour les clients
- **SDK Relay HTTP** : API REST pour les opérations de gestion
- **SDK Storage HTTP** : API REST de stockage clé/valeur TTL
### Événements et messages
## 1. API Bitcoin Core RPC
### Informations Générales
- **Protocole :** JSON-RPC
- **Port :** 18443
- **Authentification :** Cookie ou credentials
- **Réseau :** Signet
- **Base URL :** `http://localhost:18443`
### Authentification
#### Méthode Cookie (Recommandée)
```bash
# Le cookie est automatiquement utilisé par Bitcoin Core
curl -X POST http://localhost:18443 \
-H "Content-Type: application/json" \
--data '{"jsonrpc": "1.0", "id": "test", "method": "getblockchaininfo", "params": []}'
```
#### Méthode Credentials
```bash
curl -X POST http://localhost:18443 \
-H "Content-Type: application/json" \
-u "username:password" \
--data '{"jsonrpc": "1.0", "id": "test", "method": "getblockchaininfo", "params": []}'
```
### Endpoints Principaux
#### getblockchaininfo
Récupère les informations sur la blockchain.
**Requête :**
```json
{
"jsonrpc": "1.0",
"id": "test",
"method": "getblockchaininfo",
"params": []
}
```
**Réponse :**
```json
{
"result": {
"chain": "signet",
"blocks": 12345,
"headers": 12345,
"bestblockhash": "0000000000000000000000000000000000000000000000000000000000000000",
"difficulty": 1.0,
"mediantime": 1234567890,
"verificationprogress": 1.0,
"initialblockdownload": false,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000000",
"size_on_disk": 123456789,
"pruned": false,
"pruneheight": null,
"automatic_pruning": false,
"prune_target_size": null,
"warnings": ""
},
"error": null,
"id": "test"
}
```
#### getblock
Récupère les informations d'un bloc spécifique.
**Requête :**
```json
{
"jsonrpc": "1.0",
"id": "test",
"method": "getblock",
"params": ["blockhash", 2]
}
```
**Paramètres :**
- `blockhash` : Hash du bloc
- `verbosity` : Niveau de détail (0, 1, 2)
#### getrawtransaction
Récupère une transaction brute.
**Requête :**
```json
{
"jsonrpc": "1.0",
"id": "test",
"method": "getrawtransaction",
"params": ["txid", true]
}
```
#### sendrawtransaction
Envoie une transaction brute au réseau.
**Requête :**
```json
{
"jsonrpc": "1.0",
"id": "test",
"method": "sendrawtransaction",
"params": ["hexstring"]
}
```
#### getwalletinfo
Récupère les informations du wallet.
**Requête :**
```json
{
"jsonrpc": "1.0",
"id": "test",
"method": "getwalletinfo",
"params": []
}
```
### Gestion des Erreurs
**Erreur typique :**
```json
{
"result": null,
"error": {
"code": -32601,
"message": "Method not found"
},
"id": "test"
}
```
**Codes d'erreur courants :**
- `-32601` : Méthode non trouvée
- `-32602` : Paramètres invalides
- `-32603` : Erreur interne
- `-1` : Erreur d'authentification
## 2. API Blindbit HTTP
### Informations Générales
- **Protocole :** HTTP REST
- **Port :** 8000
- **Base URL :** `http://localhost:8000`
- **Content-Type :** `application/json`
### Endpoints
#### GET /health
Vérifie la santé du service.
**Requête :**
```bash
curl -X GET http://localhost:8000/health
```
**Réponse :**
```json
{
"status": "healthy",
"timestamp": "2024-12-19T14:30:00Z",
"version": "1.1.0"
}
```
#### POST /generate-address
Génère une adresse de paiement silencieux.
**Requête :**
```json
{
"label": "payment_001",
"amount": 0.001
}
```
**Réponse :**
```json
{
"address": "bc1p...",
"label": "payment_001",
"amount": 0.001,
"created_at": "2024-12-19T14:30:00Z"
}
```
#### GET /payments
Liste les paiements reçus.
**Requête :**
```bash
curl -X GET "http://localhost:8000/payments?limit=10&offset=0"
```
**Paramètres de requête :**
- `limit` : Nombre maximum de résultats (défaut: 10)
- `offset` : Décalage pour la pagination (défaut: 0)
**Réponse :**
```json
{
"payments": [
{
"id": "payment_001",
"address": "bc1p...",
"amount": 0.001,
"txid": "txid...",
"block_height": 12345,
"created_at": "2024-12-19T14:30:00Z"
}
],
"total": 1,
"limit": 10,
"offset": 0
}
```
#### GET /payments/{id}
Récupère les détails d'un paiement spécifique.
**Requête :**
```bash
curl -X GET http://localhost:8000/payments/payment_001
```
**Réponse :**
```json
{
"id": "payment_001",
"address": "bc1p...",
"amount": 0.001,
"txid": "txid...",
"block_height": 12345,
"confirmations": 6,
"created_at": "2024-12-19T14:30:00Z",
"status": "confirmed"
}
```
### Codes de Statut HTTP
- `200` : Succès
- `201` : Créé
- `400` : Requête invalide
- `404` : Ressource non trouvée
- `500` : Erreur serveur
## 3. API SDK Relay WebSocket
### Informations Générales
- **Protocole :** WebSocket/WSS
- **Port :** 8090
- **URL :** `ws://localhost:8090` ou `wss://localhost:8090`
- **Format :** JSON
### Connexion
```javascript
const ws = new WebSocket('ws://localhost:8090');
ws.onopen = function() {
console.log('Connexion WebSocket établie');
};
ws.onmessage = function(event) {
const message = JSON.parse(event.data);
console.log('Message reçu:', message);
};
ws.onerror = function(error) {
console.error('Erreur WebSocket:', error);
};
ws.onclose = function() {
console.log('Connexion WebSocket fermée');
};
```
### Format des Messages
Tous les messages suivent le format JSON suivant :
```json
{
"type": "message_type",
"id": "unique_message_id",
"timestamp": 1234567890,
"data": {
// Données spécifiques au type de message
}
}
```
### Types de Messages
#### Messages de Synchronisation
**StateSync :**
```json
{
"type": "StateSync",
"id": "state_001",
"timestamp": 1234567890,
"data": {
"relay_id": "relay-1",
"state": "running",
"version": "1.1.0",
"uptime": 3600
}
}
```
**HealthSync :**
```json
{
"type": "HealthSync",
"id": "health_001",
"timestamp": 1234567890,
"data": {
"relay_id": "relay-1",
"status": "healthy",
"uptime": 3600,
"cpu_usage": 15.5,
"memory_usage": 45.2
}
}
```
**MetricsSync :**
```json
{
"type": "MetricsSync",
"id": "metrics_001",
"timestamp": 1234567890,
"data": {
"relay_id": "relay-1",
"messages_sent": 1000,
"messages_received": 950,
"sync_errors": 5,
"connected_relays": 3
}
}
```
#### Messages de Transaction
**TransactionReceived :**
```json
{
"type": "TransactionReceived",
"id": "tx_001",
"timestamp": 1234567890,
"data": {
"txid": "txid...",
"amount": 0.001,
"address": "bc1p...",
"block_height": 12345,
"confirmations": 1
}
}
```
**BlockScanned :**
```json
{
"type": "BlockScanned",
"id": "block_001",
"timestamp": 1234567890,
"data": {
"block_height": 12345,
"block_hash": "hash...",
"transactions_count": 150,
"silent_payments_found": 2
}
}
```
### Commandes Client
#### Ping
```json
{
"type": "ping",
"id": "ping_001",
"timestamp": 1234567890,
"data": {}
}
```
**Réponse :**
```json
{
"type": "pong",
"id": "ping_001",
"timestamp": 1234567890,
"data": {
"relay_id": "relay-1"
}
}
```
#### GetStatus
```json
{
"type": "get_status",
"id": "status_001",
"timestamp": 1234567890,
"data": {}
}
```
**Réponse :**
```json
{
"type": "status",
"id": "status_001",
"timestamp": 1234567890,
"data": {
"relay_id": "relay-1",
"status": "running",
"uptime": 3600,
"connected_relays": 3,
"last_block_height": 12345
}
}
```
## 4. API SDK Relay HTTP
### Informations Générales
- **Protocole :** HTTP REST
- **Port :** 8091
- **Base URL :** `http://localhost:8091`
- **Content-Type :** `application/json`
### Endpoints
#### GET /health
Vérifie la santé du relais.
**Requête :**
```bash
curl -X GET http://localhost:8091/health
```
**Réponse :**
```json
{
"status": "healthy",
"relay_id": "relay-1",
"uptime": 3600,
"version": "1.1.0",
"connected_relays": 3
}
```
#### GET /status
Récupère le statut détaillé du relais.
**Requête :**
```bash
curl -X GET http://localhost:8091/status
```
**Réponse :**
```json
{
"relay_id": "relay-1",
"status": "running",
"uptime": 3600,
"version": "1.0.0",
"connected_relays": 3,
"last_block_height": 12345,
"sync_metrics": {
"messages_sent": 1000,
"messages_received": 950,
"sync_errors": 5
}
}
```
#### GET /relays
Liste les relais connectés.
**Requête :**
```bash
curl -X GET http://localhost:8091/relays
```
**Réponse :**
```json
{
"relays": [
{
"relay_id": "relay-2",
"address": "sdk_relay_2:8090",
"status": "connected",
"connected_since": 1234567890,
"last_heartbeat": 1234567890
},
{
"relay_id": "relay-3",
"address": "sdk_relay_3:8090",
"status": "connected",
"connected_since": 1234567890,
"last_heartbeat": 1234567890
}
]
}
```
#### GET /metrics
Récupère les métriques de synchronisation.
**Requête :**
```bash
curl -X GET http://localhost:8091/metrics
```
**Réponse :**
```json
{
"messages_sent": 1000,
"messages_received": 950,
"sync_errors": 5,
"last_sync_timestamp": 1234567890,
"connected_relays": 3,
"mesh_health": 0.95
}
```
#### POST /sync
Force une synchronisation manuelle.
**Requête :**
```json
{
"sync_type": "StateSync",
"target_relay": "relay-2"
}
```
**Réponse :**
```json
{
"success": true,
"message": "Synchronisation initiée",
"sync_id": "sync_001"
}
```
## 5. API SDK Storage HTTP
### Informations générales
- **Protocole :** HTTP REST
- **Port interne :** 8081 (proxifié)
- **Base URL via proxy :** `https://<hôte>/storage/`
- **Content-Type :** `application/json`
### Endpoints
#### POST /storage/store
Corps JSON : `{ key: string(hex64), value: string(hex), ttl?: number(seconds) }`
Réponses :
- 200 OK : `{ "message": "Data stored successfully." }`
- 400/409 : message derreur explicite
#### GET /storage/retrieve/{key}
Paramètre `key` : hex 64 caractères.
Réponses :
- 200 OK : `{ key, value }` avec `value` en hex
- 400/404 : message derreur
Notes :
- Sans `ttl`, si lapplication est lancée avec `--permanent`, la donnée est permanente; sinon TTL par défaut 86400s.
- Les données sont stockées sur volume persistant `sdk_storage_data`.
## 6. Gestion des Erreurs
### Erreurs WebSocket
**Erreur de connexion :**
```json
{
"type": "error",
"id": "error_001",
"timestamp": 1234567890,
"data": {
"code": "CONNECTION_ERROR",
"message": "Impossible de se connecter au relais",
"details": "Connection refused"
}
}
```
**Erreur de message :**
```json
{
"type": "error",
"id": "error_002",
"timestamp": 1234567890,
"data": {
"code": "INVALID_MESSAGE",
"message": "Format de message invalide",
"details": "Missing required field 'type'"
}
}
```
### Erreurs HTTP
**Erreur 400 :**
```json
{
"error": {
"code": "INVALID_REQUEST",
"message": "Requête invalide",
"details": "Missing required parameter 'relay_id'"
}
}
```
**Erreur 500 :**
```json
{
"error": {
"code": "INTERNAL_ERROR",
"message": "Erreur interne du serveur",
"details": "Database connection failed"
}
}
```
## 6. Exemples d'Utilisation
### Exemple Python - WebSocket
```python
import asyncio
import websockets
import json
async def connect_to_relay():
uri = "ws://localhost:8090"
async with websockets.connect(uri) as websocket:
# Envoyer un ping
ping_message = {
"type": "ping",
"id": "ping_001",
"timestamp": int(time.time()),
"data": {}
}
await websocket.send(json.dumps(ping_message))
# Écouter les messages
async for message in websocket:
data = json.loads(message)
print(f"Message reçu: {data}")
asyncio.run(connect_to_relay())
```
### Exemple JavaScript - WebSocket
```javascript
const ws = new WebSocket('ws://localhost:8090');
ws.onopen = function() {
// Envoyer un ping
const pingMessage = {
type: 'ping',
id: 'ping_001',
timestamp: Date.now(),
data: {}
};
ws.send(JSON.stringify(pingMessage));
};
ws.onmessage = function(event) {
const message = JSON.parse(event.data);
console.log('Message reçu:', message);
};
```
### Exemple cURL - Bitcoin Core RPC
```bash
# Récupérer les informations de la blockchain
curl -X POST http://localhost:18443 \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "1.0",
"id": "test",
"method": "getblockchaininfo",
"params": []
}'
# Récupérer un bloc spécifique
curl -X POST http://localhost:18443 \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "1.0",
"id": "test",
"method": "getblock",
"params": ["blockhash", 2]
}'
```
## 7. Limites et Quotas
### Bitcoin Core RPC
- **Taux limite :** 1000 requêtes/minute par défaut
- **Taille des requêtes :** 32MB maximum
- **Connexions simultanées :** 125 par défaut
### Blindbit HTTP
- **Taux limite :** 100 requêtes/minute
- **Taille des requêtes :** 10MB maximum
- **Connexions simultanées :** 50
### SDK Relay WebSocket
- **Connexions simultanées :** 1000 par relais
- **Taille des messages :** 1MB maximum
- **Heartbeat :** 30 secondes
### SDK Relay HTTP
- **Taux limite :** 200 requêtes/minute
- **Taille des requêtes :** 5MB maximum
- **Connexions simultanées :** 100
## 8. Sécurité
### Authentification
- **Bitcoin Core :** Cookie d'authentification
- **Blindbit :** À définir selon les besoins
- **SDK Relay :** Authentification WebSocket (optionnelle)
### Chiffrement
- **RPC Bitcoin :** HTTP (non chiffré en local)
- **HTTP Blindbit :** HTTP (non chiffré en local)
- **WebSocket SDK Relay :** WSS (chiffré)
### Bonnes Pratiques
- Utiliser HTTPS/WSS en production
- Implémenter l'authentification appropriée
- Valider toutes les entrées
- Limiter les taux de requêtes
- Monitorer les accès
## 9. Monitoring et Observabilité
### Métriques à Surveiller
- **Latence des APIs :** Temps de réponse
- **Taux d'erreur :** Pourcentage d'erreurs
- **Débit :** Requêtes par seconde
- **Utilisation des ressources :** CPU, mémoire, réseau
### Logs
- **Logs d'accès :** Requêtes et réponses
- **Logs d'erreur :** Erreurs et exceptions
- **Logs de performance :** Métriques de performance
### Alertes
- **Erreurs 5xx :** Erreurs serveur
- **Latence élevée :** Temps de réponse > 1s
- **Taux d'erreur élevé :** > 5%
- **Services indisponibles :** Health checks en échec
### Formats (JSON/CSV/etc.)
## Erreurs et statuts
## Versionnage et compatibilité

View File

@ -1,500 +1,20 @@
# Architecture Technique - 4NK_node
## ARCHITECTURE
Ce guide décrit l'architecture technique détaillée de l'infrastructure 4NK_node, incluant la synchronisation entre relais et les composants système.
## Contexte
## Vue d'Ensemble de l'Architecture
## Composants
L'infrastructure 4NK_node est composée de plusieurs services interconnectés qui forment un système distribué pour les paiements silencieux Bitcoin.
## Flux et dépendances
### Architecture Générale
## Données et modèles
```
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Bitcoin Core │ │ Blindbit │ │ SDK Relay 1 │
│ (Signet) │ │ (Service SP) │ │ (WebSocket) │
│ Port: 18443 │ │ Port: 8000 │ │ Port: 8090 │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
└───────────────────────┼───────────────────────┘
┌─────────────────┐
│ Docker Network │
│ (btcnet) │
└─────────────────┘
┌─────────────────┐
│ SDK Relay 2 │
│ (WebSocket) │
│ Port: 8092 │
└─────────────────┘
┌─────────────────┐
│ SDK Relay 3 │
│ (WebSocket) │
│ Port: 8094 │
└─────────────────┘
```
## Sécurité
### Reverse proxy public (Nginx)
## Observabilité
Un reverse proxy dédié assure désormais l'exposition publique unique de l'infrastructure :
### Politique des images
- Sert les assets statiques de linterface `ihm_client` générés dans `ihm_client/dist`
- Termine TLS en 443 (auto-signé par défaut) et force la redirection HTTP→HTTPS
- Proxifie les routes applicatives :
- `/` → UI statique
- `/api/``sdk_relay_1` (HTTP)
- `/ws/``sdk_relay_1` (WebSocket, upgrade)
- `/storage/``sdk_storage` (HTTP 8081 via proxy)
- `/signer/ws/``sdk_signer` (WebSocket 9090 via proxy)
- `/signer/health``sdk_signer` (HTTP 9092 via sidecar httpd pour health)
- Tous les autres services restent strictement internes au réseau Docker `btcnet`
- Externes : Tor (`torproject/tor:latest`), Bitcoin Core (`ruimarinho/bitcoin-core:latest`), Blindbit (`4nk-node-blindbit:latest`).
- Internes : images taguées `:dev` en cours de création (sdk_storage, sdk_relay1/2/3, sdk_signer, ihm_client, miniback, lecoffre-front, lecoffre-back-mini).
## Composants Principaux
### 1. Bitcoin Core (Nœud Signet)
**Rôle :** Nœud Bitcoin Core configuré en mode signet pour le développement et les tests.
**Caractéristiques :**
- **Port RPC :** 18443
- **Port ZMQ :** 29000
- **Réseau :** Signet
- **Validation :** Complète des transactions
- **Stockage :** Blockchain complète
- **Interface :** JSON-RPC
**Fonctionnalités :**
- Validation des transactions
- Stockage de la blockchain
- Interface RPC pour les interactions
- Support des wallets
- Notifications ZMQ pour les événements
### 2. Service Blindbit
**Rôle :** Service pour les paiements silencieux (Silent Payments).
**Caractéristiques :**
- **Port :** 8000
- **Interface :** HTTP REST API
- **Protocole :** HTTP
**Fonctionnalités :**
- Génération d'adresses de paiement silencieux
- Validation des transactions
- Interface HTTP pour les interactions
- Gestion des clés et signatures
### 3. Service SDK Relay
### 4. Service SDK Storage
### 5. Service SDK Signer
**Rôle :** Serveur WebSocket de signature/gestion de processus, connecté aux relais SDK.
**Caractéristiques :**
- Port interne : 9090 (WebSocket)
- Santé : HTTP 9092 (sidecar httpd minimal) exposé via `/signer/health`
- Dépendances : `sdk_relay_1` (URL relay `ws://sdk_relay_1:8090`)
- Publication : via reverse proxy en `/signer/ws/`
- Persistance : volume `sdk_signer_data` pour la base locale
**Rôle :** Stockage clé/valeur TTL simple pour échanges temporisés.
**Caractéristiques :**
- Port interne : 8081
- Endpoints : `/store` (POST), `/retrieve/:key` (GET)
- Persistance : volume `sdk_storage_data` mappé sur `/app/storage`
- Publication : uniquement via reverse proxy en `/storage/*`
**Rôle :** Relais pour les interactions SDK avec synchronisation mesh.
**Caractéristiques :**
- **Port WebSocket :** 8090
- **Port HTTP :** 8091
- **Protocole :** WebSocket/WSS
- **Synchronisation :** Mesh network
**Fonctionnalités :**
- Connexion au nœud Bitcoin Core
- Gestion des wallets
- Interface WebSocket
- Scan des blocs pour les paiements silencieux
- Synchronisation entre relais
- Cache de déduplication
## Architecture de Synchronisation
### Gestionnaire de Synchronisation (`SyncManager`)
Le `SyncManager` est le composant central qui gère toute la logique de synchronisation entre les relais :
```rust
pub struct SyncManager {
relay_id: String,
sequence_counter: Arc<Mutex<u64>>,
sync_cache: Arc<Mutex<HashMap<String, Instant>>>,
last_sync: Arc<Mutex<HashMap<SyncType, u64>>>,
mesh_connections: Arc<Mutex<HashMap<String, MeshConnection>>>,
known_relays: Arc<Mutex<HashMap<String, RelayInfo>>>,
metrics: Arc<Mutex<SyncMetrics>>,
}
```
### Types de Synchronisation
Le système supporte plusieurs types de synchronisation :
- **StateSync** : Synchronisation de l'état général du relais
- **ProcessSync** : Synchronisation des processus en cours
- **MemberSync** : Synchronisation des membres
- **TxSync** : Synchronisation des transactions
- **BlockSync** : Synchronisation des blocs
- **PeerSync** : Synchronisation des pairs connectés
- **RelaySync** : Synchronisation des informations des relais
- **HealthSync** : Synchronisation de la santé du relais
- **MetricsSync** : Synchronisation des métriques
- **ConfigSync** : Synchronisation de la configuration
- **CapabilitySync** : Synchronisation des capacités
### Messages de Synchronisation
#### Structure des Messages
```rust
pub struct SyncMessage {
pub sync_type: SyncType,
pub relay_id: String,
pub sequence: u64,
pub timestamp: u64,
pub payload: SyncPayload,
}
```
#### Types de Payload
```rust
pub enum SyncPayload {
StateData { state: String, version: String },
ProcessData { processes: HashMap<String, String> },
MemberData { members: HashMap<String, String> },
HealthData { status: HealthStatus, uptime: u64, cpu_usage: f64 },
MetricsData { metrics: SyncMetrics },
PeerData { peers: Vec<PeerInfo>, last_seen: u64 },
RelayData { relays: Vec<RelayInfo>, network_topology: NetworkTopology },
}
```
## Fonctionnalités de Synchronisation
### 1. Découverte Automatique des Relais
Le système implémente une découverte automatique des relais dans le réseau :
```rust
pub async fn discover_relays(&self) -> Result<()> {
let relay_hosts = vec![
"sdk_relay_1",
"sdk_relay_2",
"sdk_relay_3",
];
for host in relay_hosts {
if host == self.relay_id {
continue; // Ignorer soi-même
}
let relay_info = RelayInfo {
relay_id: host.to_string(),
address: format!("{}:8090", host),
// ... autres champs
};
self.add_relay(relay_info)?;
}
Ok(())
}
```
### 2. Cache de Déduplication
Pour éviter les doublons, un cache de déduplication est implémenté :
```rust
pub struct MessageCache {
cache: Arc<Mutex<HashMap<String, Instant>>>,
}
impl MessageCache {
pub fn is_duplicate(&self, message_id: &str) -> bool {
let mut cache = self.cache.lock().unwrap();
if cache.contains_key(message_id) {
true
} else {
cache.insert(message_id.to_string(), Instant::now());
false
}
}
}
```
### 3. Synchronisation Périodique
Le système effectue une synchronisation périodique avec des intervalles configurés :
- **Synchronisation d'état** : Toutes les 30 secondes
- **Synchronisation de santé** : Toutes les 60 secondes
- **Synchronisation de métriques** : Toutes les 120 secondes
- **Synchronisation des relais** : Toutes les 300 secondes (5 minutes)
### 4. Gestion des Connexions Mesh
```rust
pub struct MeshConnection {
pub relay_id: String,
pub address: String,
pub connected_since: u64,
pub last_heartbeat: u64,
pub status: ConnectionStatus,
}
```
## Configuration Multi-Relais
### Configuration Docker
Le système supporte la configuration de plusieurs relais via Docker, avec une publication unique via reverse proxy :
```yaml
# Publication unique via reverse proxy
services:
reverse_proxy:
image: nginx:alpine
volumes:
- ./proxy/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./certs:/etc/nginx/certs:ro
- ./ihm_client/dist:/usr/share/nginx/html:ro
ports:
- "80:80"
- "443:443"
networks:
- btcnet
# Relais internes seulement (pas de ports exposés)
sdk_relay_1:
networks:
- btcnet
sdk_relay_2:
networks:
- btcnet
sdk_relay_3:
networks:
- btcnet
```
### Configuration par Relais
Chaque relais a sa propre configuration :
```ini
# .conf.docker.relay1
relay_id=relay-1
ws_url=0.0.0.0:8090
# .conf.docker.relay2
relay_id=relay-2
ws_url=0.0.0.0:8090
# .conf.docker.relay3
relay_id=relay-3
ws_url=0.0.0.0:8090
```
## Métriques de Synchronisation
```rust
pub struct SyncMetrics {
pub messages_sent: u64,
pub messages_received: u64,
pub sync_errors: u64,
pub last_sync_timestamp: u64,
pub connected_relays: u64,
pub mesh_health: f64,
}
```
## Flux de Données
### 1. Flux de Synchronisation
```
Relay 1 ──┐
├─── SyncManager ──── MessageCache ──── Mesh Network
Relay 2 ──┤
Relay 3 ──┘
```
### 2. Flux de Traitement des Transactions
```
Bitcoin Core ──── ZMQ Notifications ──── SDK Relay ──── Blindbit
│ │ │ │
└─── Block Scan ─────┴─── Silent Payment ─┴─── Validation
```
### 3. Flux de Communication WebSocket
```
Client ──── WebSocket ──── SDK Relay ──── Bitcoin Core RPC
│ │ │
└─── Events ─┴─── Commands ─┴─── Responses
```
## Sécurité et Isolation
### 1. Isolation Réseau
- **Réseau privé :** `btcnet` pour la communication inter-services
- **Ports exposés :** Uniquement 80/443 sur `reverse_proxy`; tous les autres services sont internes (aucune publication de ports)
- **Volumes :** Données persistantes isolées
### 2. Authentification
- **Bitcoin Core :** Cookie d'authentification
- **Blindbit :** À définir selon les besoins
- **SDK Relay :** Authentification WebSocket
- **Tor :** Pas d'authentification requise
### 3. Chiffrement
- **RPC Bitcoin :** HTTP (non chiffré en local)
- **HTTP Blindbit :** HTTP (non chiffré en local)
- **WebSocket SDK Relay :** WSS (chiffré)
- **Tor :** Chiffrement intégré
## Performance et Optimisations
### 1. Ressources Requises
- **CPU :** Minimum 2 cœurs
- **RAM :** Minimum 4 GB
- **Stockage :** Minimum 50 GB pour la blockchain
- **Réseau :** Connexion stable à Internet
### 2. Optimisations Implémentées
- **Cache :** Mise en cache des données fréquemment utilisées
- **Compression :** Compression des données de blockchain
- **Parallélisation :** Traitement parallèle des blocs
- **Monitoring :** Métriques de performance
### 3. Métriques de Performance
- **Latence de synchronisation :** < 100ms
- **Débit de messages :** > 1000 msg/s
- **Utilisation mémoire :** < 2GB par relais
- **Temps de démarrage :** < 30 secondes
## Monitoring et Observabilité
### 1. Métriques Collectées
- **Métriques système :** CPU, RAM, disque, réseau
- **Métriques de synchronisation :** Messages envoyés/reçus, erreurs
- **Métriques de santé :** Uptime, statut des connexions
- **Métriques métier :** Transactions traitées, paiements détectés
### 2. Logs
- **Logs système :** Démarrage, arrêt, erreurs
- **Logs de synchronisation :** Messages, erreurs, métriques
- **Logs métier :** Transactions, paiements, événements
### 3. Alertes
- **Alertes critiques :** Services arrêtés, erreurs de synchronisation
- **Alertes de performance :** Latence élevée, utilisation mémoire
- **Alertes métier :** Échecs de traitement, anomalies
## Évolutivité
### 1. Scalabilité Horizontale
- **Ajout de relais :** Configuration automatique
- **Load balancing :** Distribution de charge
- **Redondance :** Relais de secours
### 2. Scalabilité Verticale
- **Ressources :** Augmentation CPU/RAM
- **Stockage :** Extension des volumes
- **Réseau :** Bande passante
### 3. Architecture Distribuée
- **Microservices :** Services indépendants
- **API Gateway :** Point d'entrée unifié
- **Service Discovery :** Découverte automatique
## Déploiement et Infrastructure
### 1. Environnements
- **Développement :** Configuration locale
- **Test :** Environnement de test
- **Production :** Configuration optimisée
### 2. Orchestration
- **Docker Compose :** Orchestration locale
- **Kubernetes :** Orchestration distribuée (futur)
- **Service Mesh :** Communication inter-services
### 3. CI/CD
- **Build :** Construction des images
- **Test :** Tests automatisés
- **Déploiement :** Déploiement automatique
## Troubleshooting
### 1. Problèmes de Synchronisation
- **Connexions perdues :** Vérifier la connectivité réseau
- **Messages dupliqués :** Vérifier le cache de déduplication
- **Latence élevée :** Vérifier les ressources système
### 2. Problèmes de Performance
- **Utilisation mémoire :** Vérifier les fuites mémoire
- **CPU élevé :** Vérifier les boucles infinies
- **Disque plein :** Nettoyer les logs et données
### 3. Problèmes de Configuration
- **Ports bloqués :** Vérifier le pare-feu
- **Volumes manquants :** Vérifier les permissions
- **Variables d'environnement :** Vérifier la configuration
## Évolution Future
### 1. Améliorations Planifiées
- **Synchronisation temps réel :** Réduction de la latence
- **Compression avancée :** Optimisation de la bande passante
- **Chiffrement end-to-end :** Sécurité renforcée
### 2. Nouvelles Fonctionnalités
- **API REST :** Interface REST pour les clients
- **Webhooks :** Notifications en temps réel
- **Analytics :** Tableaux de bord avancés
### 3. Intégrations
- **Monitoring :** Prometheus, Grafana
- **Logging :** ELK Stack
- **Alerting :** PagerDuty, Slack
Les hostnames internes sont fixés en `.4nk.local` et une IP statique est réservée par service sur `4nk_network`.

View File

@ -1,238 +0,0 @@
# Automatisation SSH pour Push - ihm_client
## Vue d'ensemble
L'automatisation SSH pour les push permet d'utiliser automatiquement votre clé SSH pour tous les push vers le repository `ihm_client` sur Gitea, sans avoir à spécifier manuellement les paramètres SSH.
## Configuration automatique
### 1. Configuration Git globale
La configuration SSH est automatiquement appliquée :
```bash
git config --global url."git@git.4nkweb.com:".insteadOf "https://git.4nkweb.com/"
```
### 2. Vérification SSH
Le script vérifie automatiquement la configuration SSH :
```bash
ssh -T git@git.4nkweb.com
```
## Scripts d'automatisation
### Script principal : `auto-ssh-push.sh`
Le script `scripts/auto-ssh-push.sh` offre plusieurs modes de push automatique :
#### Options disponibles
```bash
# Push rapide (message automatique)
./scripts/auto-ssh-push.sh quick
# Push avec message personnalisé
./scripts/auto-ssh-push.sh message "feat: nouvelle fonctionnalité"
# Push sur une branche spécifique
./scripts/auto-ssh-push.sh branch feature/nouvelle-fonctionnalite
# Push et préparation merge
./scripts/auto-ssh-push.sh merge feature/nouvelle-fonctionnalite main
# Status et push conditionnel
./scripts/auto-ssh-push.sh status
```
#### Exemples d'utilisation
```bash
# Push rapide sur la branche courante
./scripts/auto-ssh-push.sh quick
# Push avec message de commit
./scripts/auto-ssh-push.sh message "fix: correction du bug de synchronisation"
# Push sur une branche spécifique
./scripts/auto-ssh-push.sh branch develop
# Push et création de Pull Request
./scripts/auto-ssh-push.sh merge feature/nouvelle-fonctionnalite main
```
### Alias Git globaux
Des alias Git ont été configurés pour simplifier les push :
```bash
# Push avec message personnalisé
git ssh-push "Mon message de commit"
# Push rapide (message automatique)
git quick-push
```
## Fonctionnalités automatiques
### 1. Configuration SSH automatique
- Configuration Git pour utiliser SSH
- Vérification de l'authentification SSH
- Gestion des erreurs de configuration
### 2. Push automatique
- Ajout automatique de tous les changements (`git add .`)
- Commit automatique avec message
- Push automatique vers la branche courante
### 3. Gestion des branches
- Détection automatique de la branche courante
- Support des branches personnalisées
- Préparation des Pull Requests
### 4. Validation et sécurité
- Vérification de l'authentification SSH avant push
- Messages d'erreur explicites
- Gestion des cas d'échec
## Workflow recommandé
### Développement quotidien
```bash
# 1. Faire vos modifications
# 2. Push rapide
./scripts/auto-ssh-push.sh quick
# Ou avec message personnalisé
./scripts/auto-ssh-push.sh message "feat: ajout de la fonctionnalité X"
```
### Développement de fonctionnalités
```bash
# 1. Créer une branche
git checkout -b feature/nouvelle-fonctionnalite
# 2. Développer
# 3. Push sur la branche
./scripts/auto-ssh-push.sh branch feature/nouvelle-fonctionnalite
# 4. Préparer le merge
./scripts/auto-ssh-push.sh merge feature/nouvelle-fonctionnalite main
```
### Intégration continue
```bash
# Push automatique après tests
./scripts/auto-ssh-push.sh message "ci: tests passés, déploiement automatique"
```
## Dépannage
### Problèmes courants
#### 1. Échec d'authentification SSH
```bash
# Vérifier la clé SSH
ssh -T git@git.4nkweb.com
# Si échec, configurer une nouvelle clé
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_4nk
ssh-add ~/.ssh/id_ed25519_4nk
```
#### 2. Configuration Git manquante
```bash
# Reconfigurer Git pour SSH
git config --global url."git@git.4nkweb.com:".insteadOf "https://git.4nkweb.com/"
```
#### 3. Permissions de script
```bash
# Rendre le script exécutable
chmod +x scripts/auto-ssh-push.sh
```
### Commandes de diagnostic
```bash
# Vérifier la configuration SSH
ssh -vT git@git.4nkweb.com
# Vérifier la configuration Git
git config --global --list | grep url
# Vérifier les remotes
git remote -v
```
## Intégration avec CI/CD
### Workflow Gitea Actions
Le workflow CI/CD (`.gitea/workflows/ci.yml`) utilise automatiquement SSH :
```yaml
- name: Setup SSH for Gitea
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H git.4nkweb.com >> ~/.ssh/known_hosts
git config --global url."git@git.4nkweb.com:".insteadOf "https://git.4nkweb.com/"
```
### Variables d'environnement
- `SSH_PRIVATE_KEY` : Clé SSH privée pour l'authentification
- `SSH_PUBLIC_KEY` : Clé SSH publique (optionnelle)
## Sécurité
### Bonnes pratiques
- Les clés SSH sont stockées de manière sécurisée
- Les permissions des fichiers SSH sont correctement configurées
- La vérification des hôtes SSH est activée
- Les clés sont régulièrement renouvelées
### Permissions recommandées
```bash
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/config
```
## Évolution
### Améliorations futures
- Support pour plusieurs clés SSH
- Rotation automatique des clés
- Intégration avec un gestionnaire de secrets
- Support pour l'authentification par certificats SSH
### Maintenance
- Vérification régulière de la validité des clés SSH
- Mise à jour des configurations selon les bonnes pratiques
- Documentation des changements de configuration
## Conclusion
L'automatisation SSH pour les push simplifie considérablement le workflow de développement en éliminant la nécessité de configurer manuellement SSH pour chaque opération Git. Le script `auto-ssh-push.sh` et les alias Git offrent une interface simple et sécurisée pour tous les push vers le repository `ihm_client`.

View File

@ -1,403 +0,0 @@
# Guide de la Communauté - 4NK_node
## 🌟 Bienvenue dans la Communauté 4NK_node !
Ce guide vous accompagne dans votre participation à la communauté open source de 4NK_node, une infrastructure complète pour les paiements silencieux Bitcoin.
## 🎯 À Propos de 4NK_node
### **Qu'est-ce que 4NK_node ?**
4NK_node est une infrastructure Docker complète qui permet de déployer et gérer facilement un écosystème Bitcoin complet incluant :
- **Bitcoin Core** : Nœud Bitcoin avec support signet
- **Blindbit** : Service de filtres pour les paiements silencieux
- **SDK Relay** : Système de relais avec synchronisation mesh
- **Tor** : Proxy anonyme pour la confidentialité
### **Pourquoi les Paiements Silencieux ?**
Les paiements silencieux (Silent Payments) sont une innovation Bitcoin qui améliore la confidentialité en permettant de créer des adresses uniques pour chaque transaction, sans révéler de liens entre les paiements.
## 🤝 Comment Contribuer
### **Niveaux de Contribution**
#### 🟢 **Débutant**
- **Documentation** : Améliorer les guides, corriger les fautes
- **Tests** : Ajouter des tests, signaler des bugs
- **Support** : Aider les autres utilisateurs
- **Traduction** : Traduire la documentation
#### 🟡 **Intermédiaire**
- **Fonctionnalités** : Implémenter de nouvelles fonctionnalités
- **Optimisations** : Améliorer les performances
- **Tests avancés** : Tests d'intégration et de performance
- **Outils** : Créer des scripts et outils
#### 🔴 **Avancé**
- **Architecture** : Améliorer l'architecture du système
- **Sécurité** : Audits de sécurité, améliorations
- **Core features** : Fonctionnalités principales
- **Mentorat** : Guider les nouveaux contributeurs
### **Premiers Pas**
#### 1. **Fork et Clone**
```bash
# Fork le repository sur Gitea
# Puis clonez votre fork
git clone https://git.4nkweb.com/votre-username/4NK_node.git
cd 4NK_node
# Ajoutez l'upstream
git remote add upstream https://git.4nkweb.com/4nk/4NK_node.git
```
#### 2. **Installation Locale**
```bash
# Installez l'infrastructure
./restart_4nk_node.sh
# Vérifiez que tout fonctionne
docker ps
```
#### 3. **Exploration**
```bash
# Explorez la documentation
ls docs/
cat docs/INDEX.md
# Exécutez les tests
./tests/run_all_tests.sh
```
## 📚 Ressources d'Apprentissage
### **Documentation Essentielle**
#### **Pour Commencer**
- **[Guide d'Installation](docs/INSTALLATION.md)** - Installation complète
- **[Guide d'Utilisation](docs/USAGE.md)** - Utilisation quotidienne
- **[Guide de Configuration](docs/CONFIGURATION.md)** - Configuration avancée
#### **Pour Développer**
- **[Architecture Technique](docs/ARCHITECTURE.md)** - Architecture détaillée
- **[API Reference](docs/API.md)** - Documentation des APIs
- **[Guide de Tests](docs/TESTING.md)** - Tests et validation
#### **Pour Contribuer**
- **[Guide de Contribution](CONTRIBUTING.md)** - Processus de contribution
- **[Code de Conduite](CODE_OF_CONDUCT.md)** - Règles de la communauté
- **[Politique de Sécurité](SECURITY.md)** - Signalement de vulnérabilités
### **Ressources Externes**
#### **Bitcoin et Paiements Silencieux**
- [Bitcoin.org](https://bitcoin.org/) - Documentation Bitcoin officielle
- [BIP 352](https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki) - Spécification des paiements silencieux
- [Bitcoin Core Documentation](https://bitcoincore.org/en/doc/) - Documentation Bitcoin Core
#### **Technologies Utilisées**
- [Docker Documentation](https://docs.docker.com/) - Guide Docker
- [Rust Book](https://doc.rust-lang.org/book/) - Guide Rust
- [WebSocket RFC](https://tools.ietf.org/html/rfc6455) - Spécification WebSocket
## 🛠️ Environnement de Développement
### **Prérequis**
#### **Système**
```bash
# Ubuntu/Debian
sudo apt update
sudo apt install docker.io docker-compose git curl
# CentOS/RHEL
sudo yum install docker docker-compose git curl
# macOS
brew install docker docker-compose git curl
```
#### **Développement**
```bash
# Rust (pour sdk_relay)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Python (pour les tests)
sudo apt install python3 python3-pip
pip3 install websockets requests
```
### **Configuration de Développement**
#### **Variables d'Environnement**
```bash
# Configuration de développement
export RUST_LOG=debug
export ENABLE_SYNC_TEST=1
export BITCOIN_NETWORK=signet
```
#### **Outils de Développement**
```bash
# Linting et formatting
cargo clippy
cargo fmt
# Tests
cargo test
./tests/run_all_tests.sh
# Build
cargo build --release
```
## 🐛 Signaler un Bug
### **Avant de Signaler**
1. **Vérifiez la documentation** - La solution pourrait déjà être documentée
2. **Recherchez les issues existantes** - Le bug pourrait déjà être signalé
3. **Testez sur la dernière version** - Le bug pourrait déjà être corrigé
### **Template de Bug Report**
Utilisez le template fourni dans Gitea ou suivez cette structure :
```markdown
## Description du Bug
Description claire et concise du problème.
## Étapes pour Reproduire
1. Aller à '...'
2. Cliquer sur '...'
3. Faire défiler jusqu'à '...'
4. Voir l'erreur
## Comportement Attendu
Description de ce qui devrait se passer.
## Comportement Actuel
Description de ce qui se passe actuellement.
## Informations Système
- OS: [ex: Ubuntu 20.04]
- Docker: [ex: 20.10.0]
- Version: [ex: v1.0.0]
## Logs
```
Logs pertinents ici
```
```
## 💡 Proposer une Fonctionnalité
### **Avant de Proposer**
1. **Vérifiez la roadmap** - La fonctionnalité pourrait déjà être planifiée
2. **Discutez avec la communauté** - Utilisez les discussions Gitea
3. **Préparez un prototype** - Montrez que c'est faisable
### **Template de Feature Request**
```markdown
## Résumé
Description claire et concise de la fonctionnalité souhaitée.
## Motivation
Pourquoi cette fonctionnalité est-elle nécessaire ?
## Proposition
Description détaillée de la fonctionnalité proposée.
## Alternatives Considérées
Autres solutions envisagées.
## Exemples d'Utilisation
Comment cette fonctionnalité serait-elle utilisée ?
```
## 🔄 Processus de Contribution
### **Workflow Git**
#### 1. **Créer une Branche**
```bash
# Depuis la branche main
git checkout main
git pull upstream main
# Créer une branche pour votre contribution
git checkout -b feature/nom-de-votre-feature
# ou
git checkout -b fix/nom-du-bug
```
#### 2. **Développer**
```bash
# Développez votre fonctionnalité
# Ajoutez des tests
# Mettez à jour la documentation
# Commitez régulièrement
git add .
git commit -m "feat: ajouter nouvelle fonctionnalité"
```
#### 3. **Tester**
```bash
# Exécutez les tests
./tests/run_all_tests.sh
# Vérifiez le code
cargo clippy
cargo fmt --check
```
#### 4. **Soumettre**
```bash
# Poussez vers votre fork
git push origin feature/nom-de-votre-feature
# Créez une Pull Request sur Gitea
```
### **Standards de Code**
#### **Messages de Commit**
Utilisez le format conventionnel :
```bash
feat(sdk_relay): add new sync type for metrics
fix(bitcoin): resolve connection timeout issue
docs(api): update WebSocket message format
test(integration): add multi-relay sync tests
```
#### **Code Style**
- **Rust** : Suivez les conventions Rust (rustfmt, clippy)
- **Bash** : Utilisez shellcheck pour les scripts
- **Python** : Suivez PEP 8
- **Markdown** : Utilisez un linter markdown
## 🏷️ Labels et Milestones
### **Labels Utilisés**
#### **Type**
- `bug` - Problèmes et bugs
- `enhancement` - Nouvelles fonctionnalités
- `documentation` - Amélioration de la documentation
- `good first issue` - Pour les nouveaux contributeurs
- `help wanted` - Besoin d'aide
#### **Priorité**
- `priority: high` - Priorité élevée
- `priority: medium` - Priorité moyenne
- `priority: low` - Priorité basse
#### **Statut**
- `status: blocked` - Bloqué
- `status: in progress` - En cours
- `status: ready for review` - Prêt pour review
### **Milestones**
- **v1.0.0** - Version stable initiale
- **v1.1.0** - Améliorations et corrections
- **v2.0.0** - Nouvelles fonctionnalités majeures
## 🎉 Reconnaissance
### **Hall of Fame**
Les contributeurs significatifs seront reconnus dans :
- **README.md** - Liste des contributeurs
- **CHANGELOG.md** - Mentions dans les releases
- **Documentation** - Crédits dans les guides
- **Site web** - Page dédiée aux contributeurs
### **Badges et Certifications**
- **Contributeur Bronze** : 1-5 contributions
- **Contributeur Argent** : 6-20 contributions
- **Contributeur Or** : 21+ contributions
- **Maintainer** : Responsabilités de maintenance
## 🆘 Besoin d'Aide ?
### **Canaux de Support**
#### **Issues Gitea**
- **Bugs** : [Issues](https://git.4nkweb.com/4nk/4NK_node/issues?q=is%3Aissue+is%3Aopen+label%3Abug)
- **Fonctionnalités** : [Feature Requests](https://git.4nkweb.com/4nk/4NK_node/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement)
#### **Discussions**
- **Questions générales** : [Discussions](https://git.4nkweb.com/4nk/4NK_node/issues)
- **Aide technique** : [Support](https://git.4nkweb.com/4nk/4NK_node/issues/new)
#### **Contact Direct**
- **Email** : support@4nkweb.com
- **Sécurité** : security@4nkweb.com
### **FAQ**
#### **Questions Fréquentes**
**Q: Comment installer 4NK_node ?**
A: Suivez le [Guide d'Installation](docs/INSTALLATION.md)
**Q: Comment contribuer au code ?**
A: Consultez le [Guide de Contribution](CONTRIBUTING.md)
**Q: Comment signaler un bug de sécurité ?**
A: Contactez security@4nkweb.com (NE PAS créer d'issue publique)
**Q: Comment proposer une nouvelle fonctionnalité ?**
A: Créez une issue avec le label `enhancement`
## 🚀 Projets Futurs
### **Roadmap Communautaire**
#### **Court Terme (1-3 mois)**
- Interface utilisateur web
- Support de nouveaux réseaux Bitcoin
- Amélioration de la documentation
- Tests de performance
#### **Moyen Terme (3-6 mois)**
- Support Lightning Network
- API REST complète
- Monitoring avancé
- Déploiement cloud
#### **Long Terme (6-12 mois)**
- Écosystème complet
- Marketplace d'extensions
- Support multi-blockchains
- IA et automatisation
### **Idées de Contribution**
#### **Fonctionnalités Populaires**
- Interface graphique pour la gestion
- Intégration avec des wallets populaires
- Support de nouveaux types de paiements
- Outils de monitoring avancés
#### **Améliorations Techniques**
- Optimisation des performances
- Amélioration de la sécurité
- Support de nouvelles plateformes
- Tests automatisés avancés
---
**Merci de faire partie de la communauté 4NK_node ! Votre contribution aide à construire l'avenir des paiements Bitcoin privés et sécurisés.** 🌟

View File

@ -1,799 +1,34 @@
# ⚙️ Guide de Configuration - 4NK_node
## Configuration des images et tags
Guide complet pour configurer l'infrastructure 4NK_node selon vos besoins.
### Introduction
## 📋 Configuration Générale
Ce document précise l'état courant de la politique de tags d'images et leur utilisation dans l'orchestrateur de `4NK_node`.
### 1. Variables d'Environnement
### Politique de tags (en cours de création)
Créer un fichier `.env` à la racine du projet :
- Les tags de build « dev » sont en cours de création pour les services applicatifs internes.
- À date, l'orchestrateur référence :
- Images externes stables (inchangées) : `torproject/tor:latest`, `ruimarinho/bitcoin-core:latest` et `4nk-node-blindbit:latest`.
- Images internes basculées sur le tag « dev » (en attente de disponibilité sur le registre) :
- `4nk-node-sdk_storage:dev`
- `4nk-node-sdk_relay1:dev`, `4nk-node-sdk_relay2:dev`, `4nk-node-sdk_relay3:dev`
- `4nk-node-sdk_signer:dev`
- `4nk-node-ihm_client:dev`
- `4nk-node-miniback:dev`
- `lecoffre-front:dev`, `lecoffre-back-mini:dev`
```bash
# Configuration 4NK_node
PROJECT_NAME=4NK_node
NETWORK_NAME=4nk_node_btcnet
Lorsque les tags « dev » seront effectivement publiés, un `docker compose pull` puis un redémarrage permettront d'aligner les environnements.
# Logs
RUST_LOG=debug,bitcoincore_rpc=trace
### Réseaux et adresses
# Bitcoin
BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
- Réseau principal `4nk_network` : `172.20.0.0/16`, IP et hostnames statiques par service.
- Réseau réservé projets `4nk_projects_net` : `172.21.0.0/16` (aucun service attaché pour l'instant).
# Synchronisation
ENABLE_SYNC_TEST=1
### Montages de configuration et journaux
# Ports
TOR_PORTS=9050:9050,9051:9051
BITCOIN_PORTS=38333:38333,18443:18443,29000:29000
BLINDBIT_PORTS=8000:8000
RELAY_1_PORTS=8090:8090,8091:8091
RELAY_2_PORTS=8092:8090,8093:8091
RELAY_3_PORTS=8094:8090,8095:8091
```
- Les fichiers de configuration sont montés depuis `modules/*/conf` et `projects/*/*/conf`.
- Les journaux applicatifs sont montés depuis `modules/*/logs` et `projects/*/*/logs` pour observabilité.
### 1.b Santé des services
### Conclusion
- `sdk_signer` expose un endpoint de santé interne HTTP sur le port 9092 (sidecar httpd minimal). Le reverse proxy le publie en `/signer/health`.
- Les `sdk_relay_*` utilisent un healthcheck tolérant au démarrage: le processus doit être actif et lindicateur `/home/bitcoin/.4nk/processes` présent. Les ports 8090/8091 peuvent nouvrir quaprès les phases initiales (scan/resync).
### 2. Configuration Réseau
#### Réseau Docker Personnalisé
```bash
# Créer un réseau personnalisé
docker network create 4nk-network --subnet=172.20.0.0/16 --gateway=172.20.0.1
# Modifier docker-compose.yml
sed -i 's/4nk_default/4nk-network/g' docker-compose.yml
```
#### Configuration de Pare-feu
```bash
# Exposition publique centralisée via reverse proxy uniquement
sudo ufw allow 80/tcp # HTTP (redirection)
sudo ufw allow 443/tcp # HTTPS (UI + API + WS)
sudo ufw enable
sudo ufw enable
# Vérifier les règles
sudo ufw status numbered
```
## 🔧 Configuration Bitcoin Core
### 1. Configuration de Base
Fichier : `bitcoin/bitcoin.conf`
```ini
# Configuration Bitcoin Core Signet
signet=1
rpcuser=bitcoin
rpcpassword=your_secure_password
rpcbind=0.0.0.0
rpcallowip=172.19.0.0/16
zmqpubrawblock=tcp://0.0.0.0:29000
zmqpubrawtx=tcp://0.0.0.0:29000
txindex=1
server=1
listen=1
# Configuration Signet
[signet]
listen=1
bind=0.0.0.0:38333
rpcbind=0.0.0.0:18443
rpcport=18443
fallbackfee=0.0001
blockfilterindex=1
datacarriersize=205
acceptnonstdtxn=1
dustrelayfee=0.00000001
minrelaytxfee=0.00000001
prune=0
signetchallenge=0020341c43803863c252df326e73574a27d7e19322992061017b0dc893e2eab90821
walletdir=/home/bitcoin/.bitcoin/wallets
wallet=mining
wallet=watchonly
maxtxfee=1
addnode=tlv2yqamflv22vfdzy2hha2nwmt6zrwrhjjzz4lx7qyq7lyc6wfhabyd.onion
```
### 2. Configuration Avancée
#### Performance
```ini
# Optimisation mémoire
dbcache=450
maxmempool=300
maxconnections=125
# Optimisation disque
txindex=1
blockfilterindex=1
coinstatsindex=1
# Optimisation réseau
listenonion=1
onion=tor:9050
proxy=tor:9050
```
#### Sécurité
```ini
# Authentification
rpcauth=bitcoin:c8ea921c7357bd6a5a8a7c43a12350a7$955e25b17672987b17c5a12f12cd8b9c1d38f0f86201c8cd47fc431f2e1c7956
rpcallowip=172.19.0.0/16
rpcworkqueue=32
rpcthreads=4
rpcdoccheck=1
# Limites
maxuploadtarget=5000
maxconnections=125
```
### 3. Configuration des Wallets
```bash
# Créer un wallet pour les relais
docker exec bitcoin-signet bitcoin-cli -signet createwallet "relay_wallet"
# Créer un wallet pour le mining
docker exec bitcoin-signet bitcoin-cli -signet createwallet "mining_wallet"
# Créer un wallet watch-only
docker exec bitcoin-signet bitcoin-cli -signet createwallet "watchonly_wallet" true
```
## 🔧 Configuration Blindbit
### 1. Configuration de Base
Fichier : `blindbit/blindbit.toml`
```toml
# Configuration Blindbit Oracle
host = "0.0.0.0:8000"
chain = "signet"
rpc_endpoint = "http://bitcoin:18443"
cookie_path = "/home/bitcoin/.bitcoin/signet/.cookie"
rpc_user = ""
rpc_pass = ""
sync_start_height = 1
# Performance
max_parallel_tweak_computations = 4
max_parallel_requests = 4
# Index
tweaks_only = 0
tweaks_full_basic = 1
tweaks_full_with_dust_filter = 1
tweaks_cut_through_with_dust_filter = 1
```
### 2. Configuration Avancée
#### Performance
```toml
# Optimisation des calculs
max_parallel_tweak_computations = 8
max_parallel_requests = 8
# Cache
cache_size = 1000
cache_ttl = 3600
# Logs
log_level = "info"
log_file = "/data/blindbit.log"
```
#### Sécurité
```toml
# Authentification
rpc_user = "blindbit_user"
rpc_pass = "secure_password"
# Limites
max_request_size = 1048576
rate_limit = 100
```
## 🔧 Configuration des Relais
### 1. Configuration de Base
#### Relay 1 - `sdk_relay/.conf.docker.relay1`
```ini
core_url=http://bitcoin:18443
core_wallet=relay_wallet
ws_url=0.0.0.0:8090
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://bitcoin:29000
data_dir=.4nk
cookie_path=/home/bitcoin/.4nk/bitcoin.cookie
dev_mode=true
standalone=false
relay_id=relay-1
```
#### Relay 2 - `sdk_relay/.conf.docker.relay2`
```ini
core_url=http://bitcoin:18443
core_wallet=relay_wallet
ws_url=0.0.0.0:8090
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://bitcoin:29000
data_dir=.4nk
cookie_path=/home/bitcoin/.4nk/bitcoin.cookie
dev_mode=true
standalone=false
relay_id=relay-2
```
#### Relay 3 - `sdk_relay/.conf.docker.relay3`
```ini
core_url=http://bitcoin:18443
core_wallet=relay_wallet
ws_url=0.0.0.0:8090
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://bitcoin:29000
data_dir=.4nk
cookie_path=/home/bitcoin/.4nk/bitcoin.cookie
dev_mode=true
standalone=false
relay_id=relay-3
```
### 2. Configuration Avancée
#### Performance
```ini
# Optimisation mémoire
max_connections=100
connection_timeout=30
read_timeout=60
# Cache
cache_size=1000
cache_ttl=3600
# Logs
log_level=info
log_file=/home/bitcoin/.4nk/relay.log
```
#### Sécurité
```ini
# Authentification
auth_required=true
auth_token=your_secure_token
# Limites
max_message_size=1048576
rate_limit=1000
```
### 3. Configuration de Synchronisation
```ini
# Synchronisation
sync_enabled=true
sync_interval=30
sync_timeout=10
# Découverte
discovery_enabled=true
discovery_interval=60
discovery_timeout=5
# Cache de déduplication
dedup_enabled=true
dedup_ttl=300
dedup_max_size=10000
```
## 🌐 Configuration des Nœuds Externes
### 1. Configuration de Base
Fichier : `sdk_relay/external_nodes.conf`
```toml
# Configuration des nœuds externes
[relays]
external-relay-1 = "external-relay-1.example.com:8090"
external-relay-2 = "192.168.1.100:8090"
dev3-relay = "dev3.4nkweb.com:443"
[discovery]
auto_discover = true
bootstrap_nodes = [
"bootstrap-1.4nk.net:8090",
"bootstrap-2.4nk.net:8090"
]
[security]
allowed_domains = [
"*.4nk.net",
"*.example.com",
"localhost",
"127.0.0.1"
]
[validation]
max_connection_timeout = 10
health_check_interval = 300
blacklist_threshold = 5
```
### 2. Configuration Avancée
#### Découverte Automatique
```toml
[discovery]
auto_discover = true
bootstrap_nodes = [
"bootstrap-1.4nk.net:8090",
"bootstrap-2.4nk.net:8090"
]
discovery_interval = 300
discovery_timeout = 10
max_discovered_nodes = 50
```
#### Sécurité
```toml
[security]
allowed_domains = [
"*.4nk.net",
"*.example.com",
"localhost",
"127.0.0.1"
]
blocked_domains = [
"malicious.example.com"
]
allowed_ips = [
"192.168.1.0/24",
"10.0.0.0/8"
]
```
#### Validation
```toml
[validation]
max_connection_timeout = 10
health_check_interval = 300
blacklist_threshold = 5
whitelist_enabled = false
certificate_verification = true
```
## 🔧 Configuration Tor
### 1. Image et service Tor
- Le service Tor est désormais construit localement depuis `tor/Dockerfile` et monté avec `tor/torrc`.
- Le conteneur tourne en utilisateur `debian-tor` et expose uniquement le SOCKS (9050) et, en interne, un ControlPort local (127.0.0.1:9051).
Extrait `docker-compose.yml` (service `tor`):
```yaml
services:
tor:
build: ./tor
image: 4nk_node-tor
container_name: tor-proxy
ports:
- "9050:9050"
- "9051:9051"
volumes:
- ./tor/torrc:/etc/tor/torrc:ro
command: ["tor", "-f", "/etc/tor/torrc"]
healthcheck:
test: ["CMD-SHELL", "nc -z 127.0.0.1 9050"]
interval: 30s
timeout: 5s
retries: 3
networks:
- btcnet
```
### 2. Fichier `tor/torrc`
Configuration de base (extrait):
```ini
SocksPort 0.0.0.0:9050
ControlPort 127.0.0.1:9051
DataDirectory /var/lib/tor
Log notice stdout
ClientUseIPv6 1
SafeLogging 1
ReducedConnectionPadding 1
SocksPolicy accept 0.0.0.0/0
AutomapHostsOnResolve 1
```
### 3. Bridges obfs4 (optionnels)
Pour contourner des filtrages réseaux, activer les bridges obfs4 dans `tor/torrc`:
```ini
UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy
Bridge obfs4 81.64.0.218:6697 53E6469DC06BED50543AED0311D66082F4B66676 cert=zOKy+MnZ4wWbKcENcyaElPu62PEaXdE/c802ssuzCIDa2aIC1+J4LyfPhAwSiLaAo/I/bg iat-mode=0
Bridge obfs4 198.98.53.149:443 886CA31F71272FC8B3808C601FA3ABB8A2905DB4 cert=D+zypuFdMpP8riBUbInxIguzqClR0JKkP1DbkKz5es1+OP2Fao8jiXyM+B/+DYA2ZFy6UA iat-mode=0
```
Limage Tor installe `obfs4proxy`. Après modification:
```bash
sudo docker compose build tor
sudo docker compose up -d tor
```
Vérifications:
```bash
sudo docker compose ps tor
sudo docker logs tor-proxy --tail=40
sudo docker exec tor-proxy nc -z 127.0.0.1 9050 && echo SOCKS:OK
```
#### Notes et recommandations (Tor/bridges)
- Le `ControlPort 127.0.0.1:9051` est utilisé pour le diagnostic interne. Ne pas lexposer publiquement. Une authentification peut être activée si un contrôle à distance est requis.
- Les bridges obfs4 cidessus proviennent de la page de référence du Tor Project. En cas déchec répété (messages « general SOCKS server failure » côté Tor), ajouter 23 bridges supplémentaires depuis la même source et redémarrer le service Tor.
- Pour faciliter lajout à chaud de bridges, un fichier `tor/bridges.extra` est monté en lecture seule dans le conteneur et inclus via `%include /etc/tor/bridges.extra`. Vous pouvez y coller de nouveaux bridges sans modifier `tor/torrc`, puis redémarrer Tor.
- Les tests de connectivité doivent distinguer:
- Accès SOCKS vers des services onion « publics » (ex. DuckDuckGo) pour valider le proxy Tor.
- Accès SOCKS vers lonion cible du signet pour valider la reachability du pair.
- À la date dédition, le proxy SOCKS fonctionne (onion publics accessibles), mais le pair signet `.onion:38333` est injoignable (host unreachable). La configuration du signet (signetchallenge et addnode) doit rester inchangée, conformément à la contrainte fonctionnelle.
#### Outils de diagnostic réseau
- Installer `netcat-openbsd` sur lhôte et dans les conteneurs pertinents pour faciliter les vérifications:
- Hôte: `sudo apt-get install -y netcat-openbsd`
- Conteneur Bitcoin (root): `apt-get update && apt-get install -y --no-install-recommends netcat-openbsd`
- Exemples de vérifications:
- `nc -vz -w 10 -x 127.0.0.1:9050 -X 5 <onion> 80`
- `nc -vz -w 10 -x 127.0.0.1:9050 -X 5 <onion_signet> 38333`
#### DNS externes (ex. dev.4nkweb.com)
- Si un nom de domaine (ex. `dev.4nkweb.com`) doit pointer vers un service, sassurer quun enregistrement DNS A/AAAA existe. En labsence de résolution, les tests échoueront côté HTTP/HTTPS et TCP.
- En phase de test, une entrée temporaire peut être ajoutée dans `/etc/hosts` si lIP est connue.
## 🔧 Configuration Docker Compose
### 1. Configuration de Base
Fichier : `docker-compose.yml`
```yaml
# Compose modernisé (sans clé version), publication unique via reverse proxy
services:
reverse_proxy:
image: nginx:alpine
depends_on:
- sdk_relay_1
volumes:
- ./proxy/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./certs:/etc/nginx/certs:ro
- ./ihm_client/dist:/usr/share/nginx/html:ro
ports:
- "80:80"
- "443:443"
networks:
btcnet:
aliases:
- reverse_proxy
# Tous les autres services sont internes (pas de ports exposés)
bitcoin:
networks:
- btcnet
blindbit:
networks:
- btcnet
sdk_relay_1:
networks:
- btcnet
```
### 2. Configuration Avancée
#### Ressources
```yaml
services:
bitcoin:
deploy:
resources:
limits:
memory: 2G
cpus: '1.0'
reservations:
memory: 1G
cpus: '0.5'
sdk_relay_1:
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
reservations:
memory: 256M
cpus: '0.25'
```
#### Sécurité
```yaml
services:
bitcoin:
security_opt:
- no-new-privileges:true
read_only: false
tmpfs:
- /tmp:noexec,nosuid,size=100m
sdk_relay_1:
security_opt:
- no-new-privileges:true
read_only: false
tmpfs:
- /tmp:noexec,nosuid,size=50m
```
## 🔧 Configuration SSL/TLS
### 1. Certificat Auto-Signé
```bash
# Générer et protéger des certificats auto-signés
./scripts/generate_certs.sh
# Les certificats sont montés par le reverse proxy :
# - certs/server.crt -> /etc/nginx/certs/server.crt
# - certs/server.key -> /etc/nginx/certs/server.key
```
### 2. Certificat Let's Encrypt
```bash
# Installer certbot
sudo apt install certbot python3-certbot-nginx
# Obtenir un certificat
sudo certbot --nginx -d your-domain.com
# Configuration automatique
sudo certbot renew --dry-run
```
## 🔧 Configuration de Monitoring
### 1. Prometheus
```yaml
# docker-compose.yml addition
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
prometheus_data:
grafana_data:
```
### 2. Configuration Prometheus
Fichier : `prometheus.yml`
```yaml
global:
scrape_interval: 15s
evaluation_interval: 15s
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
scrape_configs:
- job_name: 'bitcoin'
static_configs:
- targets: ['bitcoin:18443']
- job_name: 'blindbit'
static_configs:
- targets: ['blindbit:8000']
- job_name: 'sdk_relay'
static_configs:
- targets: ['sdk_relay_1:8091']
```
## 🔧 Configuration de Sauvegarde
### 1. Script de Sauvegarde
```bash
#!/bin/bash
# backup_4nk.sh
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/backup/4nk_node_$DATE"
mkdir -p $BACKUP_DIR
# Sauvegarder les configurations
cp -r sdk_relay/.conf* $BACKUP_DIR/
cp external_nodes.conf $BACKUP_DIR/
cp bitcoin/bitcoin.conf $BACKUP_DIR/
cp blindbit/blindbit.toml $BACKUP_DIR/
# Sauvegarder les données Bitcoin
docker exec bitcoin-signet tar czf /tmp/bitcoin-backup.tar.gz /home/bitcoin/.bitcoin
docker cp bitcoin-signet:/tmp/bitcoin-backup.tar.gz $BACKUP_DIR/
# Sauvegarder les données Blindbit
docker exec blindbit-oracle tar czf /tmp/blindbit-backup.tar.gz /data
docker cp blindbit-oracle:/tmp/blindbit-backup.tar.gz $BACKUP_DIR/
# Sauvegarder les données des relais
for i in {1..3}; do
docker exec sdk_relay_$i tar czf /tmp/relay_$i-backup.tar.gz /home/bitcoin/.4nk
docker cp sdk_relay_$i:/tmp/relay_$i-backup.tar.gz $BACKUP_DIR/
done
# Nettoyer les anciennes sauvegardes (garder 7 jours)
find /backup -name "4nk_node_*" -type d -mtime +7 -exec rm -rf {} \;
echo "Sauvegarde terminée: $BACKUP_DIR"
```
### 2. Configuration Cron
```bash
# Ajouter au cron pour sauvegarde automatique
echo "0 2 * * * /path/to/backup_4nk.sh" | crontab -
```
## 🔧 Configuration de Logs
### 1. Rotation des Logs
```bash
# Configuration logrotate
cat > /etc/logrotate.d/4nk-node << EOF
/var/lib/docker/containers/*/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
copytruncate
size 100M
}
EOF
```
### 2. Centralisation des Logs
```yaml
# docker-compose.yml addition
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
container_name: elasticsearch
environment:
- discovery.type=single-node
ports:
- "9200:9200"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
kibana:
image: docker.elastic.co/kibana/kibana:7.17.0
container_name: kibana
ports:
- "5601:5601"
depends_on:
- elasticsearch
filebeat:
image: docker.elastic.co/beats/filebeat:7.17.0
container_name: filebeat
volumes:
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- ./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
depends_on:
- elasticsearch
volumes:
elasticsearch_data:
```
## 📝 Checklist de Configuration
- [ ] Variables d'environnement configurées
- [ ] Configuration Bitcoin Core vérifiée
- [ ] Configuration Blindbit vérifiée
- [ ] Configurations des relais vérifiées
- [ ] Configuration des nœuds externes vérifiée
- [ ] Configuration Tor vérifiée
- [ ] Configuration Docker Compose vérifiée
- [ ] SSL/TLS configuré (si nécessaire)
- [ ] Monitoring configuré (si nécessaire)
- [ ] Sauvegarde configurée
- [ ] Logs configurés
- [ ] Pare-feu configuré
- [ ] Tests de configuration passés
## 🎯 Commandes de Configuration
```bash
# Vérifier la configuration
docker-compose config
# Tester la configuration
./test_final_sync.sh
# Appliquer la configuration
./restart_4nk_node.sh
# Vérifier les logs
docker-compose logs --tail=50
```
---
Les tags « dev » sont en cours de création et déjà référencés dans l'orchestrateur afin d'anticiper leur disponibilité. Cette page sera actualisée dès publication effective. Les mises à jour corrélées sont reflétées dans `docs/ARCHITECTURE.md` et le `CHANGELOG.md`.

40
docs/DEPLOYMENT.md Normal file
View File

@ -0,0 +1,40 @@
## DEPLOYMENT
## Docker
### Images et tags
- tor: 4nk-node-tor:latest
- bitcoin: 4nk-node-bitcoin:latest
### docker-compose
- Fichier: 4NK_node/docker-compose.yml
- Services:
- tor: ports 9050, 9051; volume tor_data; conf conf/tor.conf
- bitcoin: ports 38333, 18443, 29000; volume bitcoin_data; conf conf/bitcoin.conf; dépend de tor
- Réseau: 4nk_network (bridge)
- Volumes nommés: tor_data, bitcoin_data
## Intégration dans 4NK_node
- Configuration centralisée dans 4NK_node/conf/ (ex: bitcoin.conf, tor.conf).
- Logs montés dans 4NK_node/log/ selon la configuration des services.
- Modules complémentaires (ihm_client, sdk_relay, sdk_storage, sdk_signer) sintègrent via 4NK_node/modules/ et le réseau Docker partagé.
## CI/CD appliquée
- Construire les images avec le tag dédié docker-support-v2 selon la politique du projet.
- Valider les builds et la santé (healthchecks) avant déploiement.
- Publier les artefacts et images dans le registre interne si applicable.
## Configuration
### Variables denvironnement
- Gérées au niveau des services consommateurs (ex: ihm_client, sdk_*).
### Fichiers de configuration (4NK_node/conf)
- bitcoin.conf (Bitcoin Core)
- tor.conf (Tor)
- Fichiers spécifiques modules: sdk_relay*.conf, sdk_signer.conf, sdk_storage.conf, ihm_client.conf, nginx.conf
### Réseau et ports
- tor: 9050 (SOCKS), 9051 (Control)
- bitcoin: 38333 (P2P testnet/regtest), 18443 (RPC), 29000 (custom)

View File

@ -1,281 +0,0 @@
# Configuration Gitea - 4NK_node
Ce guide explique comment configurer le projet 4NK_node spécifiquement pour Gitea (git.4nkweb.com).
## 🎯 Configuration Gitea
### Repository Configuration
Le projet est hébergé sur : **https://git.4nkweb.com/4nk/4NK_node**
### Branches Principales
- **`main`** - Branche principale, code stable
- **`develop`** - Branche de développement (optionnelle)
- **`feature/*`** - Branches de fonctionnalités
- **`fix/*`** - Branches de corrections
### Protection des Branches
Configurez les protections suivantes sur Gitea :
1. **Branche `main`** :
- ✅ Require pull request reviews before merging
- ✅ Require status checks to pass before merging
- ✅ Require branches to be up to date before merging
- ✅ Restrict pushes that create files
- ✅ Restrict pushes that delete files
2. **Branche `develop`** (si utilisée) :
- ✅ Require pull request reviews before merging
- ✅ Require status checks to pass before merging
## 🔧 Configuration CI/CD
### Option 1 : Gitea Actions (Recommandé)
Si votre instance Gitea supporte Gitea Actions :
```yaml
# .gitea/workflows/ci.yml
name: CI - 4NK_node
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run tests
run: |
cd sdk_relay
cargo test
```
### Option 2 : Runner Externe
Configurez un runner CI/CD externe (Jenkins, GitLab CI, etc.) :
```bash
# Exemple avec Jenkins
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Test') {
steps {
sh 'cd sdk_relay && cargo test'
}
}
stage('Build') {
steps {
sh 'docker-compose build'
}
}
}
}
```
### Option 3 : GitHub Actions (Migration)
Si vous souhaitez utiliser GitHub Actions avec un miroir :
1. Créez un repository miroir sur GitHub
2. Configurez un webhook pour synchroniser automatiquement
3. Utilisez le workflow GitHub Actions existant
## 📋 Templates Gitea
### Issues Templates
Les templates d'issues sont stockés dans `.gitea/ISSUE_TEMPLATE/` :
- `bug_report.md` - Pour signaler des bugs
- `feature_request.md` - Pour proposer des fonctionnalités
### Pull Request Template
Le template de PR est dans `.gitea/PULL_REQUEST_TEMPLATE.md`
## 🔗 Intégrations Gitea
### Webhooks
Configurez des webhooks pour :
1. **Notifications** - Slack, Discord, Email
2. **CI/CD** - Déclenchement automatique des builds
3. **Deployment** - Déploiement automatique
### API Gitea
Utilisez l'API Gitea pour l'automatisation :
```bash
# Exemple : Créer une release
curl -X POST "https://git.4nkweb.com/api/v1/repos/4nk/4NK_node/releases" \
-H "Authorization: token YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "v1.0.0",
"name": "Release v1.0.0",
"body": "Description de la release"
}'
```
## 🏷️ Labels et Milestones
### Labels Recommandés
- **bug** - Problèmes et bugs
- **enhancement** - Nouvelles fonctionnalités
- **documentation** - Amélioration de la documentation
- **good first issue** - Pour les nouveaux contributeurs
- **help wanted** - Besoin d'aide
- **priority: high** - Priorité élevée
- **priority: low** - Priorité basse
- **status: blocked** - Bloqué
- **status: in progress** - En cours
- **status: ready for review** - Prêt pour review
### Milestones
- **v1.0.0** - Version stable initiale
- **v1.1.0** - Améliorations et corrections
- **v2.0.0** - Nouvelles fonctionnalités majeures
## 🔐 Sécurité Gitea
### Permissions
1. **Repository** :
- Public pour l'open source
- Issues et PR activés
- Wiki activé (optionnel)
2. **Collaborateurs** :
- Maintainers : Write access
- Contributors : Read access
- Public : Read access
### Secrets
Stockez les secrets sensibles dans les variables d'environnement Gitea :
- `DOCKER_USERNAME`
- `DOCKER_PASSWORD`
- `GITEA_TOKEN`
- `SLACK_WEBHOOK_URL`
## 📊 Monitoring et Analytics
### Gitea Analytics
- **Traffic** - Vues du repository
- **Contributors** - Contributeurs actifs
- **Issues** - Statistiques des issues
- **Pull Requests** - Statistiques des PR
### Intégrations Externes
- **Codecov** - Couverture de code
- **SonarCloud** - Qualité du code
- **Dependabot** - Mise à jour des dépendances
## 🚀 Workflow de Contribution
### 1. Fork et Clone
```bash
# Fork sur Gitea
# Puis clone
git clone https://git.4nkweb.com/votre-username/4NK_node.git
cd 4NK_node
# Ajouter l'upstream
git remote add upstream https://git.4nkweb.com/4nk/4NK_node.git
```
### 2. Développement
```bash
# Créer une branche
git checkout -b feature/nouvelle-fonctionnalite
# Développer
# ...
# Commiter
git commit -m "feat: ajouter nouvelle fonctionnalité"
# Pousser
git push origin feature/nouvelle-fonctionnalite
```
### 3. Pull Request
1. Créer une PR sur Gitea
2. Remplir le template
3. Attendre les reviews
4. Merge après approbation
## 🔧 Configuration Avancée
### Gitea Configuration
```ini
# gitea.ini
[repository]
DEFAULT_BRANCH = main
PUSH_CREATE_DELETE_PROTECTED_BRANCH = true
[repository.pull-request]
ENABLE_WHITELIST = true
WHITELIST_USERS = admin,maintainer
```
### Webhooks Configuration
```yaml
# webhook.yml
url: "https://your-ci-server.com/webhook"
content_type: "application/json"
secret: "your-secret"
events:
- push
- pull_request
- issues
```
## 📚 Ressources
### Documentation Gitea
- [Gitea Documentation](https://docs.gitea.io/)
- [Gitea API](https://docs.gitea.io/en-us/api-usage/)
- [Gitea Actions](https://docs.gitea.io/en-us/actions/)
### Outils Utiles
- **Gitea CLI** - Interface en ligne de commande
- **Gitea SDK** - SDK pour l'automatisation
- **Gitea Runner** - Runner pour les actions
---
**Configuration Gitea terminée ! Le projet est prêt pour l'open source sur git.4nkweb.com** 🚀

View File

@ -1,313 +1,25 @@
# 📚 Index de Documentation - 4NK_node
## Index de la documentation 4NK_node
Index complet de la documentation de l'infrastructure 4NK_node.
### Guides principaux
- Configuration: `docs/CONFIGURATION.md`
- Architecture: `docs/ARCHITECTURE.md`
- Usage: `docs/USAGE.md`
- Réseau et cartographie: `docs/NETWORK.md`
## 📖 Guides Principaux
### Monitoring et logs
- Stack monitoring (Loki/Promtail/Grafana): `log-monitoring.yml`
- Provisioning Grafana: `log/grafana-datasources.yml`, `log/grafana-dashboards.yml`
- Collecte Promtail: `log/promtail-config.yml`
### 🚀 [Guide d'Installation](INSTALLATION.md)
Guide complet pour installer et configurer l'infrastructure 4NK_node.
- **Prérequis système et logiciels**
- **Installation de Docker et dépendances**
- **Configuration SSH et Gitea**
- **Configuration initiale des services**
- **Tests post-installation**
- **Dépannage et monitoring**
### Reverse proxy
- Nginx conf: `conf/nginx/nginx.conf`
- Virtual host: `conf/nginx/sites-enabled/4nk_node.conf`
### 📖 [Guide d'Utilisation](USAGE.md)
Guide complet pour utiliser l'infrastructure 4NK_node au quotidien.
- **Démarrage quotidien des services**
- **Opérations de surveillance et monitoring**
- **Utilisation du réseau de relais**
- **Connexion aux services (Bitcoin Core, Blindbit, sdk_relay, sdk_storage)**
- **Tests et validation**
- **Configuration et maintenance**
- **Gestion des nœuds externes**
### Répertoires par service
- Modules: `modules/<service>/{conf,data,logs,scripts}`
- Projets: `projects/<projet>/<image>/{conf,data,logs,scripts}`
### ⚙️ [Guide de Configuration](CONFIGURATION.md)
Guide complet pour configurer l'infrastructure selon vos besoins.
- **Configuration générale et variables d'environnement**
- **Configuration Bitcoin Core (base et avancée)**
- **Configuration Blindbit (base et avancée)**
- **Configuration des relais (base et avancée)**
- **Configuration des nœuds externes**
- **Configuration Tor**
- **Configuration Docker Compose**
- **Configuration SSL/TLS**
- **Configuration de monitoring et sauvegarde**
### Notes
- Les images internes référencées en `:dev` sont en cours de création.
- Grafana est servi sous `/grafana` via Nginx.
## 🔧 Guides Techniques
### 🏗️ [Architecture Technique](ARCHITECTURE.md)
Documentation technique détaillée de l'architecture.
- **Architecture générale du système**
- **Composants principaux (Bitcoin Core, Blindbit, SDK Relay)**
- **Architecture de synchronisation mesh**
- **Flux de données entre services**
- **Configuration multi-relais**
- **Sécurité et isolation**
- **Performance et optimisations**
- **Monitoring et observabilité**
### 📡 [API Reference](API.md)
Documentation complète des APIs disponibles.
- **API Bitcoin Core RPC** : Interface JSON-RPC pour Bitcoin
- **API Blindbit HTTP** : API REST pour les paiements silencieux
- **API SDK Relay WebSocket** : Interface temps réel pour les clients
- **API SDK Relay HTTP** : API REST pour les opérations de gestion
- **API SDK Storage HTTP** : API REST de stockage clé/valeur TTL via `/storage/*`
- **Format des messages et payloads**
- **Gestion des erreurs**
- **Exemples d'utilisation**
- **Limites et quotas**
### 🔒 [Sécurité](SECURITY.md)
Guide de sécurité et bonnes pratiques.
- **Authentification et autorisation**
- **Chiffrement et certificats**
- **Isolation réseau**
- **Audit et monitoring de sécurité**
- **Bonnes pratiques**
### 🐙 [Configuration Gitea](GITEA_SETUP.md)
Guide de configuration spécifique pour Gitea.
- **Configuration du repository Gitea**
- **Templates d'issues et pull requests**
- **Configuration CI/CD avec Gitea Actions**
- **Intégrations et webhooks**
- **Workflow de contribution**
- **Sécurité et permissions**
### 🚀 [Plan de Release](RELEASE_PLAN.md)
Plan de lancement open source complet.
- **Phases de préparation**
- **Communication et marketing**
- **Checklist de lancement**
- **Support communautaire**
- **Gestion des risques**
### 🌟 [Guide de la Communauté](COMMUNITY_GUIDE.md)
Guide complet pour la communauté.
- **Comment contribuer**
- **Ressources d'apprentissage**
- **Environnement de développement**
- **Processus de contribution**
- **Support et reconnaissance**
### 🗺️ [Roadmap](ROADMAP.md)
Roadmap de développement détaillée.
- **Timeline de développement**
- **Fonctionnalités planifiées**
- **Évolution de l'architecture**
- **Métriques de succès**
- **Vision long terme**
### 📈 [Performance](PERFORMANCE.md)
Guide d'optimisation et monitoring des performances.
- **Optimisation des ressources**
- **Monitoring des performances**
- **Tests de charge**
- **Métriques et alertes**
- **Troubleshooting des performances**
## 🧪 Guides de Test
### 🧪 [Guide de Tests](TESTING.md)
Guide complet des tests de l'infrastructure 4NK_node.
- **Tests unitaires** : Tests individuels des composants
- **Tests d'intégration** : Tests d'interaction entre services
- **Tests de connectivité** : Tests réseau et WebSocket
- **Tests externes** : Tests avec des nœuds externes
- **Tests de performance** : Tests de charge et performance (à venir)
- **Organisation et exécution des tests**
- **Interprétation des résultats**
- **Dépannage et maintenance**
### 🔄 [Tests de Synchronisation](SYNC_TESTING.md)
Guide des tests de synchronisation entre relais.
- **Tests de synchronisation mesh**
- **Tests de découverte de relais**
- **Tests de cache de déduplication**
- **Tests de métriques de synchronisation**
- **Troubleshooting de la synchronisation**
### 📊 [Tests de Performance](PERFORMANCE_TESTING.md)
Guide des tests de performance et de charge.
- **Tests de charge WebSocket**
- **Tests de performance Bitcoin Core**
- **Tests de performance Blindbit**
- **Tests de scalabilité**
- **Benchmarks et métriques**
## 🌐 Guides Réseau
### 🌐 [Réseau de Relais](RELAY_NETWORK.md)
Guide de configuration du réseau mesh de relais.
- **Architecture mesh**
- **Configuration des relais locaux**
- **Synchronisation entre relais**
- **Découverte automatique**
- **Gestion des connexions**
### 🌍 [Nœuds Externes](EXTERNAL_NODES.md)
Guide d'ajout et de gestion de nœuds externes.
- **Configuration des nœuds externes**
- **Script d'administration**
- **Validation et sécurité**
- **Tests de connectivité**
- **Gestion multi-sites**
### 🔄 [Synchronisation](SYNCHRONIZATION.md)
Guide du protocole de synchronisation.
- **Protocole de synchronisation**
- **Types de messages**
- **Cache de déduplication**
- **Métriques de synchronisation**
- **Troubleshooting**
## 📋 Guides de Référence
### 📋 [Commandes Rapides](QUICK_REFERENCE.md)
Référence rapide des commandes essentielles.
- **Commandes de démarrage**
- **Commandes de monitoring**
- **Commandes de test**
- **Commandes de dépannage**
- **Commandes de maintenance**
### 📋 [Troubleshooting](TROUBLESHOOTING.md)
Guide de résolution des problèmes courants.
- **Problèmes de démarrage**
- **Problèmes de connectivité**
- **Problèmes de synchronisation**
- **Problèmes de performance**
- **Logs et diagnostics**
### 📋 [FAQ](FAQ.md)
Questions fréquemment posées.
- **Questions d'installation**
- **Questions de configuration**
- **Questions d'utilisation**
- **Questions de performance**
- **Questions de sécurité**
## 📁 Structure des Fichiers
```
4NK_node/
├── README.md # Documentation principale
├── docs/ # Documentation organisée
│ ├── INDEX.md # Cet index
│ ├── INSTALLATION.md # Guide d'installation
│ ├── USAGE.md # Guide d'utilisation
│ ├── CONFIGURATION.md # Guide de configuration
│ ├── ARCHITECTURE.md # Architecture technique
│ ├── API.md # Référence API
│ ├── SECURITY.md # Guide de sécurité
│ ├── PERFORMANCE.md # Guide de performance
│ ├── TESTING.md # Tests de base
│ ├── SYNC_TESTING.md # Tests de synchronisation
│ ├── PERFORMANCE_TESTING.md # Tests de performance
│ ├── RELAY_NETWORK.md # Réseau de relais
│ ├── EXTERNAL_NODES.md # Nœuds externes
│ ├── SYNCHRONIZATION.md # Protocole de synchronisation
│ ├── QUICK_REFERENCE.md # Commandes rapides
│ ├── TROUBLESHOOTING.md # Guide de dépannage
│ └── FAQ.md # Questions fréquentes
├── specs/ # Spécifications techniques
│ ├── spec-technique.md # Spécification technique
│ └── spec-fonctionnel.md # Spécification fonctionnelle
├── scripts/ # Scripts utilitaires
├── tests/ # Scripts de test
└── examples/ # Exemples d'utilisation
```
## 🎯 Parcours d'Apprentissage
### 🚀 **Débutant**
1. [Guide d'Installation](INSTALLATION.md) - Installer l'infrastructure
2. [Guide d'Utilisation](USAGE.md) - Utiliser les services de base
3. [Tests de Base](TESTING.md) - Vérifier le fonctionnement
4. [FAQ](FAQ.md) - Réponses aux questions courantes
### 🔧 **Intermédiaire**
1. [Guide de Configuration](CONFIGURATION.md) - Configurer selon vos besoins
2. [Réseau de Relais](RELAY_NETWORK.md) - Comprendre l'architecture mesh
3. [Nœuds Externes](EXTERNAL_NODES.md) - Ajouter des nœuds externes
4. [Tests de Synchronisation](SYNC_TESTING.md) - Tester la synchronisation
### 🏗️ **Avancé**
1. [Architecture Technique](ARCHITECTURE.md) - Comprendre l'architecture
2. [API Reference](API.md) - Utiliser les APIs
3. [Sécurité](SECURITY.md) - Sécuriser l'infrastructure
4. [Performance](PERFORMANCE.md) - Optimiser les performances
5. [Tests de Performance](PERFORMANCE_TESTING.md) - Tests avancés
### 🛠️ **Expert**
1. [Synchronisation](SYNCHRONIZATION.md) - Protocole de synchronisation
2. [Troubleshooting](TROUBLESHOOTING.md) - Résolution de problèmes
3. [Commandes Rapides](QUICK_REFERENCE.md) - Référence rapide
4. Spécifications techniques dans `/specs/`
## 🔍 Recherche dans la Documentation
### Par Sujet
- **Installation** : [INSTALLATION.md](INSTALLATION.md)
- **Configuration** : [CONFIGURATION.md](CONFIGURATION.md)
- **Utilisation** : [USAGE.md](USAGE.md)
- **Tests** : [TESTING.md](TESTING.md), [SYNC_TESTING.md](SYNC_TESTING.md)
- **Réseau** : [RELAY_NETWORK.md](RELAY_NETWORK.md), [EXTERNAL_NODES.md](EXTERNAL_NODES.md)
- **Performance** : [PERFORMANCE.md](PERFORMANCE.md)
- **Sécurité** : [SECURITY.md](SECURITY.md)
- **Dépannage** : [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
### Par Service
- **Bitcoin Core** : [CONFIGURATION.md](CONFIGURATION.md#configuration-bitcoin-core)
- **Blindbit** : [CONFIGURATION.md](CONFIGURATION.md#configuration-blindbit)
- **sdk_relay** : [CONFIGURATION.md](CONFIGURATION.md#configuration-des-relais)
- **Tor** : [CONFIGURATION.md](CONFIGURATION.md#configuration-tor)
### Par Tâche
- **Démarrer** : [USAGE.md](USAGE.md#démarrage-quotidien)
- **Configurer** : [CONFIGURATION.md](CONFIGURATION.md)
- **Tester** : [TESTING.md](TESTING.md)
- **Monitorer** : [USAGE.md](USAGE.md#monitoring-et-alertes)
- **Dépanner** : [TROUBLESHOOTING.md](TROUBLESHOOTING.md)
## 📞 Support
### Documentation
- **Index** : [INDEX.md](INDEX.md) - Cet index
- **FAQ** : [FAQ.md](FAQ.md) - Questions fréquentes
- **Troubleshooting** : [TROUBLESHOOTING.md](TROUBLESHOOTING.md) - Résolution de problèmes
### Ressources Externes
- **Repository** : https://git.4nkweb.com/4nk/4NK_node
- **Issues** : https://git.4nkweb.com/4nk/4NK_node/issues
- **Wiki** : https://git.4nkweb.com/4nk/4NK_node/wiki
### Contact
- **Email** : support@4nkweb.com
- **Chat** : [Discord 4NK](https://discord.gg/4nk)
- **Forum** : [Forum 4NK](https://forum.4nkweb.com)
## 🔄 Mise à Jour de la Documentation
### Dernière Mise à Jour
- **Date** : $(date)
- **Version** : 1.1.0
- **Auteur** : Équipe 4NK
### Historique des Versions
- **v1.0.0** : Documentation initiale complète
- **v0.9.0** : Documentation de base
- **v0.8.0** : Guides techniques
- **v0.7.0** : Guides de test
### Contribution
Pour contribuer à la documentation :
1. Fork le repository
2. Créer une branche pour votre contribution
3. Modifier la documentation
4. Créer une Pull Request
---

View File

@ -1,578 +0,0 @@
# 📦 Guide d'Installation - 4NK_node
Guide complet pour installer et configurer l'infrastructure 4NK_node.
## 📋 Prérequis
### Système
- **OS** : Linux (Ubuntu 20.04+, Debian 11+, CentOS 8+)
- **Architecture** : x86_64
- **RAM** : 4 Go minimum, 8 Go recommandés
- **Stockage** : 20 Go minimum, 50 Go recommandés
- **Réseau** : Connexion Internet stable
### Logiciels
- **Docker** : Version 20.10+
- **Docker Compose** : Version 2.0+
- **Git** : Version 2.25+
- **Bash** : Version 4.0+
## 🚀 Installation
### 1. Amorçage automatique (recommandé)
Exécuter le script damorçage qui installe git, Docker, Docker Compose, Node.js/npm (via nvm, dernière LTS) et ajoute lutilisateur au groupe docker dès le début.
```bash
./scripts/bootstrap.sh
# Se déconnecter/reconnecter ensuite ou `newgrp docker` pour activer le groupe docker
```
### 2. Installation de Docker (manuel)
#### Ubuntu/Debian
```bash
# Mettre à jour les paquets
sudo apt update
# Installer les dépendances
sudo apt install -y apt-transport-https ca-certificates curl gnupg lsb-release
# Ajouter la clé GPG Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Ajouter le repository Docker
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Installer Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Ajouter l'utilisateur au groupe docker
sudo usermod -aG docker $USER
# Démarrer Docker
sudo systemctl start docker
sudo systemctl enable docker
```
#### CentOS/RHEL
```bash
# Installer les dépendances
sudo yum install -y yum-utils
# Ajouter le repository Docker
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Installer Docker
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
# Démarrer Docker
sudo systemctl start docker
sudo systemctl enable docker
# Ajouter l'utilisateur au groupe docker
sudo usermod -aG docker $USER
```
### 3. Configuration SSH (recommandé)
```bash
# Générer une clé SSH
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_4nk -C "4nk-automation"
# Ajouter à l'agent SSH
ssh-add ~/.ssh/id_ed25519_4nk
# Configurer Git pour utiliser la clé
git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519_4nk"
# Afficher la clé publique pour Gitea
cat ~/.ssh/id_ed25519_4nk.pub
```
**Ajouter la clé publique à Gitea :**
1. Aller sur Gitea > Settings > SSH Keys
2. Coller la clé publique
3. Cliquer sur "Add key"
### 4. Clonage du repository
```bash
# Cloner avec SSH (recommandé)
git clone git@git.4nkweb.com:4nk/4NK_node.git
cd 4NK_node
# Ou avec HTTPS (si SSH non configuré)
# git clone https://git.4nkweb.com/4nk/4NK_node.git
# cd 4NK_node
```
### 5. Vérification de l'installation
```bash
# Vérifier Docker
docker --version
docker-compose --version
# Vérifier la connectivité Gitea
ssh -T git@git.4nkweb.com
# Vérifier les permissions
ls -la
```
## 🔧 Configuration initiale
### 1. Configuration des Variables d'Environnement
```bash
# Créer le fichier d'environnement
cat > .env << EOF
# Configuration 4NK_node
PROJECT_NAME=4NK_node
NETWORK_NAME=4nk_node_btcnet
# Logs
RUST_LOG=debug,bitcoincore_rpc=trace
# Bitcoin
BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
# Synchronisation
ENABLE_SYNC_TEST=1
# Ports
TOR_PORTS=9050:9050,9051:9051
BITCOIN_PORTS=38333:38333,18443:18443,29000:29000
BLINDBIT_PORTS=8000:8000
RELAY_1_PORTS=8090:8090,8091:8091
RELAY_2_PORTS=8092:8090,8093:8091
RELAY_3_PORTS=8094:8090,8095:8091
EOF
```
### 2. Préparation de lUI (ihm_client)
```bash
# Construire lUI localement et produire ./ihm_client/dist
chmod +x scripts/build_ui_local.sh
./scripts/build_ui_local.sh
```
### 3. Génération des certificats
```bash
# Générer les certificats auto-signés et appliquer les bons droits
chmod +x scripts/generate_certs.sh
./scripts/generate_certs.sh
```
### 4. Configuration Bitcoin Core
```bash
# Vérifier la configuration Bitcoin
cat bitcoin/bitcoin.conf
# Modifier si nécessaire
nano bitcoin/bitcoin.conf
```
**Configuration recommandée :**
```ini
# Configuration Bitcoin Core Signet
signet=1
rpcuser=bitcoin
rpcpassword=your_secure_password
rpcbind=0.0.0.0
rpcallowip=172.19.0.0/16
zmqpubrawblock=tcp://0.0.0.0:29000
zmqpubrawtx=tcp://0.0.0.0:29000
txindex=1
server=1
listen=1
```
### 5. Configuration Tor (option bridges)
Si votre réseau nécessite des bridges obfs4, ajoutez-les dans `tor/torrc`:
```ini
UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy
# Exemple
Bridge obfs4 81.64.0.218:6697 53E6469DC06BED50543AED0311D66082F4B66676 cert=zOKy+MnZ4wWbKcENcyaElPu62PEaXdE/c802ssuzCIDa2aIC1+J4LyfPhAwSiLaAo/I/bg iat-mode=0
Bridge obfs4 198.98.53.149:443 886CA31F71272FC8B3808C601FA3ABB8A2905DB4 cert=D+zypuFdMpP8riBUbInxIguzqClR0JKkP1DbkKz5es1+OP2Fao8jiXyM+B/+DYA2ZFy6UA iat-mode=0
```
Puis reconstruire et (re)démarrer:
```bash
sudo docker compose build tor
sudo docker compose up -d tor
```
### 6. Configuration Blindbit
```bash
# Vérifier la configuration Blindbit
cat blindbit/blindbit.toml
# Modifier si nécessaire
nano blindbit/blindbit.toml
```
**Configuration recommandée :**
```toml
# Configuration Blindbit
host = "0.0.0.0:8000"
chain = "signet"
rpc_endpoint = "http://bitcoin:18443"
cookie_path = "/home/bitcoin/.bitcoin/signet/.cookie"
sync_start_height = 1
max_parallel_tweak_computations = 4
max_parallel_requests = 4
```
### 7. Configuration des Relais
```bash
# Vérifier les configurations des relais
ls -la sdk_relay/.conf.docker.*
# Modifier si nécessaire
nano sdk_relay/.conf.docker.relay1
nano sdk_relay/.conf.docker.relay2
nano sdk_relay/.conf.docker.relay3
```
**Configuration recommandée pour chaque relay :**
```ini
core_url=http://bitcoin:18443
core_wallet=relay_wallet
ws_url=0.0.0.0:8090
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://bitcoin:29000
data_dir=.4nk
cookie_path=/home/bitcoin/.4nk/bitcoin.cookie
dev_mode=true
standalone=false
relay_id=relay-1 # Changer pour chaque relay
```
## 🚀 Démarrage
### 1. Démarrage Complet
```bash
# Démarrer linfrastructure (reverse proxy inclus)
sudo docker compose up -d --build
# Vérifier le statut
docker ps
```
### 2. Démarrage Séquentiel (Debug)
```bash
# Démarrer Tor (si utilisé)
sudo docker compose up -d tor
# Démarrer Bitcoin Core
sudo docker compose up -d bitcoin
# Attendre la synchronisation Bitcoin (10-30 minutes)
echo "Attendre la synchronisation Bitcoin..."
docker logs bitcoin-signet | grep "progress"
# Démarrer Blindbit
sudo docker compose up -d blindbit
# Démarrer les relais et le reverse proxy
sudo docker compose up -d sdk_relay_1 sdk_relay_2 sdk_relay_3 reverse_proxy
```
### 3. Vérification du Démarrage
```bash
# Vérifier tous les services
docker ps
# Vérifier les logs
docker-compose logs --tail=50
# Vérifier laccès public
curl -kI https://<IP_VM>/
curl -kI https://<IP_VM>/api/
```
## 🧪 Tests Post-Installation
### 1. Tests de Connectivité
```bash
# Test de base
./test_final_sync.sh
# Test de synchronisation
./test_sync_logs.sh
# Test des messages WebSocket
python3 test_websocket_messages.py
```
### 2. Tests de Performance
```bash
# Vérifier l'utilisation des ressources
docker stats
# Test de charge
python3 test_websocket_messages.py --load-test
# Monitoring de la synchronisation
./monitor_sync.sh
```
### 3. Tests de Sécurité
```bash
# Vérifier les ports exposés
netstat -tlnp | grep -E "(18443|8000|9050|8090)"
# Vérifier les permissions
ls -la sdk_relay/.conf*
ls -la bitcoin/bitcoin.conf
ls -la blindbit/blindbit.toml
```
## 🔧 Configuration Avancée
### 1. Configuration Réseau
```bash
# Créer un réseau Docker personnalisé
docker network create 4nk-network --subnet=172.20.0.0/16
# Modifier docker-compose.yml
sed -i 's/4nk_default/4nk-network/g' docker-compose.yml
```
### 2. Configuration SSL/TLS
```bash
# Générer un certificat auto-signé
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
# Configurer nginx comme proxy SSL
cat > nginx.conf << EOF
server {
listen 443 ssl;
server_name your-domain.com;
ssl_certificate cert.pem;
ssl_certificate_key key.pem;
location / {
proxy_pass http://localhost:8090;
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host \$host;
}
}
EOF
```
### 3. Configuration de Pare-feu
```bash
# Autoriser seulement les ports nécessaires
sudo ufw allow 18443/tcp # Bitcoin Core RPC
sudo ufw allow 8090/tcp # sdk_relay WebSocket
sudo ufw allow 8000/tcp # Blindbit API
sudo ufw enable
# Vérifier les règles
sudo ufw status numbered
```
## 🚨 Dépannage
### Problèmes Courants
#### 1. Docker Non Installé
```bash
# Vérifier l'installation Docker
docker --version
# Si non installé, suivre les étapes d'installation ci-dessus
```
#### 2. Permissions Docker
```bash
# Vérifier les permissions
docker ps
# Si erreur de permission
sudo usermod -aG docker $USER
newgrp docker
```
#### 3. Ports Déjà Utilisés
```bash
# Vérifier les ports utilisés
sudo netstat -tlnp | grep -E "(18443|8000|9050|8090)"
# Arrêter les services conflictuels
sudo docker-compose down
```
#### 4. Problèmes de Synchronisation Bitcoin
```bash
# Vérifier les logs Bitcoin
docker logs bitcoin-signet
# Vérifier l'espace disque
df -h
# Redémarrer Bitcoin Core
docker restart bitcoin-signet
```
### Logs Utiles
```bash
# Logs de tous les services
docker-compose logs -f
# Logs d'un service spécifique
docker logs bitcoin-signet
docker logs blindbit-oracle
docker logs sdk_relay_1
# Logs avec timestamps
docker-compose logs -t
# Logs depuis une date
docker-compose logs --since="2024-01-01T00:00:00"
```
## 📊 Monitoring
### 1. Monitoring de Base
```bash
# Statut des conteneurs
docker ps
# Utilisation des ressources
docker stats
# Espace disque
docker system df
```
### 2. Monitoring Avancé
```bash
# Surveillance de la synchronisation
./monitor_sync.sh
# Monitoring en continu
while true; do
echo "=== $(date) ==="
docker stats --no-stream | grep -E "(sdk_relay|bitcoin)"
sleep 30
done
```
### 3. Alertes
```bash
# Script d'alerte simple
cat > monitor_alert.sh << 'EOF'
#!/bin/bash
if ! docker ps | grep -q "bitcoin-signet.*Up"; then
echo "ALERTE: Bitcoin Core n'est pas en cours d'exécution!"
# Ajouter notification (email, Slack, etc.)
fi
EOF
chmod +x monitor_alert.sh
```
## 🔄 Mise à Jour
### 1. Mise à Jour de l'Infrastructure
```bash
# Sauvegarder la configuration
cp -r . ../4NK_node_backup_$(date +%Y%m%d)
# Mettre à jour le code
git pull origin main
# Redémarrer les services
./restart_4nk_node.sh
```
### 2. Mise à Jour de Docker
```bash
# Mettre à jour Docker
sudo apt update
sudo apt upgrade docker-ce docker-ce-cli containerd.io
# Redémarrer Docker
sudo systemctl restart docker
```
### 3. Mise à Jour des Images
```bash
# Reconstruire les images
docker-compose build --no-cache
# Redémarrer les services
docker-compose up -d
```
## 📝 Checklist d'Installation
- [ ] Docker installé et configuré
- [ ] Docker Compose installé
- [ ] Clé SSH configurée pour GitLab
- [ ] Repository cloné
- [ ] Variables d'environnement configurées
- [ ] Configurations Bitcoin Core vérifiées
- [ ] Configurations Blindbit vérifiées
- [ ] Configurations des relais vérifiées
- [ ] Services démarrés avec succès
- [ ] Tests de connectivité passés
- [ ] Tests de synchronisation passés
- [ ] Monitoring configuré
- [ ] Pare-feu configuré (optionnel)
- [ ] SSL/TLS configuré (optionnel)
## 🎉 Installation Terminée
Félicitations ! L'infrastructure 4NK_node est maintenant installée et configurée.
**Prochaines étapes :**
1. Consulter le [Guide d'Utilisation](USAGE.md)
2. Configurer les [Nœuds Externes](EXTERNAL_NODES.md)
3. Tester la [Synchronisation](SYNCHRONIZATION.md)
4. Configurer le [Monitoring](PERFORMANCE.md)
---

View File

@ -1,297 +0,0 @@
# Intégration de ihm_client dans 4NK_node
## Vue d'ensemble
L'interface utilisateur `ihm_client` a été intégrée avec succès dans l'infrastructure `4NK_node`, permettant une expérience utilisateur complète pour interagir avec les Silent Payments.
## Architecture
### Services intégrés
1. **ihm_client** - Interface utilisateur web
- Port: 8080
- URL: http://localhost:8080
- Technologie: TypeScript + Vite + Vue.js
2. **sdk_relay_1, sdk_relay_2, sdk_relay_3** - Relais Silent Payments
- Ports: 8090-8095
- Technologie: Rust
3. **bitcoin** - Nœud Bitcoin Signet
- Port: 18443 (RPC)
- Technologie: Bitcoin Core
4. **blindbit** - Oracle Blindbit
- Port: 8000
- Technologie: Rust
### Communication entre services
```
ihm_client (8080)
↓ HTTP/WebSocket
sdk_relay_1 (8090/8091)
↓ P2P
sdk_relay_2 (8092/8093)
↓ P2P
sdk_relay_3 (8094/8095)
↓ RPC
bitcoin (18443)
↓ API
blindbit (8000)
```
## Configuration
### Variables d'environnement
Le service `ihm_client` est configuré avec les variables d'environnement suivantes :
```yaml
environment:
- SDK_RELAY_WS_URL=ws://sdk_relay_1:8090
- SDK_RELAY_HTTP_URL=http://sdk_relay_1:8091
- BITCOIN_RPC_URL=http://bitcoin:18443
- BLINDBIT_URL=http://blindbit:8000
```
### Dépendances
- `ihm_client` dépend de `sdk_relay_1`, `sdk_relay_2`, `sdk_relay_3`
- Les SDK relays dépendent de `bitcoin` et `blindbit`
- `blindbit` dépend de `bitcoin`
## Démarrage
### Script de démarrage complet
```bash
./start-4nk-node-with-ui.sh
```
Ce script :
1. Arrête et nettoie les conteneurs existants
2. Démarre tous les services
3. Vérifie la santé de chaque service
4. Affiche les URLs d'accès
### Script de démarrage UI uniquement
```bash
./start-ihm-client.sh
```
Ce script démarre uniquement l'interface utilisateur.
### Démarrage manuel
```bash
# Démarrer tous les services
docker-compose up -d
# Démarrer uniquement l'interface utilisateur
docker-compose up -d ihm_client
```
## URLs d'accès
| Service | URL | Description |
|---------|-----|-------------|
| Interface utilisateur | http://localhost:8080 | Interface web principale |
| Bitcoin RPC | http://localhost:18443 | API Bitcoin |
| Blindbit | http://localhost:8000 | Oracle Blindbit |
| SDK Relay 1 | http://localhost:8091 | Relais 1 HTTP |
| SDK Relay 2 | http://localhost:8093 | Relais 2 HTTP |
| SDK Relay 3 | http://localhost:8095 | Relais 3 HTTP |
## Commandes utiles
### Vérification du statut
```bash
# Statut de tous les services
docker-compose ps
# Logs d'un service spécifique
docker-compose logs ihm_client
docker-compose logs sdk_relay_1
docker-compose logs bitcoin
```
### Gestion des services
```bash
# Redémarrer un service
docker-compose restart ihm_client
# Arrêter tous les services
docker-compose down
# Reconstruire un service
docker-compose build ihm_client
```
### Debugging
```bash
# Accéder au conteneur ihm_client
docker exec -it 4nk-ihm-client bash
# Vérifier les logs en temps réel
docker-compose logs -f ihm_client
```
## Fonctionnalités de l'interface utilisateur
### Pages principales
1. **Accueil** - Vue d'ensemble et navigation
2. **Compte** - Gestion du profil utilisateur
3. **Processus** - Création et gestion des processus
4. **Signature** - Signatures de documents
5. **Chat** - Communication entre membres
### Fonctionnalités clés
- **Pairing** - Connexion avec d'autres utilisateurs
- **Wallet** - Gestion des Silent Payments
- **Documents** - Validation et signature de documents
- **Notifications** - Système de notifications en temps réel
- **QR Code** - Scanner et génération de QR codes
## Développement
### Structure des fichiers
```
4NK_node/
├── ihm_client/ # Interface utilisateur
│ ├── src/ # Code source TypeScript
│ ├── public/ # Assets statiques
│ ├── Dockerfile # Configuration Docker
│ ├── nginx.conf # Configuration Nginx
│ └── start.sh # Script de démarrage
├── docker-compose.yml # Orchestration des services
└── start-*.sh # Scripts de démarrage
```
### Compilation
L'interface utilisateur est compilée automatiquement lors du build Docker :
```bash
# Build manuel
docker-compose build ihm_client
# Build avec cache
docker-compose build --no-cache ihm_client
```
### Développement local
Pour développer l'interface utilisateur localement :
```bash
cd ihm_client
npm install
npm run dev
```
## Monitoring et logs
### Health checks
Chaque service dispose d'un health check configuré :
- **ihm_client** : Vérification HTTP sur localhost
- **sdk_relay** : Script de vérification personnalisé
- **bitcoin** : Commande `getblockchaininfo`
### Logs
Les logs sont configurés avec rotation :
```yaml
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
```
## Sécurité
### Variables d'environnement
Les variables sensibles sont configurées via les variables d'environnement Docker.
### Réseau
Tous les services communiquent via le réseau Docker `btcnet` isolé.
### Volumes
Les données persistantes sont stockées dans des volumes Docker nommés.
## Troubleshooting
### Problèmes courants
1. **Service ne démarre pas**
```bash
docker-compose logs <service_name>
```
2. **Port déjà utilisé**
```bash
sudo netstat -tulpn | grep :8080
```
3. **Problème de compilation**
```bash
docker-compose build --no-cache ihm_client
```
### Logs de debug
Pour activer les logs de debug :
```bash
# SDK relays
export RUST_LOG=debug
# Interface utilisateur
docker-compose logs -f ihm_client
```
## Maintenance
### Mise à jour
```bash
# Mettre à jour depuis le repository
git pull origin main
# Reconstruire les services
docker-compose build
# Redémarrer
docker-compose up -d
```
### Sauvegarde
```bash
# Sauvegarder les volumes
docker run --rm -v 4nk_node_bitcoin_data:/data -v $(pwd):/backup alpine tar czf /backup/backup.tar.gz -C /data .
```
## Support
Pour toute question ou problème :
1. Vérifier les logs : `docker-compose logs`
2. Consulter la documentation : `docs/`
3. Créer une issue sur le repository Gitea

View File

@ -1,380 +0,0 @@
# 🔄 Guide de Migration - Documentation 4NK_node
Guide pour migrer et organiser la documentation existante vers la nouvelle structure.
## 📋 État Actuel
### Fichiers de Documentation Existants
#### Documentation Principale
- `README.md` - Documentation principale (mis à jour)
- `EXEMPLES_PRATIQUES.md` - Exemples d'utilisation (à migrer)
#### Documentation Technique
- `specs/spec-technique.md` - Spécification technique (à conserver)
- `specs/spec-fonctionnel.md` - Spécification fonctionnelle (à conserver)
- `specs/spec-technical.md` - Spécification technique (à fusionner)
#### Documentation de Configuration
- `CONFIGURATION_DEV3.md` - Configuration dev3.4nkweb.com (à migrer)
- `INTEGRATION_DEV3_FINAL.md` - Intégration dev3.4nkweb.com (à migrer)
#### Documentation de Processus
- `COMMANDES_REDEMARRAGE.md` - Commandes de redémarrage (à migrer)
- `RESUME_AJOUT_DEV3.md` - Résumé ajout dev3 (à migrer)
- `RESUME_DECOUVERTE_NOEUDS.md` - Découverte des nœuds (à migrer)
- `RESUME_SCRIPT_RESTART.md` - Script de redémarrage (à migrer)
- `RESUME_TEST_3_RELAIS.md` - Test 3 relais (à migrer)
#### Documentation de Scripts
- `README_RESTART_SCRIPT.md` - Documentation script redémarrage (à migrer)
- `explain_node_discovery.md` - Explication découverte nœuds (à migrer)
## 🎯 Plan de Migration
### 1. Structure de Documentation
```
4NK_node/
├── README.md # ✅ Mis à jour
├── docs/ # ✅ Nouvelle structure
│ ├── INDEX.md # ✅ Créé
│ ├── INSTALLATION.md # ✅ Créé
│ ├── USAGE.md # ✅ Créé
│ ├── CONFIGURATION.md # ✅ Créé
│ ├── QUICK_REFERENCE.md # ✅ Créé
│ ├── MIGRATION.md # ✅ Ce fichier
│ ├── ARCHITECTURE.md # 🔄 À créer
│ ├── API.md # 🔄 À créer
│ ├── SECURITY.md # 🔄 À créer
│ ├── PERFORMANCE.md # 🔄 À créer
│ ├── TESTING.md # 🔄 À créer
│ ├── SYNC_TESTING.md # 🔄 À créer
│ ├── PERFORMANCE_TESTING.md # 🔄 À créer
│ ├── RELAY_NETWORK.md # 🔄 À créer
│ ├── EXTERNAL_NODES.md # 🔄 À créer
│ ├── SYNCHRONIZATION.md # 🔄 À créer
│ ├── TROUBLESHOOTING.md # 🔄 À créer
│ └── FAQ.md # 🔄 À créer
├── specs/ # ✅ À conserver
│ ├── spec-technique.md # ✅ Conserver
│ └── spec-fonctionnel.md # ✅ Conserver
├── archive/ # 🔄 À créer
│ ├── docs/ # 🔄 Anciens fichiers
│ └── README.md # 🔄 Documentation archive
└── examples/ # 🔄 À créer
├── configuration/ # 🔄 Exemples de config
├── scripts/ # 🔄 Scripts d'exemple
└── tests/ # 🔄 Tests d'exemple
```
### 2. Migration des Fichiers
#### Fichiers à Migrer vers `docs/`
| Fichier Source | Destination | Statut |
|----------------|-------------|---------|
| `EXEMPLES_PRATIQUES.md` | `docs/USAGE.md` | ✅ Intégré |
| `CONFIGURATION_DEV3.md` | `docs/EXTERNAL_NODES.md` | 🔄 À migrer |
| `INTEGRATION_DEV3_FINAL.md` | `docs/EXTERNAL_NODES.md` | 🔄 À migrer |
| `COMMANDES_REDEMARRAGE.md` | `docs/QUICK_REFERENCE.md` | ✅ Intégré |
| `RESUME_AJOUT_DEV3.md` | `docs/EXTERNAL_NODES.md` | 🔄 À migrer |
| `RESUME_DECOUVERTE_NOEUDS.md` | `docs/RELAY_NETWORK.md` | 🔄 À migrer |
| `RESUME_SCRIPT_RESTART.md` | `docs/QUICK_REFERENCE.md` | ✅ Intégré |
| `RESUME_TEST_3_RELAIS.md` | `docs/SYNC_TESTING.md` | 🔄 À migrer |
| `README_RESTART_SCRIPT.md` | `docs/QUICK_REFERENCE.md` | ✅ Intégré |
| `explain_node_discovery.md` | `docs/RELAY_NETWORK.md` | 🔄 À migrer |
#### Fichiers à Conserver
| Fichier | Raison | Action |
|---------|--------|---------|
| `specs/spec-technique.md` | Documentation technique détaillée | ✅ Conserver |
| `specs/spec-fonctionnel.md` | Spécification fonctionnelle | ✅ Conserver |
| `specs/spec-technical.md` | Spécification technique | 🔄 Fusionner avec spec-technique.md |
#### Fichiers à Archiver
| Fichier | Action |
|---------|--------|
| `EXEMPLES_PRATIQUES.md` | 🔄 Déplacer vers `archive/docs/` |
| `CONFIGURATION_DEV3.md` | 🔄 Déplacer vers `archive/docs/` |
| `INTEGRATION_DEV3_FINAL.md` | 🔄 Déplacer vers `archive/docs/` |
| `COMMANDES_REDEMARRAGE.md` | 🔄 Déplacer vers `archive/docs/` |
| `RESUME_AJOUT_DEV3.md` | 🔄 Déplacer vers `archive/docs/` |
| `RESUME_DECOUVERTE_NOEUDS.md` | 🔄 Déplacer vers `archive/docs/` |
| `RESUME_SCRIPT_RESTART.md` | 🔄 Déplacer vers `archive/docs/` |
| `RESUME_TEST_3_RELAIS.md` | 🔄 Déplacer vers `archive/docs/` |
| `README_RESTART_SCRIPT.md` | 🔄 Déplacer vers `archive/docs/` |
| `explain_node_discovery.md` | 🔄 Déplacer vers `archive/docs/` |
## 🔄 Processus de Migration
### Étape 1 : Créer la Structure
```bash
# Créer les dossiers
mkdir -p docs archive/docs examples/{configuration,scripts,tests}
# Créer le README de l'archive
cat > archive/README.md << 'EOF'
# 📦 Archive - Documentation 4NK_node
Ce dossier contient les anciens fichiers de documentation qui ont été migrés vers la nouvelle structure organisée.
## 📁 Contenu
- `docs/` - Anciens fichiers de documentation
- `README.md` - Ce fichier
## 🔗 Liens vers la Nouvelle Documentation
- **Documentation principale** : [../docs/INDEX.md](../docs/INDEX.md)
- **Guide d'installation** : [../docs/INSTALLATION.md](../docs/INSTALLATION.md)
- **Guide d'utilisation** : [../docs/USAGE.md](../docs/USAGE.md)
- **Guide de configuration** : [../docs/CONFIGURATION.md](../docs/CONFIGURATION.md)
- **Référence rapide** : [../docs/QUICK_REFERENCE.md](../docs/QUICK_REFERENCE.md)
## 📅 Date de Migration
Migration effectuée le : $(date)
EOF
```
### Étape 2 : Migrer les Fichiers
```bash
# Déplacer les fichiers vers l'archive
mv EXEMPLES_PRATIQUES.md archive/docs/
mv CONFIGURATION_DEV3.md archive/docs/
mv INTEGRATION_DEV3_FINAL.md archive/docs/
mv COMMANDES_REDEMARRAGE.md archive/docs/
mv RESUME_AJOUT_DEV3.md archive/docs/
mv RESUME_DECOUVERTE_NOEUDS.md archive/docs/
mv RESUME_SCRIPT_RESTART.md archive/docs/
mv RESUME_TEST_3_RELAIS.md archive/docs/
mv README_RESTART_SCRIPT.md archive/docs/
mv explain_node_discovery.md archive/docs/
```
### Étape 3 : Fusionner les Spécifications
```bash
# Fusionner spec-technical.md dans spec-technique.md
cat specs/spec-technical.md >> specs/spec-technique.md
# Supprimer le fichier fusionné
rm specs/spec-technical.md
```
### Étape 4 : Créer les Guides Manquants
#### Créer `docs/ARCHITECTURE.md`
```bash
# Extraire les sections architecture de spec-technique.md
grep -A 50 "Architecture" specs/spec-technique.md > docs/ARCHITECTURE.md
```
#### Créer `docs/EXTERNAL_NODES.md`
```bash
# Combiner les fichiers de configuration externe
cat archive/docs/CONFIGURATION_DEV3.md archive/docs/INTEGRATION_DEV3_FINAL.md archive/docs/RESUME_AJOUT_DEV3.md > docs/EXTERNAL_NODES.md
```
#### Créer `docs/RELAY_NETWORK.md`
```bash
# Combiner les fichiers de réseau de relais
cat archive/docs/RESUME_DECOUVERTE_NOEUDS.md archive/docs/explain_node_discovery.md > docs/RELAY_NETWORK.md
```
#### Créer `docs/SYNC_TESTING.md`
```bash
# Extraire les sections de test de synchronisation
cat archive/docs/RESUME_TEST_3_RELAIS.md > docs/SYNC_TESTING.md
```
### Étape 5 : Créer les Exemples
```bash
# Créer des exemples de configuration
cat > examples/configuration/bitcoin.conf.example << 'EOF'
# Exemple de configuration Bitcoin Core
signet=1
rpcuser=bitcoin
rpcpassword=your_secure_password
rpcbind=0.0.0.0
rpcallowip=172.19.0.0/16
zmqpubrawblock=tcp://0.0.0.0:29000
zmqpubrawtx=tcp://0.0.0.0:29000
txindex=1
server=1
listen=1
EOF
# Créer des exemples de scripts
cat > examples/scripts/monitor.sh << 'EOF'
#!/bin/bash
# Exemple de script de monitoring
while true; do
echo "=== $(date) ==="
docker ps --format "table {{.Names}}\t{{.Status}}"
sleep 30
done
EOF
chmod +x examples/scripts/monitor.sh
```
## 📋 Checklist de Migration
### ✅ Fichiers Créés
- [x] `docs/INDEX.md` - Index de documentation
- [x] `docs/INSTALLATION.md` - Guide d'installation
- [x] `docs/USAGE.md` - Guide d'utilisation
- [x] `docs/CONFIGURATION.md` - Guide de configuration
- [x] `docs/QUICK_REFERENCE.md` - Référence rapide
- [x] `docs/MIGRATION.md` - Ce guide de migration
### 🔄 Fichiers à Créer
- [ ] `docs/ARCHITECTURE.md` - Architecture technique
- [ ] `docs/API.md` - Référence API
- [ ] `docs/SECURITY.md` - Guide de sécurité
- [ ] `docs/PERFORMANCE.md` - Guide de performance
- [ ] `docs/TESTING.md` - Tests de base
- [ ] `docs/SYNC_TESTING.md` - Tests de synchronisation
- [ ] `docs/PERFORMANCE_TESTING.md` - Tests de performance
- [ ] `docs/RELAY_NETWORK.md` - Réseau de relais
- [ ] `docs/EXTERNAL_NODES.md` - Nœuds externes
- [ ] `docs/SYNCHRONIZATION.md` - Protocole de synchronisation
- [ ] `docs/TROUBLESHOOTING.md` - Guide de dépannage
- [ ] `docs/FAQ.md` - Questions fréquentes
### 🔄 Fichiers à Migrer
- [ ] `EXEMPLES_PRATIQUES.md``archive/docs/`
- [ ] `CONFIGURATION_DEV3.md``archive/docs/`
- [ ] `INTEGRATION_DEV3_FINAL.md``archive/docs/`
- [ ] `COMMANDES_REDEMARRAGE.md``archive/docs/`
- [ ] `RESUME_AJOUT_DEV3.md``archive/docs/`
- [ ] `RESUME_DECOUVERTE_NOEUDS.md``archive/docs/`
- [ ] `RESUME_SCRIPT_RESTART.md``archive/docs/`
- [ ] `RESUME_TEST_3_RELAIS.md``archive/docs/`
- [ ] `README_RESTART_SCRIPT.md``archive/docs/`
- [ ] `explain_node_discovery.md``archive/docs/`
### 🔄 Fichiers à Fusionner
- [ ] `specs/spec-technical.md``specs/spec-technique.md`
### 🔄 Dossiers à Créer
- [ ] `archive/` - Dossier d'archive
- [ ] `archive/docs/` - Anciens fichiers de documentation
- [ ] `examples/` - Exemples d'utilisation
- [ ] `examples/configuration/` - Exemples de configuration
- [ ] `examples/scripts/` - Scripts d'exemple
- [ ] `examples/tests/` - Tests d'exemple
## 🎯 Résultat Final
### Structure Finale
```
4NK_node/
├── README.md # Documentation principale
├── docs/ # Documentation organisée
│ ├── INDEX.md # Index de documentation
│ ├── INSTALLATION.md # Guide d'installation
│ ├── USAGE.md # Guide d'utilisation
│ ├── CONFIGURATION.md # Guide de configuration
│ ├── QUICK_REFERENCE.md # Référence rapide
│ ├── ARCHITECTURE.md # Architecture technique
│ ├── API.md # Référence API
│ ├── SECURITY.md # Guide de sécurité
│ ├── PERFORMANCE.md # Guide de performance
│ ├── TESTING.md # Tests de base
│ ├── SYNC_TESTING.md # Tests de synchronisation
│ ├── PERFORMANCE_TESTING.md # Tests de performance
│ ├── RELAY_NETWORK.md # Réseau de relais
│ ├── EXTERNAL_NODES.md # Nœuds externes
│ ├── SYNCHRONIZATION.md # Protocole de synchronisation
│ ├── TROUBLESHOOTING.md # Guide de dépannage
│ ├── FAQ.md # Questions fréquentes
│ └── MIGRATION.md # Guide de migration
├── specs/ # Spécifications techniques
│ ├── spec-technique.md # Spécification technique (fusionnée)
│ └── spec-fonctionnel.md # Spécification fonctionnelle
├── archive/ # Archive des anciens fichiers
│ ├── docs/ # Anciens fichiers de documentation
│ └── README.md # Documentation archive
├── examples/ # Exemples d'utilisation
│ ├── configuration/ # Exemples de configuration
│ ├── scripts/ # Scripts d'exemple
│ └── tests/ # Tests d'exemple
└── scripts/ # Scripts utilitaires
```
### Avantages de la Nouvelle Structure
1. **Organisation claire** : Documentation organisée par sujet
2. **Navigation facile** : Index centralisé avec liens
3. **Parcours d'apprentissage** : Guides adaptés au niveau d'expertise
4. **Maintenance simplifiée** : Structure modulaire
5. **Archive propre** : Anciens fichiers conservés mais séparés
6. **Exemples pratiques** : Exemples d'utilisation organisés
## 🔄 Commandes de Migration
### Migration Automatique
```bash
# Exécuter la migration complète
./migrate_documentation.sh
```
### Migration Manuelle
```bash
# Créer la structure
mkdir -p docs archive/docs examples/{configuration,scripts,tests}
# Déplacer les fichiers
mv EXEMPLES_PRATIQUES.md archive/docs/
mv CONFIGURATION_DEV3.md archive/docs/
mv INTEGRATION_DEV3_FINAL.md archive/docs/
mv COMMANDES_REDEMARRAGE.md archive/docs/
mv RESUME_AJOUT_DEV3.md archive/docs/
mv RESUME_DECOUVERTE_NOEUDS.md archive/docs/
mv RESUME_SCRIPT_RESTART.md archive/docs/
mv RESUME_TEST_3_RELAIS.md archive/docs/
mv README_RESTART_SCRIPT.md archive/docs/
mv explain_node_discovery.md archive/docs/
# Fusionner les spécifications
cat specs/spec-technical.md >> specs/spec-technique.md
rm specs/spec-technical.md
# Créer le README de l'archive
cat > archive/README.md << 'EOF'
# 📦 Archive - Documentation 4NK_node
Ce dossier contient les anciens fichiers de documentation qui ont été migrés vers la nouvelle structure organisée.
## 📁 Contenu
- `docs/` - Anciens fichiers de documentation
- `README.md` - Ce fichier
## 🔗 Liens vers la Nouvelle Documentation
- **Documentation principale** : [../docs/INDEX.md](../docs/INDEX.md)
- **Guide d'installation** : [../docs/INSTALLATION.md](../docs/INSTALLATION.md)
- **Guide d'utilisation** : [../docs/USAGE.md](../docs/USAGE.md)
- **Guide de configuration** : [../docs/CONFIGURATION.md](../docs/CONFIGURATION.md)
- **Référence rapide** : [../docs/QUICK_REFERENCE.md](../docs/QUICK_REFERENCE.md)
## 📅 Date de Migration
Migration effectuée le : $(date)
EOF
```
---
**🔄 Migration de Documentation 4NK_node - Structure organisée et maintenable !**

50
docs/NETWORK.md Normal file
View File

@ -0,0 +1,50 @@
## Réseau et cartographie des services
### Sous-réseaux
- 4nk_network: 172.20.0.0/16 (services applicatifs, IP statiques et hostnames fixés)
- 4nk_projects_net: 172.21.0.0/16 (réservé, aucun service attaché pour linstant)
### Tableau de mapping
| Service | Hostname | IP | Ports exposés | Montages conf/data/logs | Nginx (routes) | Dépendances |
|---|---|---|---|---|---|---|
| tor | tor.4nk.local | 172.20.0.10 | 9050, 9051 | conf:/etc/tor/torrc(ro), data:/var/lib/tor, logs:/var/log/tor | — | — |
| bitcoin | bitcoin.4nk.local | 172.20.0.11 | 38333, 38332, 29000 | conf:/home/bitcoin/.bitcoin/bitcoin.conf(ro), data:/home/bitcoin/.bitcoin, logs:/home/bitcoin/.bitcoin/logs | — | tor |
| blindbit | blindbit.4nk.local | 172.20.0.12 | 8000 | conf:/blindbit/blindbit.toml(ro), data:/blindbit, logs:/blindbit/logs | /blindbit/ → :8000 | bitcoin |
| sdk_storage | sdk-storage.4nk.local | 172.20.0.13 | 8081 | conf:/usr/local/bin/sdk_storage.conf(ro), logs:/app/logs | /sdk_storage/ → :8081 | blindbit |
| sdk_relay1 | sdk-relay1.4nk.local | 172.20.0.14 | 8090(ws), 8091(http) | conf:/home/bitcoin/.conf(ro), logs:/home/bitcoin/logs | /relay1/, /relay1/ws/ | sdk_storage |
| sdk_relay2 | sdk-relay2.4nk.local | 172.20.0.15 | 8092(ws), 8093(http) | conf:/home/bitcoin/.conf(ro), logs:/home/bitcoin/logs | /relay2/, /relay2/ws/ | sdk_storage |
| sdk_relay3 | sdk-relay3.4nk.local | 172.20.0.16 | 8094(ws), 8095(http) | conf:/home/bitcoin/.conf(ro), logs:/home/bitcoin/logs | /relay3/, /relay3/ws/ | sdk_storage |
| sdk_signer | sdk-signer.4nk.local | 172.20.0.17 | 9090(ws), 9092(http) | conf:/usr/local/bin/sdk_signer.conf(ro), data:/app/data, logs:/usr/src/app/logs | /signer/, /signer/ws/ | sdk_relay1/2/3 |
| ihm_client | ihm-client.4nk.local | 172.20.0.18 | 80, 3003 | logs:/var/log/ihm_client | / (→:80), /coffre/ (→coffre_front:3003) | sdk_signer |
| miniback-postgres | miniback-postgres.4nk.local | 172.20.0.30 | 5432 | data:/var/lib/postgresql/data(volume) | — | — |
| miniback | miniback.4nk.local | 172.20.0.31 | — | logs:/logs, env:.env(ro) | /miniback/ (si HTTP) | miniback-postgres |
| coffre_front | coffre-front.4nk.local | 172.20.0.32 | 3003 | logs:/logs | /coffre/ → :3003 | — |
| coffre_back_mini | coffre-back-mini.4nk.local | 172.20.0.33 | — | — | — | — |
| nginx | nginx.4nk.local | 172.20.0.40 | 80 | conf:/etc/nginx, logs:/var/log/nginx | reverse proxy + /grafana/ | — |
### Observabilité
- Promtail lit: `./log/**/*.log`, `./modules/*/logs/**/*.log`, `./projects/*/*/logs/**/*.log` et pousse vers Loki.
- Grafana est servi via Nginx sous `/grafana/` et provisionné avec datasources/dashboards.
### Liens entre services (flux réseau et dépendances)
- Tor → Bitcoin Core
- Bitcoin utilise Tor comme proxy (`proxy=tor.4nk.local:9050`) et active `listenonion=1`.
- Bitcoin Core → Blindbit
- Blindbit lit lendpoint RPC de Bitcoin (`http://bitcoin.4nk.local:38332`) et sappuie sur ZMQ (`tcp://bitcoin.4nk.local:29000`).
- Blindbit → SDK Storage
- SDK Storage consomme les index/infos de Blindbit (config via `sdk_storage.conf`).
- SDK Storage → SDK Relays (1/2/3)
- Les relais interrogent Storage côté API HTTP (8091/8093/8095) et exposent WS séparés (8090/8092/8094).
- SDK Relays (1/2/3) → SDK Signer
- Signer se connecte aux trois relais (WS et/ou HTTP) et à Storage; il consomme également Blindbit et Bitcoin RPC (pour certaines opérations).
- SDK Signer → IHM Client
- Lapplication front sappuie sur Signer (WS 9090, HTTP 9092) pour lorchestration fonctionnelle.
- Miniback → Postgres
- Miniback utilise `miniback-postgres` (5432) comme base de données.
- Nginx → Tous services HTTP/WS
- Reverseproxy vers: IHM (`/`), Storage (`/sdk_storage/`), Blindbit (`/blindbit/`), Relais (`/relayX/` + `/relayX/ws/`), Signer (`/signer/` + `/signer/ws/`), Coffre (`/coffre/`), Miniback (`/miniback/`), Grafana (`/grafana/`).
### Notes
- Les services internes utilisent des hostnames Docker `.4nk.local` résolus par le DNS du réseau `4nk_network`.
- Les tags dimages `:dev` sont en cours de création; voir `docs/CONFIGURATION.md`.

View File

@ -1,232 +0,0 @@
# Checklist de Préparation Open Source - 4NK_node
Cette checklist détaille tous les éléments nécessaires pour préparer le projet 4NK_node à une ouverture en open source.
## 📋 État Actuel du Projet
### ✅ **Complété (95%)**
#### 📚 Documentation
- [x] **README.md** - Guide principal complet
- [x] **docs/INSTALLATION.md** - Guide d'installation détaillé
- [x] **docs/USAGE.md** - Guide d'utilisation quotidienne
- [x] **docs/CONFIGURATION.md** - Guide de configuration avancée
- [x] **docs/ARCHITECTURE.md** - Architecture technique complète
- [x] **docs/API.md** - Documentation des APIs
- [x] **docs/TESTING.md** - Guide des tests
- [x] **docs/INDEX.md** - Index de la documentation
- [x] **docs/QUICK_REFERENCE.md** - Référence rapide
#### 🧪 Tests
- [x] **Structure organisée** - tests/unit, integration, connectivity, external
- [x] **Scripts automatisés** - run_all_tests.sh, run_*_tests.sh
- [x] **Tests de connectivité** - WebSocket, HTTP, RPC
- [x] **Tests d'intégration** - Multi-relais, synchronisation
- [x] **Tests externes** - dev3.4nkweb.com
- [x] **Documentation des tests** - tests/README.md
#### 🔧 Infrastructure
- [x] **Docker Compose** - Configuration complète
- [x] **Healthchecks** - Pour tous les services
- [x] **Scripts d'automatisation** - restart_4nk_node.sh
- [x] **Monitoring** - Scripts de surveillance
- [x] **Configuration externalisée** - Fichiers .conf
#### 🏗️ Architecture
- [x] **Synchronisation mesh** - Entre relais
- [x] **Cache de déduplication** - Messages
- [x] **Découverte de nœuds** - Automatique et manuelle
- [x] **Gestion d'erreurs** - Robuste
- [x] **Logging structuré** - Avec rotation
### ⚠️ **À Compléter (5%)**
#### 📄 Fichiers de Licence et Contribution
- [x] **LICENSE** - MIT License créé
- [x] **CONTRIBUTING.md** - Guide de contribution créé
- [x] **CHANGELOG.md** - Historique des versions créé
- [x] **CODE_OF_CONDUCT.md** - Code de conduite créé
- [x] **SECURITY.md** - Politique de sécurité créé
#### 🔄 CI/CD et Qualité
- [x] **GitHub Actions** - Workflow CI créé
- [x] **Templates d'issues** - Bug report et feature request créés
- [x] **Template de PR** - Pull request template créé
## 🎯 Checklist Finale
### 📋 **Phase 1 : Vérification Immédiate**
#### Audit de Sécurité
- [ ] **Vérifier les secrets** - Pas de clés privées dans le code
- [ ] **Vérifier les URLs** - Pas d'endpoints privés
- [ ] **Vérifier les configurations** - Pas de données sensibles
- [ ] **Vérifier les permissions** - Fichiers sensibles protégés
#### Vérification des Dépendances
- [ ] **Versions des dépendances** - À jour et sécurisées
- [ ] **Licences des dépendances** - Compatibles avec MIT
- [ ] **Vulnérabilités** - Scan avec cargo audit
- [ ] **Documentation des dépendances** - README mis à jour
#### Tests de Validation
- [ ] **Tests complets** - Tous les tests passent
- [ ] **Tests de sécurité** - Ajoutés et fonctionnels
- [ ] **Tests de performance** - Ajoutés et fonctionnels
- [ ] **Tests de compatibilité** - Multi-plateformes
### 📋 **Phase 2 : Préparation du Repository**
#### Repository Public
- [ ] **Créer repository public** - Sur Gitea/GitHub/GitLab
- [ ] **Configurer les branches** - main, develop, feature/*
- [ ] **Configurer les protections** - Branch protection rules
- [ ] **Configurer les labels** - bug, enhancement, documentation, etc.
#### Documentation Publique
- [ ] **README public** - Version adaptée pour l'open source
- [ ] **Documentation traduite** - En anglais si possible
- [ ] **Exemples publics** - Sans données sensibles
- [ ] **Guide de démarrage** - Pour les nouveaux contributeurs
#### Communication
- [ ] **Annonce de l'ouverture** - Préparer la communication
- [ ] **Support communautaire** - Canaux de discussion
- [ ] **FAQ** - Questions fréquentes
- [ ] **Roadmap** - Plan de développement
### 📋 **Phase 3 : Infrastructure Communautaire**
#### Outils de Collaboration
- [ ] **Issues templates** - Bug report, feature request
- [ ] **PR templates** - Pull request template
- [ ] **Discussions** - Forum pour questions générales
- [ ] **Wiki** - Documentation collaborative
#### Qualité du Code
- [ ] **Linting** - Clippy, rustfmt configurés
- [ ] **Tests automatisés** - CI/CD complet
- [ ] **Coverage** - Couverture de tests > 80%
- [ ] **Documentation** - Code auto-documenté
#### Monitoring et Support
- [ ] **Monitoring** - Métriques publiques
- [ ] **Alertes** - Notifications automatiques
- [ ] **Support** - Canaux de support
- [ ] **Maintenance** - Plan de maintenance
## 🚀 Plan d'Action Détaillé
### **Jour 1 : Audit et Nettoyage**
```bash
# Audit de sécurité
./scripts/security_audit.sh
# Nettoyage des secrets
./scripts/clean_secrets.sh
# Vérification des dépendances
cargo audit
cargo update
```
### **Jour 2 : Tests et Validation**
```bash
# Tests complets
./tests/run_all_tests.sh
# Tests de sécurité
./tests/run_security_tests.sh
# Tests de performance
./tests/run_performance_tests.sh
```
### **Jour 3 : Documentation Finale**
```bash
# Vérification de la documentation
./scripts/check_documentation.sh
# Génération de la documentation
./scripts/generate_docs.sh
# Validation des liens
./scripts/validate_links.sh
```
### **Jour 4 : Repository Public**
```bash
# Création du repository public
# Configuration des branches
# Configuration des protections
# Upload du code
```
### **Jour 5 : Communication et Support**
```bash
# Préparation de l'annonce
# Configuration des canaux de support
# Test de l'infrastructure
# Validation finale
```
## 📊 Métriques de Préparation
### **Qualité du Code**
- **Couverture de tests** : 85% ✅
- **Documentation** : 95% ✅
- **Linting** : 90% ✅
- **Sécurité** : 85% ✅
### **Infrastructure**
- **Docker** : 100% ✅
- **CI/CD** : 90% ✅
- **Monitoring** : 80% ✅
- **Tests** : 90% ✅
### **Documentation**
- **README** : 100% ✅
- **Guides techniques** : 95% ✅
- **API** : 90% ✅
- **Exemples** : 85% ✅
### **Communauté**
- **Licence** : 100% ✅
- **Contribution** : 100% ✅
- **Code de conduite** : 100% ✅
- **Sécurité** : 100% ✅
## 🎯 Score Global : 92/100
### **Points Forts**
- ✅ Documentation exceptionnelle
- ✅ Tests bien organisés
- ✅ Infrastructure Docker robuste
- ✅ Architecture claire
- ✅ Scripts d'automatisation
### **Points d'Amélioration**
- ⚠️ Traduction en anglais (optionnel)
- ⚠️ Tests de sécurité supplémentaires
- ⚠️ Monitoring avancé
- ⚠️ Exemples supplémentaires
## 🚀 Recommandation
**Le projet 4NK_node est PRÊT pour l'open source !**
### **Actions Immédiates (1-2 jours)**
1. Audit de sécurité final
2. Tests de validation complets
3. Création du repository public
4. Communication de l'ouverture
### **Actions Post-Ouverture (1-2 semaines)**
1. Support de la communauté
2. Amélioration continue
3. Feedback et itération
4. Évolution du projet
---
**Le projet a une base technique et documentaire excellente qui facilitera grandement son adoption par la communauté open source !** 🌟

View File

@ -1,494 +0,0 @@
# ⚡ Référence Rapide - 4NK_node
Référence rapide des commandes essentielles pour l'infrastructure 4NK_node.
## 🚀 Démarrage
### Démarrage Complet
```bash
# Démarrer tous les services
./restart_4nk_node.sh
# Vérifier le statut
docker ps
```
### Démarrage Séquentiel
```bash
# Démarrer Tor
./restart_4nk_node.sh -t
# Démarrer Bitcoin Core
./restart_4nk_node.sh -b
# Démarrer Blindbit
./restart_4nk_node.sh -l
# Démarrer les relais
./restart_4nk_node.sh -r
```
### Options du Script de Redémarrage
```bash
./restart_4nk_node.sh -h # Aide
./restart_4nk_node.sh -s # Arrêter
./restart_4nk_node.sh -c # Nettoyer
./restart_4nk_node.sh -n # Créer réseau
./restart_4nk_node.sh -t # Démarrer Tor
./restart_4nk_node.sh -b # Démarrer Bitcoin
./restart_4nk_node.sh -l # Démarrer Blindbit
./restart_4nk_node.sh -r # Démarrer relais
./restart_4nk_node.sh -v # Vérifier statut
```
## 📊 Monitoring
### Statut des Services
```bash
# Statut de tous les services
docker ps
# Statut avec format personnalisé
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
# Utilisation des ressources
docker stats
# Espace disque
docker system df
```
### Logs
```bash
# Logs de tous les services
docker-compose logs -f
# Logs d'un service spécifique
docker logs bitcoin-signet
docker logs blindbit-oracle
docker logs sdk_relay_1
# Logs avec timestamps
docker-compose logs -t
# Logs des 100 dernières lignes
docker-compose logs --tail=100
# Logs depuis une date
docker-compose logs --since="2024-01-01T00:00:00"
```
### Surveillance de la Synchronisation
```bash
# Surveillance en temps réel
./monitor_sync.sh
# Test de synchronisation
./test_sync_logs.sh
# Test de synchronisation forcé
./test_sync_logs.sh force
# Test de synchronisation en continu
./test_sync_logs.sh continuous
```
## 🧪 Tests
### Tests de Base
```bash
# Test de connectivité complet
./test_final_sync.sh
# Test de synchronisation
./test_sync_logs.sh
# Test des messages WebSocket
python3 test_websocket_messages.py
# Test des 3 relais
./test_3_relays.sh
```
### Tests de Performance
```bash
# Test de charge WebSocket
python3 test_websocket_messages.py --load-test
# Test de connectivité multiple
netstat -tlnp | grep -E "(8090|8092|8094)"
# Test de performance
docker stats --no-stream
```
### Tests de Sécurité
```bash
# Vérifier les ports exposés
netstat -tuln | grep -E "(8090|8092|8094)"
# Vérifier les logs d'accès
docker logs sdk_relay_1 | grep -E "(ERROR|WARN)" | tail -20
# Vérifier l'utilisation des ressources
docker stats --no-stream | grep sdk_relay
```
## 🔗 Connexion aux Services
### Bitcoin Core RPC
```bash
# Connexion via curl
curl -u bitcoin:your_password --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://localhost:18443/
# Connexion via bitcoin-cli
docker exec bitcoin-signet bitcoin-cli -signet getblockchaininfo
# Vérifier la synchronisation
docker exec bitcoin-signet bitcoin-cli -signet getblockchaininfo | jq '.verificationprogress'
```
### Blindbit API
```bash
# Test de connectivité
curl -s http://localhost:8000/
# Vérifier le statut
curl -s http://localhost:8000/status
# Obtenir des filtres
curl -s http://localhost:8000/filters
```
### sdk_relay WebSocket
```bash
# Test de connectivité WebSocket
curl -v -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Sec-WebSocket-Key: test" http://localhost:8090/
# Test avec wscat (si installé)
wscat -c ws://localhost:8090
# Test avec Python
python3 test_websocket_messages.py
```
## 🌐 Gestion des Nœuds Externes
### Administration des Nœuds
```bash
# Ajouter un nœud externe
./add_external_node.sh add external-relay-1 external-relay-1.example.com:8090
# Lister les nœuds configurés
./add_external_node.sh list
# Tester la connectivité
./add_external_node.sh test external-relay-1
# Supprimer un nœud
./add_external_node.sh remove external-relay-1
# Valider une adresse
./add_external_node.sh validate 192.168.1.100:8090
```
### Configuration Multi-Sites
```bash
# Site principal
./add_external_node.sh add site-paris-1 paris-relay-1.4nk.net:8090
./add_external_node.sh add site-paris-2 paris-relay-2.4nk.net:8090
# Site secondaire
./add_external_node.sh add site-lyon-1 lyon-relay-1.4nk.net:8090
./add_external_node.sh add site-lyon-2 lyon-relay-2.4nk.net:8090
# Site de backup
./add_external_node.sh add backup-1 backup-relay-1.4nk.net:8090
```
### Test d'Intégration
```bash
# Test d'intégration complet
./test_integration_dev3.sh
# Test de connectivité dev3
python3 test_dev3_simple.py
# Test de connectivité avancé
python3 test_dev3_connectivity.py
```
## 🔧 Configuration et Maintenance
### Modification de Configuration
```bash
# Modifier la configuration Bitcoin Core
sudo docker-compose down
nano bitcoin/bitcoin.conf
sudo docker-compose up -d bitcoin
# Modifier la configuration Blindbit
nano blindbit/blindbit.toml
sudo docker-compose restart blindbit
# Modifier la configuration des relais
nano sdk_relay/.conf.docker.relay1
sudo docker-compose restart sdk_relay_1
```
### Redémarrage des Services
```bash
# Redémarrage complet
./restart_4nk_node.sh
# Redémarrage d'un service spécifique
docker-compose restart bitcoin
docker-compose restart blindbit
docker-compose restart sdk_relay_1
# Redémarrage avec reconstruction
docker-compose down
docker-compose build --no-cache
docker-compose up -d
```
### Sauvegarde et Restauration
```bash
# Sauvegarde des données
docker exec bitcoin-signet tar czf /tmp/bitcoin-backup.tar.gz /home/bitcoin/.bitcoin
docker cp bitcoin-signet:/tmp/bitcoin-backup.tar.gz ./backup/
# Sauvegarde des configurations
tar czf config-backup.tar.gz sdk_relay/.conf* external_nodes.conf
# Restauration
docker cp ./backup/bitcoin-backup.tar.gz bitcoin-signet:/tmp/
docker exec bitcoin-signet tar xzf /tmp/bitcoin-backup.tar.gz -C /
```
## 🚨 Dépannage
### Problèmes Courants
```bash
# Service ne démarre pas
docker logs <service_name>
docker exec <service_name> cat /path/to/config
docker restart <service_name>
# Problèmes de connectivité
docker exec <service_name> ping <target>
docker exec <service_name> nslookup <target>
docker exec <service_name> nc -z <target> <port>
# Problèmes de synchronisation
docker logs sdk_relay_1 | grep -E "(Sync|Relay|Mesh)"
docker restart sdk_relay_1 sdk_relay_2 sdk_relay_3
./test_sync_logs.sh force
```
### Outils de Debug
```bash
# Debug du container sdk_relay
./sdk_relay/debug_container.sh
# Test du healthcheck
./sdk_relay/test_healthcheck.sh
# Test de connectivité
./sdk_relay/test_connectivity.sh
# Test simple
./sdk_relay/test_simple.sh
```
### Logs de Debug
```bash
# Logs détaillés
docker-compose logs -f --tail=100
# Logs d'un service spécifique
docker logs <service_name> -f
# Logs avec timestamps
docker-compose logs -t
# Logs depuis une date
docker-compose logs --since="2024-01-01T00:00:00"
```
## 🔒 Sécurité
### Vérification de Sécurité
```bash
# Vérifier les ports exposés
netstat -tuln | grep -E "(8090|8092|8094)"
# Vérifier les permissions
ls -la sdk_relay/.conf*
ls -la bitcoin/bitcoin.conf
ls -la blindbit/blindbit.toml
# Vérifier les logs de sécurité
docker logs sdk_relay_1 | grep -E "(ERROR|WARN|SECURITY)" | tail -20
```
### Configuration de Pare-feu
```bash
# Autoriser les ports nécessaires
sudo ufw allow 18443/tcp # Bitcoin Core RPC
sudo ufw allow 8090/tcp # sdk_relay WebSocket
sudo ufw allow 8000/tcp # Blindbit API
sudo ufw enable
# Vérifier les règles
sudo ufw status numbered
```
## 📈 Performance
### Optimisation
```bash
# Limiter l'utilisation CPU
docker-compose up -d --scale bitcoin=1
# Optimiser la mémoire
docker stats --no-stream | grep sdk_relay
# Nettoyer l'espace disque
docker system prune -f
```
### Monitoring de Performance
```bash
# Surveillance des ressources
docker stats
# Surveillance des connexions
netstat -an | grep :8090 | wc -l
# Surveillance de l'espace disque
df -h
```
### Tests de Charge
```bash
# Test de charge simple
for i in {1..50}; do
python3 test_websocket_messages.py &
sleep 0.1
done
wait
# Test de charge avancé
python3 test_websocket_messages.py --load-test --duration=300
```
## 🔄 Maintenance
### Nettoyage
```bash
# Nettoyer les conteneurs arrêtés
docker container prune -f
# Nettoyer les images non utilisées
docker image prune -f
# Nettoyer les volumes non utilisés
docker volume prune -f
# Nettoyer tout
docker system prune -a -f
```
### Mise à Jour
```bash
# Mise à jour de l'infrastructure
git pull origin main
./restart_4nk_node.sh
# Mise à jour des images
docker-compose build --no-cache
docker-compose up -d
```
### Sauvegarde Automatique
```bash
# Script de sauvegarde
cat > backup_4nk.sh << 'EOF'
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/backup/4nk_node_$DATE"
mkdir -p $BACKUP_DIR
cp -r sdk_relay/.conf* $BACKUP_DIR/
cp external_nodes.conf $BACKUP_DIR/
docker exec bitcoin-signet tar czf /tmp/bitcoin-backup.tar.gz /home/bitcoin/.bitcoin
docker cp bitcoin-signet:/tmp/bitcoin-backup.tar.gz $BACKUP_DIR/
find /backup -name "4nk_node_*" -type d -mtime +7 -exec rm -rf {} \;
echo "Sauvegarde terminée: $BACKUP_DIR"
EOF
chmod +x backup_4nk.sh
# Ajouter au cron
echo "0 2 * * * /path/to/backup_4nk.sh" | crontab -
```
## 📋 Checklist Quotidienne
### Démarrage
- [ ] Services démarrés et fonctionnels
- [ ] Bitcoin Core synchronisé
- [ ] Relais connectés et synchronisés
- [ ] Tests de connectivité passés
### Surveillance
- [ ] Logs vérifiés (pas d'erreurs critiques)
- [ ] Ressources système OK
- [ ] Monitoring actif
- [ ] Sauvegarde effectuée (si nécessaire)
### Maintenance
- [ ] Nettoyage effectué
- [ ] Mise à jour appliquée (si nécessaire)
- [ ] Configuration vérifiée
- [ ] Sécurité contrôlée
## 🎯 Commandes Essentielles
### Démarrage Rapide
```bash
./restart_4nk_node.sh
docker ps
./test_final_sync.sh
```
### Monitoring Rapide
```bash
docker ps
docker-compose logs -f
./monitor_sync.sh
```
### Test Rapide
```bash
./test_final_sync.sh
./test_sync_logs.sh
python3 test_websocket_messages.py
```
### Dépannage Rapide
```bash
docker logs <service_name>
docker restart <service_name>
./test_sync_logs.sh force
```
### Arrêt Propre
```bash
docker-compose down
docker system prune -f
```
---

5
docs/RELEASE_NOTES.md Normal file
View File

@ -0,0 +1,5 @@
# Release 1.1.3 - 2025-09-07
- Mise à jour des versions `VERSION` et `TEMPLATE_VERSION`.
- Ajout des notes de release dédiées dans `docs/RELEASE_NOTES.md` et `tests/RELEASE_NOTES.md`.
- Mise à jour du changelog pour refléter cette release.

View File

@ -1,352 +0,0 @@
# Plan de Release Open Source - 4NK_node
## 🚀 Vue d'Ensemble
Ce document détaille le plan de lancement open source du projet 4NK_node sur Gitea.
### **Objectifs**
- Lancer 4NK_node en open source avec succès
- Attirer une communauté de contributeurs
- Établir une base solide pour le développement futur
- Positionner le projet dans l'écosystème Bitcoin
### **Date Cible**
**Lancement : Janvier 2025**
## 📋 Phase 1 : Préparation Finale (1-2 semaines)
### **Configuration Gitea**
#### 1. **Repository Public**
```bash
# Actions à effectuer sur git.4nkweb.com
- [ ] Rendre le repository public
- [ ] Configurer les permissions d'accès
- [ ] Activer les fonctionnalités communautaires
```
#### 2. **Templates et Workflows**
```bash
# Vérifier l'activation des templates
- [ ] Templates d'issues fonctionnels
- [ ] Template de pull request actif
- [ ] Workflow CI/CD configuré
- [ ] Labels et milestones créés
```
#### 3. **Documentation Publique**
```bash
# Finaliser la documentation
- [ ] README.md optimisé pour l'open source
- [ ] Documentation traduite en anglais (optionnel)
- [ ] Exemples et tutoriels créés
- [ ] FAQ préparée
```
### **Tests de Validation**
#### 1. **Tests Complets**
```bash
# Exécuter tous les tests
./tests/run_all_tests.sh
# Tests spécifiques
./tests/run_connectivity_tests.sh
./tests/run_external_tests.sh
```
#### 2. **Tests de Déploiement**
```bash
# Test de déploiement complet
./restart_4nk_node.sh
# Vérification des services
docker ps
docker logs bitcoin-signet
docker logs blindbit-oracle
docker logs sdk_relay_1
```
#### 3. **Tests de Documentation**
```bash
# Vérifier les liens
find docs/ -name "*.md" -exec grep -l "\[.*\](" {} \;
# Valider la structure
ls -la docs/
ls -la tests/
```
## 📋 Phase 2 : Communication et Marketing (1 semaine)
### **Annonce Officielle**
#### 1. **Communiqué de Presse**
```markdown
# Titre : 4NK_node - Infrastructure Open Source pour les Paiements Silencieux Bitcoin
## Résumé
4NK_node annonce le lancement en open source de son infrastructure complète pour les paiements silencieux Bitcoin. Cette solution Docker offre une implémentation complète avec Bitcoin Core, Blindbit, et un système de relais synchronisés.
## Points Clés
- Infrastructure Docker complète
- Support des paiements silencieux Bitcoin
- Synchronisation mesh entre relais
- Documentation technique exhaustive
- Communauté open source
## Contact
- Repository : https://git.4nkweb.com/4nk/4NK_node
- Documentation : https://git.4nkweb.com/4nk/4NK_node/src/branch/main/docs
- Support : support@4nkweb.com
```
#### 2. **Canaux de Communication**
```bash
# Canaux à utiliser
- [ ] Blog technique 4NK
- [ ] Reddit r/Bitcoin, r/cryptocurrency
- [ ] Twitter/X @4nkweb
- [ ] LinkedIn 4NK
- [ ] Forums Bitcoin (Bitcointalk)
- [ ] Discord/Telegram Bitcoin
- [ ] Podcasts techniques
```
### **Contenu Marketing**
#### 1. **Vidéo de Présentation**
```bash
# Script de vidéo (5-10 minutes)
- Introduction au projet
- Démonstration de l'installation
- Showcase des fonctionnalités
- Appel à contribution
```
#### 2. **Infographie**
```bash
# Éléments à inclure
- Architecture du système
- Flux de données
- Avantages des paiements silencieux
- Statistiques du projet
```
#### 3. **Article Technique**
```bash
# Article pour blogs techniques
- "Comment implémenter les paiements silencieux Bitcoin"
- "Architecture d'une infrastructure Bitcoin moderne"
- "Synchronisation mesh pour les relais Bitcoin"
```
## 📋 Phase 3 : Lancement (1 jour)
### **Checklist de Lancement**
#### 1. **Pré-lancement (Jour J-1)**
```bash
# Vérifications finales
- [ ] Tous les tests passent
- [ ] Documentation à jour
- [ ] Repository public configuré
- [ ] Templates activés
- [ ] Équipe de support prête
```
#### 2. **Lancement (Jour J)**
```bash
# Actions de lancement
- [ ] Publier le communiqué de presse
- [ ] Poster sur les réseaux sociaux
- [ ] Envoyer les annonces
- [ ] Activer le support communautaire
- [ ] Monitorer les réactions
```
#### 3. **Post-lancement (Jour J+1)**
```bash
# Suivi et support
- [ ] Répondre aux questions
- [ ] Guider les premiers contributeurs
- [ ] Collecter les retours
- [ ] Ajuster la documentation si nécessaire
```
## 📋 Phase 4 : Support Communautaire (2-4 semaines)
### **Équipe de Support**
#### 1. **Rôles et Responsabilités**
```bash
# Équipe de support
- [ ] Maintainer principal : Révisions de code, releases
- [ ] Support technique : Questions, bugs, documentation
- [ ] Community manager : Engagement, modération
- [ ] Security team : Vulnérabilités, audits
```
#### 2. **Canaux de Support**
```bash
# Canaux à mettre en place
- [ ] Issues Gitea : Bugs et fonctionnalités
- [ ] Discussions Gitea : Questions générales
- [ ] Email : support@4nkweb.com
- [ ] Discord/Telegram : Support en temps réel
- [ ] Documentation : Guides et tutoriels
```
### **Gestion des Contributions**
#### 1. **Processus de Review**
```bash
# Workflow de contribution
1. Issue créée ou PR soumise
2. Review automatique (CI/CD)
3. Review manuelle par maintainer
4. Tests et validation
5. Merge et release
```
#### 2. **Standards de Qualité**
```bash
# Critères de qualité
- [ ] Code conforme aux standards
- [ ] Tests ajoutés/modifiés
- [ ] Documentation mise à jour
- [ ] Pas de régression
- [ ] Performance acceptable
```
## 📋 Phase 5 : Évolution et Maintenance (Ongoing)
### **Roadmap de Développement**
#### 1. **Court terme (1-3 mois)**
```bash
# Fonctionnalités prioritaires
- [ ] Amélioration de la documentation
- [ ] Tests de performance
- [ ] Optimisations de sécurité
- [ ] Support de nouveaux réseaux Bitcoin
- [ ] Interface utilisateur web
```
#### 2. **Moyen terme (3-6 mois)**
```bash
# Évolutions majeures
- [ ] Support Lightning Network
- [ ] API REST complète
- [ ] Monitoring avancé
- [ ] Déploiement cloud
- [ ] Intégrations tierces
```
#### 3. **Long terme (6-12 mois)**
```bash
# Vision stratégique
- [ ] Écosystème complet
- [ ] Marketplace d'extensions
- [ ] Support multi-blockchains
- [ ] IA et automatisation
- [ ] Écosystème de développeurs
```
### **Métriques de Succès**
#### 1. **Métriques Techniques**
```bash
# KPIs techniques
- [ ] Nombre de stars/forks
- [ ] Nombre de contributeurs
- [ ] Taux de résolution des issues
- [ ] Temps de réponse aux PR
- [ ] Couverture de tests
```
#### 2. **Métriques Communautaires**
```bash
# KPIs communautaires
- [ ] Nombre d'utilisateurs actifs
- [ ] Engagement sur les discussions
- [ ] Qualité des contributions
- [ ] Satisfaction utilisateurs
- [ ] Adoption par d'autres projets
```
## 🎯 Plan d'Action Détaillé
### **Semaine 1 : Finalisation**
- [ ] Configuration Gitea complète
- [ ] Tests de validation
- [ ] Préparation communication
### **Semaine 2 : Communication**
- [ ] Rédaction communiqué
- [ ] Création contenu marketing
- [ ] Préparation équipe support
### **Semaine 3 : Lancement**
- [ ] Lancement officiel
- [ ] Support communautaire
- [ ] Monitoring et ajustements
### **Semaine 4+ : Évolution**
- [ ] Gestion continue
- [ ] Améliorations
- [ ] Planification roadmap
## 📊 Budget et Ressources
### **Ressources Humaines**
- **Maintainer principal** : 20h/semaine
- **Support technique** : 15h/semaine
- **Community manager** : 10h/semaine
- **Security team** : 5h/semaine
### **Ressources Techniques**
- **Infrastructure Gitea** : Déjà en place
- **CI/CD** : Déjà configuré
- **Monitoring** : À mettre en place
- **Documentation** : Déjà complète
### **Budget Marketing**
- **Contenu vidéo** : 1000-2000€
- **Design infographie** : 500-1000€
- **Promotion réseaux sociaux** : 500€
- **Événements/conférences** : 2000-5000€
## 🚨 Gestion des Risques
### **Risques Identifiés**
#### 1. **Risques Techniques**
- **Problèmes de sécurité** : Audit continu, réponse rapide
- **Bugs critiques** : Tests complets, rollback plan
- **Performance** : Monitoring, optimisations
#### 2. **Risques Communautaires**
- **Manque d'engagement** : Contenu de qualité, support actif
- **Contributions de mauvaise qualité** : Standards clairs, review process
- **Conflits communautaires** : Code de conduite, modération
#### 3. **Risques Business**
- **Concurrence** : Innovation continue, différenciation
- **Changements réglementaires** : Veille, adaptation
- **Évolution technologique** : Roadmap flexible, veille
### **Plans de Contingence**
```bash
# Plans de secours
- [ ] Plan de rollback technique
- [ ] Équipe de support de backup
- [ ] Communication de crise
- [ ] Ressources alternatives
```
---
**Ce plan garantit un lancement open source réussi et une évolution durable du projet 4NK_node.** 🚀

View File

@ -1,155 +0,0 @@
# Résumé de l'intégration de ihm_client dans 4NK_node
## ✅ État de l'intégration
**STATUT : INTÉGRATION COMPLÈTE ET OPÉRATIONNELLE**
## 📋 Modifications apportées
### 1. Projets mis à jour et poussés
#### ✅ ihm_client (branche: 4nk-node-integration)
- **Compilation WASM** : Intégration réussie avec `sdk_client` et `sdk_common` depuis les repositories distants
- **Types TypeScript** : Correction complète des types pour correspondre aux types réels générés par `wasm-pack`
- **Dépendances** : Installation des packages manquants (qr-scanner, sweetalert2, axios, jose, qrcode)
- **Build** : Compilation de production fonctionnelle
- **Documentation** : Structure open source complète avec SSH automatisé
#### ✅ sdk_client (branche: docker-support)
- **Structure open source** : LICENSE, CONTRIBUTING, CODE_OF_CONDUCT, etc.
- **Documentation** : APIs HTTP et WebSocket complètes
- **Tests** : Tests fonctionnels et d'intégration
- **CI/CD** : Configuration Gitea Actions
#### ✅ sdk_common (branche: docker-support)
- **Structure open source** : Même structure que sdk_client
- **Documentation** : Documentation complète
- **CI/CD** : Configuration Gitea Actions
#### ✅ 4NK_node (branche: main)
- **Service ihm_client** : Ajout au docker-compose.yml
- **Configuration** : Variables d'environnement pour la communication avec les SDK relays
- **Volumes** : Volume ihm_client_logs ajouté
- **Scripts** : Scripts de démarrage automatiques
### 2. Configuration des branches
| Projet | Branche utilisée | Statut |
|--------|------------------|--------|
| ihm_client | 4nk-node-integration | ✅ Poussée |
| sdk_client | docker-support | ✅ Poussée |
| sdk_common | docker-support | ✅ Poussée |
| 4NK_node | main | ✅ Poussée |
### 3. Architecture finale
```
🌐 ihm_client (8080)
↓ HTTP/WebSocket
🔗 sdk_relay_1 (8090/8091)
↓ P2P Mesh
🔗 sdk_relay_2 (8092/8093)
↓ P2P Mesh
🔗 sdk_relay_3 (8094/8095)
↓ RPC
₿ bitcoin (18443)
↓ API
🔮 blindbit (8000)
```
## 🚀 Scripts de démarrage créés
### 1. `start-4nk-node-with-ui.sh`
- Démarrage complet de l'infrastructure
- Vérification de la santé de tous les services
- Affichage des URLs d'accès
### 2. `start-ihm-client.sh`
- Démarrage uniquement de l'interface utilisateur
- Vérification de la santé du service
## 📍 URLs d'accès
| Service | URL | Description |
|---------|-----|-------------|
| 🌐 Interface utilisateur | http://localhost:8080 | Interface web principale |
| ₿ Bitcoin RPC | http://localhost:18443 | API Bitcoin |
| 🔮 Blindbit | http://localhost:8000 | Oracle Blindbit |
| 🔗 SDK Relay 1 | http://localhost:8091 | Relais 1 HTTP |
| 🔗 SDK Relay 2 | http://localhost:8093 | Relais 2 HTTP |
| 🔗 SDK Relay 3 | http://localhost:8095 | Relais 3 HTTP |
## 🔧 Configuration technique
### Variables d'environnement ihm_client
```yaml
environment:
- SDK_RELAY_WS_URL=ws://sdk_relay_1:8090
- SDK_RELAY_HTTP_URL=http://sdk_relay_1:8091
- BITCOIN_RPC_URL=http://bitcoin:18443
- BLINDBIT_URL=http://blindbit:8000
```
### Dépendances Docker
- `ihm_client``sdk_relay_1, sdk_relay_2, sdk_relay_3`
- `sdk_relay_*``bitcoin, blindbit`
- `blindbit``bitcoin`
## 📚 Documentation créée
1. **docs/INTEGRATION_IHM_CLIENT.md** - Documentation complète de l'intégration
2. **docs/RESUME_INTEGRATION_IHM_CLIENT.md** - Ce résumé
## 🎯 Fonctionnalités disponibles
### Interface utilisateur
- ✅ **Pairing** - Connexion avec d'autres utilisateurs
- ✅ **Wallet** - Gestion des Silent Payments
- ✅ **Documents** - Validation et signature
- ✅ **Notifications** - Système temps réel
- ✅ **QR Code** - Scanner et génération
### Infrastructure
- ✅ **3 SDK Relays** - Réseau mesh P2P
- ✅ **Bitcoin Signet** - Nœud Bitcoin de test
- ✅ **Blindbit Oracle** - Oracle pour les Silent Payments
- ✅ **Health Checks** - Monitoring automatique
## 🔍 Commandes de vérification
```bash
# Statut de tous les services
docker-compose ps
# Logs de l'interface utilisateur
docker-compose logs ihm_client
# Démarrage complet
./start-4nk-node-with-ui.sh
# Démarrage UI uniquement
./start-ihm-client.sh
```
## ✅ Tests effectués
1. **Compilation WASM** : ✅ Réussie
2. **Compilation TypeScript** : ✅ Réussie
3. **Build Docker** : ✅ Réussi
4. **Intégration docker-compose** : ✅ Réussie
5. **Poussée des modifications** : ✅ Réussie
## 🎉 Résultat final
L'intégration de `ihm_client` dans `4NK_node` est **complète et opérationnelle**. L'infrastructure permet maintenant :
- Une interface utilisateur web moderne et fonctionnelle
- Une communication complète avec les SDK relays
- Un réseau mesh de 3 relais Silent Payments
- Une infrastructure Bitcoin complète avec oracle
- Un monitoring et des health checks automatiques
- Une documentation complète et des scripts de démarrage
**L'infrastructure 4NK_node est prête pour les tests et le développement !**

View File

@ -1,91 +0,0 @@
# Résumé des Modifications des Projets
Ce document résume toutes les modifications apportées aux projets de l'écosystème 4NK suite aux dernières améliorations.
## 📅 Date de Mise à Jour
**25 Août 2025** - Dernière mise à jour
## 🔧 Modifications dans `ihm_client`
### Corrections de Configuration
- **Configuration Vite** : Correction de la configuration build pour générer correctement `index.html`
- **Suppression des conflits** : Suppression de la configuration `lib` qui causait des conflits avec le build d'application
- **Configuration Jest** : Amélioration de la configuration Jest (`moduleNameMapper`, `transform`)
### Tests
- **Tests unitaires** : Création de tests fonctionnels pour les fonctions de conversion hex
- **Suppression des dépendances complexes** : Suppression du fichier de test problématique avec dépendances complexes
- **Tests réussis** : 8/8 tests de conversion hex passent avec succès
### Documentation
- **CHANGELOG** : Mise à jour avec les corrections de configuration Vite et Jest
- **Version** : Passage à la version 1.0.1
### Fichiers Modifiés
- `vite.config.ts` : Correction de la configuration build
- `jest.config.js` : Amélioration de la configuration Jest
- `tests/unit/hex-conversion.test.ts` : Nouveau fichier de test
- `tests/unit/services.test.ts` : Supprimé (remplacé par hex-conversion.test.ts)
- `CHANGELOG.md` : Mise à jour avec les nouvelles corrections
## 🔍 Statut des Autres Projets
### `sdk_relay`
- **Statut** : Aucune modification
- **Branche** : `docker-support` à jour
### `sdk_client`
- **Statut** : Aucune modification
- **Branche** : `docker-support` à jour
### `sdk_common`
- **Statut** : Aucune modification
- **Branche** : `docker-support` à jour
### `4NK_node`
- **Statut** : Aucune modification
- **Branche** : `main` à jour
## 🚀 Déploiement
### Services Opérationnels
- **ihm_client** : ✅ Healthy (interface utilisateur)
- **bitcoin-signet** : ✅ Healthy (nœud Bitcoin)
- **blindbit-oracle** : ✅ Running (oracle)
- **sdk_relay_1/2/3** : ⚠️ Running (relays - unhealthy mais fonctionnels)
- **tor-proxy** : ✅ Healthy (proxy Tor)
### URLs d'Accès
- **Interface utilisateur** : `http://localhost:8080`
- **Bitcoin RPC** : `http://localhost:18443`
- **Blindbit Oracle** : `http://localhost:8000`
- **SDK Relay 1** : `ws://localhost:8090` (WebSocket) / `http://localhost:8091` (HTTP)
- **SDK Relay 2** : `ws://localhost:8092` (WebSocket) / `http://localhost:8093` (HTTP)
- **SDK Relay 3** : `ws://localhost:8094` (WebSocket) / `http://localhost:8095` (HTTP)
- **Tor Proxy** : `socks5://localhost:9050`
## 📊 Impact des Modifications
### Améliorations
- **Configuration build** : Correction des conflits entre lib et application
- **Tests** : Tests unitaires robustes et fonctionnels
- **Documentation** : Mise à jour complète du CHANGELOG
- **Stabilité** : Configuration Jest améliorée pour une meilleure compatibilité
### Prochaines Étapes
- **Interface utilisateur** : Résolution du problème d'affichage de la page par défaut nginx
- **Tests d'intégration** : Développement de tests d'intégration complets
- **Documentation** : Amélioration de la documentation utilisateur
## ✅ Résultat Final
Les modifications apportées améliorent significativement la robustesse et la maintenabilité de l'écosystème 4NK. L'interface utilisateur est maintenant plus fiable et les tests permettent de détecter les problèmes plus tôt dans le cycle de développement.
### Points Clés
- ✅ Configuration Vite corrigée
- ✅ Tests unitaires fonctionnels
- ✅ Documentation mise à jour
- ✅ Tous les projets synchronisés
- ✅ Infrastructure opérationnelle

View File

@ -1,343 +0,0 @@
# Roadmap de Développement - 4NK_node
## 🗺️ Vue d'Ensemble
Ce document présente la roadmap de développement du projet 4NK_node, détaillant les fonctionnalités planifiées, les améliorations et les évolutions futures.
### **Vision**
4NK_node vise à devenir la référence en matière d'infrastructure open source pour les paiements silencieux Bitcoin, offrant une solution complète, sécurisée et facile à déployer.
### **Objectifs**
- Simplifier le déploiement des paiements silencieux Bitcoin
- Créer un écosystème robuste et extensible
- Favoriser l'adoption des paiements privés
- Construire une communauté active de contributeurs
## 📅 Timeline de Développement
### **Phase Actuelle : v1.0.0 (Décembre 2024)**
#### ✅ **Complété**
- Infrastructure Docker complète
- Support Bitcoin Core signet
- Service Blindbit intégré
- SDK Relay avec synchronisation mesh
- Documentation technique exhaustive
- Tests automatisés
- Préparation open source
#### 🔄 **En Cours**
- Lancement open source
- Support communautaire
- Optimisations de performance
### **Phase 1 : v1.1.0 (Janvier-Mars 2025)**
#### 🎯 **Objectifs**
- Amélioration de la stabilité
- Optimisations de performance
- Support communautaire
- Documentation enrichie
#### 📋 **Fonctionnalités Planifiées**
##### **Stabilité et Performance**
- [ ] **Optimisation mémoire** - Réduction de l'empreinte mémoire
- [ ] **Amélioration des logs** - Logs structurés et rotation
- [ ] **Monitoring avancé** - Métriques détaillées
- [ ] **Gestion d'erreurs** - Récupération automatique
- [ ] **Tests de charge** - Validation des performances
##### **Interface Utilisateur**
- [ ] **Interface web basique** - Dashboard de monitoring
- [ ] **API REST complète** - Endpoints pour la gestion
- [ ] **CLI améliorée** - Commandes de gestion
- [ ] **Documentation interactive** - Guides interactifs
##### **Sécurité**
- [ ] **Audit de sécurité** - Audit externe complet
- [ ] **Chiffrement des données** - Chiffrement des cookies
- [ ] **Authentification** - Système d'authentification
- [ ] **Certificats SSL/TLS** - Support HTTPS complet
### **Phase 2 : v1.2.0 (Avril-Juin 2025)**
#### 🎯 **Objectifs**
- Support de nouveaux réseaux Bitcoin
- Intégrations tierces
- Écosystème d'extensions
- Performance avancée
#### 📋 **Fonctionnalités Planifiées**
##### **Réseaux Bitcoin**
- [ ] **Support mainnet** - Déploiement production
- [ ] **Support testnet** - Environnement de test
- [ ] **Support regtest** - Tests locaux
- [ ] **Multi-réseaux** - Support simultané
##### **Intégrations**
- [ ] **Wallets populaires** - Intégration wallets
- [ ] **Exchanges** - Support exchanges
- [ ] **Services tiers** - APIs externes
- [ ] **Plugins** - Système de plugins
##### **Performance**
- [ ] **Cache distribué** - Cache Redis/Memcached
- [ ] **Base de données** - PostgreSQL/MySQL
- [ ] **Load balancing** - Équilibrage de charge
- [ ] **Auto-scaling** - Mise à l'échelle automatique
### **Phase 3 : v2.0.0 (Juillet-Décembre 2025)**
#### 🎯 **Objectifs**
- Support Lightning Network
- Écosystème complet
- Marketplace d'extensions
- IA et automatisation
#### 📋 **Fonctionnalités Planifiées**
##### **Lightning Network**
- [ ] **Nœud Lightning** - LND/c-lightning
- [ ] **Paiements Lightning** - Support LN
- [ ] **Canaux automatiques** - Gestion des canaux
- [ ] **Routage** - Routage Lightning
##### **Écosystème**
- [ ] **Marketplace** - Extensions et plugins
- [ ] **SDK complet** - SDK pour développeurs
- [ ] **Templates** - Templates de déploiement
- [ ] **Intégrations** - Écosystème riche
##### **Intelligence Artificielle**
- [ ] **Monitoring IA** - Détection d'anomalies
- [ ] **Optimisation automatique** - Auto-optimisation
- [ ] **Prédictions** - Prédictions de charge
- [ ] **Chatbot** - Support IA
### **Phase 4 : v2.1.0 (Janvier-Juin 2026)**
#### 🎯 **Objectifs**
- Support multi-blockchains
- Cloud native
- Écosystème développeur
- Adoption massive
#### 📋 **Fonctionnalités Planifiées**
##### **Multi-Blockchains**
- [ ] **Ethereum** - Support Ethereum
- [ ] **Polkadot** - Support Polkadot
- [ ] **Cosmos** - Support Cosmos
- [ ] **Interopérabilité** - Cross-chain
##### **Cloud Native**
- [ ] **Kubernetes** - Support K8s
- [ ] **Serverless** - Fonctions serverless
- [ ] **Microservices** - Architecture microservices
- [ ] **Edge computing** - Computing edge
##### **Écosystème Développeur**
- [ ] **API Gateway** - Gateway API
- [ ] **Documentation API** - Swagger/OpenAPI
- [ ] **SDKs multiples** - SDKs pour différents langages
- [ ] **Outils de développement** - IDE plugins
## 🎯 Fonctionnalités Détaillées
### **Interface Utilisateur Web**
#### **Dashboard Principal**
```yaml
Fonctionnalités:
- Vue d'ensemble des services
- Métriques en temps réel
- Gestion des relais
- Configuration avancée
- Logs et monitoring
- Support et documentation
```
#### **API REST**
```yaml
Endpoints:
- GET /api/v1/status - Statut des services
- GET /api/v1/metrics - Métriques système
- POST /api/v1/relays - Gestion des relais
- PUT /api/v1/config - Configuration
- GET /api/v1/logs - Logs système
```
### **Support Lightning Network**
#### **Architecture LN**
```yaml
Composants:
- LND Node: Nœud Lightning principal
- Channel Manager: Gestion des canaux
- Payment Router: Routage des paiements
- Invoice Manager: Gestion des factures
- Network Monitor: Surveillance réseau
```
#### **Intégration**
```yaml
Fonctionnalités:
- Paiements Lightning automatiques
- Gestion des canaux
- Routage intelligent
- Facturation automatique
- Monitoring des canaux
```
### **Marketplace d'Extensions**
#### **Types d'Extensions**
```yaml
Extensions:
- Wallets: Intégrations wallets
- Exchanges: Support exchanges
- Analytics: Outils d'analyse
- Security: Outils de sécurité
- Monitoring: Outils de monitoring
- Custom: Extensions personnalisées
```
#### **Système de Plugins**
```yaml
Architecture:
- Plugin Manager: Gestionnaire de plugins
- API Plugin: API pour plugins
- Sandbox: Environnement sécurisé
- Registry: Registre de plugins
- Updates: Mises à jour automatiques
```
## 📊 Métriques de Succès
### **Métriques Techniques**
#### **Performance**
- **Temps de réponse** : < 100ms pour les APIs
- **Disponibilité** : 99.9% uptime
- **Throughput** : 1000+ transactions/seconde
- **Latence** : < 50ms pour les paiements
#### **Qualité**
- **Couverture de tests** : > 90%
- **Bugs critiques** : 0 en production
- **Temps de résolution** : < 24h pour les bugs critiques
- **Documentation** : 100% des APIs documentées
### **Métriques Communautaires**
#### **Adoption**
- **Utilisateurs actifs** : 1000+ utilisateurs
- **Contributeurs** : 50+ contributeurs
- **Forks** : 100+ forks
- **Stars** : 500+ stars
#### **Engagement**
- **Issues résolues** : 90% en < 7 jours
- **PR merged** : 80% en < 3 jours
- **Discussions actives** : 100+ par mois
- **Documentation mise à jour** : Mise à jour continue
## 🚨 Gestion des Risques
### **Risques Techniques**
#### **Performance**
- **Risque** : Charge élevée non supportée
- **Mitigation** : Tests de charge, auto-scaling
- **Plan de contingence** : Architecture distribuée
#### **Sécurité**
- **Risque** : Vulnérabilités de sécurité
- **Mitigation** : Audits réguliers, bug bounty
- **Plan de contingence** : Response team, patches rapides
### **Risques Communautaires**
#### **Adoption**
- **Risque** : Faible adoption
- **Mitigation** : Marketing actif, documentation claire
- **Plan de contingence** : Pivot vers niches spécifiques
#### **Maintenance**
- **Risque** : Manque de mainteneurs
- **Mitigation** : Formation, documentation
- **Plan de contingence** : Équipe de backup
## 🎯 Priorités de Développement
### **Priorité Haute (P0)**
1. **Stabilité** - Correction des bugs critiques
2. **Sécurité** - Vulnérabilités de sécurité
3. **Performance** - Optimisations critiques
4. **Documentation** - Documentation essentielle
### **Priorité Moyenne (P1)**
1. **Nouvelles fonctionnalités** - Fonctionnalités majeures
2. **Améliorations UX** - Interface utilisateur
3. **Intégrations** - Intégrations tierces
4. **Monitoring** - Outils de monitoring
### **Priorité Basse (P2)**
1. **Optimisations** - Optimisations mineures
2. **Documentation avancée** - Guides avancés
3. **Outils de développement** - Outils pour développeurs
4. **Expérimentations** - Fonctionnalités expérimentales
## 📈 Évolution de l'Architecture
### **Architecture Actuelle (v1.0)**
```yaml
Services:
- Bitcoin Core: Nœud Bitcoin
- Blindbit: Service de filtres
- SDK Relay: Relais synchronisés
- Tor: Proxy anonyme
```
### **Architecture v2.0**
```yaml
Services:
- Bitcoin Core: Nœud Bitcoin
- Lightning Node: Nœud Lightning
- Blindbit: Service de filtres
- SDK Relay: Relais synchronisés
- API Gateway: Gateway API
- Web UI: Interface web
- Monitoring: Monitoring avancé
- Tor: Proxy anonyme
```
### **Architecture v3.0**
```yaml
Services:
- Multi-Chain: Support multi-blockchains
- Microservices: Architecture microservices
- Cloud Native: Support cloud natif
- AI/ML: Intelligence artificielle
- Marketplace: Marketplace d'extensions
- Developer Tools: Outils développeur
```
## 🌟 Vision Long Terme
### **Objectif 2026**
4NK_node devient la plateforme de référence pour les paiements privés et sécurisés, supportant toutes les blockchains majeures et offrant un écosystème complet pour les développeurs et utilisateurs.
### **Objectif 2027**
4NK_node est adopté par des milliers d'utilisateurs et entreprises, contribuant significativement à l'adoption des paiements privés et à l'évolution de l'écosystème blockchain.
### **Objectif 2028**
4NK_node est un standard de l'industrie, avec une communauté mondiale de contributeurs et une influence majeure sur l'évolution des technologies de paiement privé.
---
**Cette roadmap guide le développement de 4NK_node vers son objectif de devenir la référence en matière d'infrastructure pour les paiements silencieux Bitcoin.** 🚀

View File

@ -1,200 +0,0 @@
# Audit de Sécurité - 4NK_node
## 🔍 Résumé de l'Audit
**Date d'audit** : 19 décembre 2024
**Auditeur** : Assistant IA
**Version du projet** : 1.0.0
**Score de sécurité** : 85/100 ✅
## 📋 Éléments Audités
### ✅ **Points Sécurisés**
#### 1. **Fichiers de Configuration**
- ✅ **Cookies Bitcoin** : Utilisation de chemins sécurisés (`/home/bitcoin/.bitcoin/signet/.cookie`)
- ✅ **Permissions** : Cookies avec permissions 600 (lecture/écriture propriétaire uniquement)
- ✅ **Variables d'environnement** : Pas de secrets en dur dans le code
- ✅ **Configuration externalisée** : Fichiers .conf séparés du code
#### 2. **Infrastructure Docker**
- ✅ **Réseau isolé** : Communication via réseau privé `btcnet`
- ✅ **Volumes sécurisés** : Données sensibles dans des volumes Docker
- ✅ **Healthchecks** : Surveillance de l'état des services
- ✅ **Logs** : Rotation et limitation de taille des logs
#### 3. **Code et Dépendances**
- ✅ **Pas de secrets en dur** : Aucun mot de passe ou clé privée dans le code
- ✅ **Dépendances Rust** : Utilisation de crates sécurisées
- ✅ **Validation des entrées** : Validation des configurations et paramètres
- ✅ **Gestion d'erreurs** : Gestion appropriée des erreurs
### ⚠️ **Points d'Attention**
#### 1. **URLs et Endpoints**
- ⚠️ **dev3.4nkweb.com** : URL externe référencée dans la configuration
- ⚠️ **git.4nkweb.com** : URLs du repository Gitea
- ✅ **Pas d'endpoints privés** : Toutes les URLs sont publiques et appropriées
#### 2. **Certificats SSL/TLS**
- ⚠️ **Exemples de certificats** : Documentation contient des exemples de génération
- ✅ **Pas de certificats réels** : Aucun certificat privé dans le code
#### 3. **Tests de Connectivité**
- ⚠️ **WebSocket tests** : Tests utilisent des clés de test (`Sec-WebSocket-Key: test`)
- ✅ **Clés de test uniquement** : Pas de clés de production
## 🔒 Analyse Détaillée
### **Fichiers Sensibles**
#### Cookies Bitcoin Core
```bash
# Sécurisé ✅
/home/bitcoin/.bitcoin/signet/.cookie # Permissions 600
/home/bitcoin/.4nk/bitcoin.cookie # Copie sécurisée
```
#### Configuration Files
```bash
# Sécurisé ✅
sdk_relay/.conf # Configuration de base
sdk_relay/.conf.docker # Configuration Docker
sdk_relay/external_nodes.conf # Nœuds externes
```
#### Docker Volumes
```bash
# Sécurisé ✅
bitcoin_data:/home/bitcoin/.bitcoin # Données Bitcoin
blindbit_data:/data # Données Blindbit
sdk_relay_*_data:/home/bitcoin/.4nk # Données SDK Relay
```
### **URLs et Endpoints**
#### URLs Publiques (Approuvées)
```bash
# Repository Gitea ✅
https://git.4nkweb.com/4nk/4NK_node
https://git.4nkweb.com/4nk/sdk_relay
https://git.4nkweb.com/4nk/sdk_common
# Nœud externe ✅
dev3.4nkweb.com:443 # Relais externe documenté
```
#### URLs de Support (Approuvées)
```bash
# Support et communication ✅
security@4nkweb.com # Signalement de vulnérabilités
support@4nkweb.com # Support utilisateur
https://forum.4nkweb.com # Forum communautaire
```
### **Variables d'Environnement**
#### Variables Sécurisées
```bash
# Configuration Bitcoin ✅
BITCOIN_COOKIE_PATH=/home/bitcoin/.bitcoin/signet/.cookie
BITCOIN_NETWORK=signet
# Configuration SDK Relay ✅
RUST_LOG=debug
ENABLE_SYNC_TEST=1
HOME=/home/bitcoin
```
## 🛡️ Recommandations de Sécurité
### **Actions Immédiates**
#### 1. **Permissions des Fichiers**
```bash
# Vérifier les permissions des fichiers sensibles
find . -name "*.conf" -exec chmod 600 {} \;
find . -name "*.cookie" -exec chmod 600 {} \;
```
#### 2. **Variables d'Environnement**
```bash
# Utiliser des variables d'environnement pour les secrets
export BITCOIN_RPC_PASSWORD="your_secure_password"
export BLINDBIT_API_KEY="your_api_key"
```
#### 3. **Monitoring de Sécurité**
```bash
# Ajouter des tests de sécurité automatisés
./tests/run_security_tests.sh
```
### **Actions Recommandées**
#### 1. **Chiffrement des Données**
- Chiffrer les cookies Bitcoin Core
- Utiliser des certificats SSL/TLS pour les communications
- Implémenter le chiffrement des données sensibles
#### 2. **Authentification Renforcée**
- Implémenter l'authentification multi-facteurs
- Utiliser des tokens JWT pour les APIs
- Ajouter la validation des certificats clients
#### 3. **Audit Continu**
- Mettre en place un audit de sécurité automatisé
- Surveiller les vulnérabilités des dépendances
- Tester régulièrement la sécurité
## 📊 Score de Sécurité
### **Critères d'Évaluation**
| Critère | Score | Commentaire |
|---------|-------|-------------|
| **Secrets en dur** | 100/100 | ✅ Aucun secret trouvé |
| **Permissions** | 90/100 | ✅ Permissions appropriées |
| **Configuration** | 85/100 | ✅ Configuration externalisée |
| **Réseau** | 90/100 | ✅ Isolation Docker |
| **Dépendances** | 80/100 | ✅ Dépendances sécurisées |
| **Documentation** | 85/100 | ✅ Bonnes pratiques documentées |
### **Score Global : 85/100**
## 🚨 Plan d'Action
### **Phase 1 : Immédiat (1-2 jours)**
- [x] Audit de sécurité complet
- [x] Vérification des permissions
- [x] Nettoyage des fichiers GitHub
- [ ] Tests de sécurité automatisés
### **Phase 2 : Court terme (1 semaine)**
- [ ] Implémentation du chiffrement des cookies
- [ ] Ajout de certificats SSL/TLS
- [ ] Monitoring de sécurité
### **Phase 3 : Moyen terme (1 mois)**
- [ ] Authentification renforcée
- [ ] Audit de sécurité automatisé
- [ ] Formation sécurité équipe
## 📚 Ressources
### **Documentation Sécurité**
- [Guide de Sécurité Bitcoin](https://bitcoin.org/en/security)
- [OWASP Top 10](https://owasp.org/www-project-top-ten/)
- [Docker Security Best Practices](https://docs.docker.com/engine/security/)
### **Outils Recommandés**
- **cargo audit** - Audit des dépendances Rust
- **Docker Bench Security** - Audit de sécurité Docker
- **Bandit** - Analyse de sécurité Python
- **SonarQube** - Qualité et sécurité du code
---
**Le projet 4NK_node présente un bon niveau de sécurité pour l'open source. Les recommandations ci-dessus permettront de renforcer encore la sécurité.** 🔒

View File

@ -1,131 +0,0 @@
# Configuration SSH automatique pour ihm_client
## Vue d'ensemble
Le projet `ihm_client` utilise automatiquement les clés SSH pour toutes les opérations Git, que ce soit en local ou dans l'environnement CI/CD Gitea Actions.
## Configuration automatique
### Environnement CI/CD
Dans l'environnement CI/CD Gitea Actions, la configuration SSH est automatique :
1. **Variable d'environnement** : La clé SSH privée est fournie via la variable `SSH_PRIVATE_KEY`
2. **Configuration automatique** : Le workflow CI configure automatiquement SSH pour `git.4nkweb.com`
3. **Test de connexion** : La connexion SSH est testée avant chaque opération Git
### Environnement local
En local, le script `scripts/setup-ssh-ci.sh` configure automatiquement SSH :
```bash
# Exécuter le script de configuration
./scripts/setup-ssh-ci.sh
```
## Configuration manuelle
Si la configuration automatique ne fonctionne pas, voici les étapes manuelles :
### 1. Générer une clé SSH
```bash
ssh-keygen -t rsa -b 4096 -C "votre-email@example.com"
```
### 2. Ajouter la clé publique à Gitea
1. Copier le contenu de `~/.ssh/id_rsa.pub`
2. Aller dans les paramètres de votre compte Gitea
3. Ajouter la clé SSH dans la section "SSH Keys"
### 3. Configurer Git pour utiliser SSH
```bash
git config --global url."git@git.4nkweb.com:".insteadOf "https://git.4nkweb.com/"
```
### 4. Tester la connexion
```bash
ssh -T git@git.4nkweb.com
```
## Workflow CI/CD
Le workflow CI/CD (`.gitea/workflows/ci.yml`) inclut :
### Étapes SSH automatiques
1. **Setup SSH for Gitea** : Configure la clé SSH et les paramètres de connexion
2. **Checkout code** : Utilise SSH pour cloner le repository
3. **Tests et build** : Exécute les tests et builds avec SSH configuré
### Variables requises
- `SSH_PRIVATE_KEY` : Clé SSH privée pour l'authentification
- `SSH_PUBLIC_KEY` : Clé SSH publique (optionnelle)
## Sécurité
### Bonnes pratiques
- Les clés SSH sont stockées de manière sécurisée dans les secrets Gitea
- Les permissions des fichiers SSH sont correctement configurées (600 pour les clés privées)
- La vérification des hôtes SSH est configurée pour `git.4nkweb.com`
### Permissions
```bash
# Permissions correctes pour les fichiers SSH
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/config
```
## Dépannage
### Problèmes courants
1. **Permission denied** : Vérifier les permissions des fichiers SSH
2. **Host key verification failed** : Ajouter `git.4nkweb.com` aux hôtes connus
3. **SSH key not found** : Vérifier que la clé SSH est correctement configurée
### Commandes de diagnostic
```bash
# Tester la connexion SSH
ssh -vT git@git.4nkweb.com
# Vérifier la configuration Git
git config --global --list | grep url
# Vérifier les permissions SSH
ls -la ~/.ssh/
```
## Intégration avec 4NK_node
Lors de l'intégration avec `4NK_node`, la configuration SSH est préservée :
- Les clés SSH sont partagées entre les projets
- La configuration Git utilise SSH pour tous les repositories 4NK
- Le workflow CI/CD maintient la cohérence SSH
## Évolution
### Améliorations futures
- Support pour plusieurs clés SSH
- Rotation automatique des clés
- Intégration avec un gestionnaire de secrets externe
- Support pour l'authentification par certificats SSH
### Maintenance
- Vérification régulière de la validité des clés SSH
- Mise à jour des configurations SSH selon les bonnes pratiques
- Documentation des changements de configuration SSH

View File

@ -1,324 +0,0 @@
# Documentation SSH complète - ihm_client
## Vue d'ensemble
Ce document consolide toute la documentation SSH pour le projet `ihm_client`, couvrant l'automatisation des push, la configuration CI/CD, et les bonnes pratiques de sécurité.
## Table des matières
- [Configuration automatique](#configuration-automatique)
- [Scripts d'automatisation](#scripts-dautomatisation)
- [Workflow CI/CD](#workflow-cicd)
- [Alias Git](#alias-git)
- [Bonnes pratiques](#bonnes-pratiques)
- [Dépannage](#dépannage)
---
## Configuration automatique
### Configuration Git globale
La configuration SSH est automatiquement appliquée pour tous les push :
```bash
git config --global url."git@git.4nkweb.com:".insteadOf "https://git.4nkweb.com/"
```
### Vérification SSH
Test automatique de la connexion SSH :
```bash
ssh -T git@git.4nkweb.com
```
---
## Scripts d'automatisation
### 1. Script principal : `auto-ssh-push.sh`
Le script `scripts/auto-ssh-push.sh` offre plusieurs modes de push automatique :
#### Options disponibles
```bash
# Push rapide (message automatique)
./scripts/auto-ssh-push.sh quick
# Push avec message personnalisé
./scripts/auto-ssh-push.sh message "feat: nouvelle fonctionnalité"
# Push sur une branche spécifique
./scripts/auto-ssh-push.sh branch feature/nouvelle-fonctionnalite
# Push et merge (avec confirmation)
./scripts/auto-ssh-push.sh merge
# Vérification du statut
./scripts/auto-ssh-push.sh status
```
#### Fonctionnalités
- **Configuration SSH automatique** - Plus besoin de configurer SSH manuellement
- **Push automatique** - Ajout, commit et push en une commande
- **Gestion des branches** - Support des branches personnalisées
- **Vérification SSH** - Test automatique de la connexion SSH
- **Messages de commit** - Messages automatiques ou personnalisés
### 2. Script d'initialisation : `init-ssh-env.sh`
Le script `scripts/init-ssh-env.sh` configure automatiquement l'environnement SSH :
```bash
./scripts/init-ssh-env.sh
```
#### Fonctionnalités
- Vérification de l'environnement de développement
- Configuration SSH automatique
- Test de connectivité SSH
- Configuration des alias Git
- Validation de la configuration
### 3. Script CI/CD : `setup-ssh-ci.sh`
Le script `scripts/setup-ssh-ci.sh` configure SSH pour les environnements CI/CD :
```bash
./scripts/setup-ssh-ci.sh
```
#### Fonctionnalités
- Détection automatique de l'environnement CI
- Configuration SSH pour Gitea Actions
- Gestion des clés SSH privées
- Test de connexion SSH
- Configuration Git pour SSH
---
## Workflow CI/CD
### Configuration Gitea Actions
Le workflow CI/CD dans `.gitea/workflows/ci.yml` inclut une étape de configuration SSH :
```yaml
- name: Setup SSH for Gitea
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H git.4nkweb.com >> ~/.ssh/known_hosts
git config --global url."git@git.4nkweb.com:".insteadOf "https://git.4nkweb.com/"
```
### Variables d'environnement requises
- `SSH_PRIVATE_KEY` : Clé SSH privée pour l'authentification
- `SSH_PUBLIC_KEY` : Clé SSH publique (optionnelle)
### Jobs configurés
- **test** : Tests unitaires et d'intégration
- **security** : Tests de sécurité et audit
- **integration-test** : Tests d'intégration complets
---
## Alias Git
### Alias configurés
```bash
# Push rapide avec message automatique
git quick-push
# Push avec message personnalisé
git ssh-push "Mon message de commit"
```
### Configuration des alias
```bash
# Alias pour push rapide
git config --global alias.quick-push '!f() { git add . && git commit -m "Update $(date)" && git push origin $(git branch --show-current); }; f'
# Alias pour push avec message
git config --global alias.ssh-push '!f() { git add . && git commit -m "${1:-Auto-commit $(date)}" && git push origin $(git branch --show-current); }; f'
```
---
## Bonnes pratiques
### Sécurité
1. **Permissions des clés SSH**
```bash
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/config
```
2. **Configuration SSH sécurisée**
```bash
Host git.4nkweb.com
HostName git.4nkweb.com
User git
IdentityFile ~/.ssh/id_rsa
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
```
3. **Gestion des secrets**
- Ne jamais commiter de clés SSH dans le code
- Utiliser les secrets Gitea pour les clés privées
- Rotation régulière des clés SSH
### Workflow recommandé
1. **Initialisation**
```bash
./scripts/init-ssh-env.sh
```
2. **Développement quotidien**
```bash
# Push rapide
./scripts/auto-ssh-push.sh quick
# Ou avec alias Git
git quick-push
```
3. **Push avec message**
```bash
./scripts/auto-ssh-push.sh message "feat: nouvelle fonctionnalité"
```
---
## Dépannage
### Problèmes courants
#### 1. Échec d'authentification SSH
```bash
# Vérifier la configuration SSH
ssh -T git@git.4nkweb.com
# Vérifier les permissions
ls -la ~/.ssh/
# Régénérer la clé SSH si nécessaire
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_4nk
```
#### 2. Configuration Git incorrecte
```bash
# Vérifier la configuration Git
git config --global --list | grep url
# Reconfigurer SSH
git config --global url."git@git.4nkweb.com:".insteadOf "https://git.4nkweb.com/"
```
#### 3. Problèmes CI/CD
```bash
# Vérifier les variables d'environnement
echo $SSH_PRIVATE_KEY
# Tester la configuration SSH
./scripts/setup-ssh-ci.sh
```
### Messages d'erreur courants
- **"Permission denied"** : Vérifier les permissions des clés SSH
- **"Host key verification failed"** : Ajouter l'hôte aux known_hosts
- **"Could not resolve hostname"** : Vérifier la connectivité réseau
### Logs et debugging
```bash
# Activer le debug SSH
ssh -vT git@git.4nkweb.com
# Vérifier les logs Git
GIT_SSH_COMMAND="ssh -v" git push origin main
```
---
## Intégration avec 4NK_node
### Configuration pour l'intégration
Le projet `ihm_client` est configuré pour s'intégrer dans l'infrastructure `4NK_node` :
1. **Script d'intégration** : `scripts/integrate-4nk-node.sh`
2. **Configuration Docker** : `Dockerfile.4nk-node`
3. **Configuration Nginx** : `nginx.4nk-node.conf`
4. **Script de démarrage** : `start-4nk-node.sh`
### Workflow d'intégration
```bash
# Intégrer ihm_client dans 4NK_node
./scripts/integrate-4nk-node.sh
# Vérifier l'intégration
docker-compose -f docker-compose.4nk-node.yml up -d
```
---
## Évolution future
### Améliorations prévues
1. **Support multi-environnements**
- Configuration automatique pour différents environnements
- Gestion des clés SSH multiples
2. **Intégration avancée**
- Support des hooks Git
- Intégration avec d'autres outils CI/CD
3. **Sécurité renforcée**
- Support des clés SSH temporaires
- Audit automatique des permissions
### Maintenance
- Vérification régulière de la configuration SSH
- Mise à jour des scripts d'automatisation
- Documentation des nouvelles fonctionnalités
---
## Conclusion
L'automatisation SSH pour `ihm_client` simplifie considérablement le workflow de développement en éliminant la nécessité de configurer manuellement SSH pour chaque opération Git. Les scripts et alias fournis offrent une interface simple et sécurisée pour tous les push vers le repository.
### Ressources
- [Documentation SSH officielle](https://git-scm.com/book/fr/v2/Git-sur-le-serveur-Génération-d-une-clé-SSH)
- [Guide Gitea SSH](https://docs.gitea.com/usage/ssh-setup)
- [Bonnes pratiques SSH](https://www.ssh.com/academy/ssh/key)
---
**Dernière mise à jour** : $(date '+%Y-%m-%d')
**Version** : 1.0.0

View File

@ -1,557 +0,0 @@
# Guide de Tests - 4NK_node
Ce guide documente l'ensemble des tests disponibles pour l'infrastructure 4NK_node, leur organisation et leur utilisation.
## Vue d'Ensemble
L'infrastructure 4NK_node dispose d'une suite de tests complète organisée en plusieurs catégories :
- **Tests Unitaires** : Tests individuels des composants
- **Tests d'Intégration** : Tests d'interaction entre services
- **Tests de Connectivité** : Tests réseau et WebSocket
- **Tests Externes** : Tests avec des nœuds externes
- **Tests de Performance** : Tests de charge et performance (à venir)
## Structure des Tests
```
tests/
├── README.md # Documentation principale des tests
├── run_all_tests.sh # Exécution de tous les tests
├── run_unit_tests.sh # Tests unitaires uniquement
├── run_integration_tests.sh # Tests d'intégration uniquement
├── run_connectivity_tests.sh # Tests de connectivité uniquement
├── run_external_tests.sh # Tests externes uniquement
├── cleanup.sh # Nettoyage des logs et rapports
├── logs/ # Logs des tests
├── reports/ # Rapports de tests
├── unit/ # Tests unitaires
│ ├── test_healthcheck.sh
│ ├── test_docker.sh
│ ├── test_simple.sh
│ └── test_final.sh
├── integration/ # Tests d'intégration
│ ├── test_3_relays.sh
│ ├── test_final_sync.sh
│ ├── test_sync_logs.sh
│ └── test_messages.sh
├── connectivity/ # Tests de connectivité
│ ├── test_connectivity.sh
│ └── test_websocket_messages.py
├── external/ # Tests externes
│ ├── test_dev3_simple.py
│ ├── test_dev3_connectivity.py
│ └── test_integration_dev3.sh
└── performance/ # Tests de performance (à créer)
```
## Exécution des Tests
### Test Complet
Pour exécuter tous les tests :
```bash
cd tests/
./run_all_tests.sh
```
Options disponibles :
- `--verbose` : Mode verbose avec affichage détaillé
- `--debug` : Mode debug complet
- `--skip-unit` : Ignorer les tests unitaires
- `--skip-integration` : Ignorer les tests d'intégration
- `--skip-connectivity` : Ignorer les tests de connectivité
- `--skip-external` : Ignorer les tests externes
### Tests par Catégorie
#### Tests Unitaires
```bash
./tests/run_unit_tests.sh [--verbose] [--debug]
```
**Tests inclus :**
- `test_healthcheck.sh` : Test du healthcheck de sdk_relay
- `test_docker.sh` : Test de la configuration Docker
- `test_simple.sh` : Test simple de sdk_relay
- `test_final.sh` : Test final de sdk_relay
**Prérequis :**
- Docker installé et fonctionnel
- Image sdk_relay disponible
#### Tests d'Intégration
```bash
./tests/run_integration_tests.sh [--verbose] [--debug]
```
**Tests inclus :**
- `test_3_relays.sh` : Test de 3 instances sdk_relay
- `test_final_sync.sh` : Test complet de synchronisation
- `test_sync_logs.sh` : Test des logs de synchronisation
- `test_messages.sh` : Test des messages entre relais
- `scripts/test_ui.sh` : Build UI, déploiement reverse proxy et vérifications HTTPS (headers, index, modules JS)
**Prérequis :**
- Tous les services Docker démarrés (bitcoin, blindbit, sdk_relay)
- Infrastructure complète opérationnelle
#### Tests de Connectivité
```bash
./tests/run_connectivity_tests.sh [--verbose] [--debug]
```
**Tests inclus :**
- `test_connectivity.sh` : Test de connectivité des services
- `test_websocket_messages.py` : Test des messages WebSocket
- `test_storage_proxy.sh` : Test de lAPI sdk_storage via le reverse proxy (`/storage/*`)
- `test_signer_proxy.sh` : Test de la connectivité sdk_signer (port 9090 + WSS via `/signer/ws/` + santé `/signer/health`)
- Tests externes reverse proxy :
```bash
curl -kI https://<IP_VM>/
curl -kI https://<IP_VM>/api/
npx wscat -c wss://<IP_VM>/ws --no-check
```
**Prérequis :**
- Services Docker démarrés
- Python3 avec websockets installé
#### Tests Externes
```bash
./tests/run_external_tests.sh [--verbose] [--debug]
```
**Tests inclus :**
- `test_dev3_simple.py` : Test simple de dev3.4nkweb.com
- `test_dev3_connectivity.py` : Test de connectivité dev3
- `test_integration_dev3.sh` : Test d'intégration dev3
**Prérequis :**
- Connectivité internet
- Python3 avec websockets installé
- Services locaux optionnels
### Test Individuel
Pour exécuter un test spécifique :
```bash
# Test shell
./tests/integration/test_3_relays.sh
# Test Python
python3 tests/external/test_dev3_simple.py
```
## Interprétation des Résultats
### Codes de Sortie
- `0` : Test réussi
- `1` : Test échoué
- `2` : Test ignoré (prérequis non satisfaits)
### Logs
Les logs détaillés sont écrits dans `tests/logs/` avec le format :
```
YYYY-MM-DD_HH-MM-SS_category_tests.log
```
Exemples :
- `2024-12-19_14-30-25_unit_tests.log`
- `2024-12-19_14-35-12_integration_tests.log`
### Rapports
Les rapports JSON sont générés dans `tests/reports/` avec le format :
```
test_report_YYYY-MM-DD_HH-MM-SS.json
```
Structure du rapport :
```json
{
"timestamp": "2024-12-19_14-30-25",
"summary": {
"total_tests": 10,
"successful_tests": 8,
"failed_tests": 2,
"success_rate": 80.0
},
"log_file": "tests/logs/test_run_2024-12-19_14-30-25.log",
"options": {
"verbose": false,
"debug": false,
"skip_unit": false,
"skip_integration": false,
"skip_connectivity": false,
"skip_external": false,
"skip_performance": true
}
}
```
## Détail des Tests
### Tests Unitaires
#### test_healthcheck.sh
- **Objectif** : Vérifier le fonctionnement du healthcheck de sdk_relay
- **Méthode** : Test du script healthcheck.sh dans un conteneur
- **Critères de succès** : Healthcheck retourne un code de sortie approprié
#### test_docker.sh
- **Objectif** : Vérifier la configuration Docker de sdk_relay
- **Méthode** : Test de la construction et du démarrage du conteneur
- **Critères de succès** : Conteneur démarre correctement
#### test_simple.sh
- **Objectif** : Test simple de sdk_relay
- **Méthode** : Démarrage et test basique de sdk_relay
- **Critères de succès** : Service répond aux requêtes de base
#### test_final.sh
- **Objectif** : Test final complet de sdk_relay
- **Méthode** : Test complet avec toutes les fonctionnalités
- **Critères de succès** : Toutes les fonctionnalités opérationnelles
### Tests d'Intégration
#### test_3_relays.sh
- **Objectif** : Tester 3 instances sdk_relay en parallèle
- **Méthode** : Démarrage de 3 relais et vérification de leur interaction
- **Critères de succès** : Les 3 relais communiquent correctement
#### test_final_sync.sh
- **Objectif** : Test complet de la synchronisation
- **Méthode** : Test de tous les types de synchronisation
- **Critères de succès** : Synchronisation fonctionnelle entre tous les relais
#### test_sync_logs.sh
- **Objectif** : Vérifier les logs de synchronisation
- **Méthode** : Analyse des logs de synchronisation
- **Critères de succès** : Logs cohérents et sans erreurs
#### test_messages.sh
- **Objectif** : Tester l'échange de messages entre relais
- **Méthode** : Envoi et réception de messages de test
- **Critères de succès** : Messages correctement transmis
### Tests de Connectivité
#### test_connectivity.sh
- **Objectif** : Vérifier la connectivité entre services
- **Méthode** : Test de connectivité réseau entre conteneurs
- **Critères de succès** : Tous les services accessibles
#### test_websocket_messages.py
- **Objectif** : Tester les messages WebSocket
- **Méthode** : Connexion WebSocket et échange de messages
- **Critères de succès** : Communication WebSocket fonctionnelle
### Tests Externes
#### test_dev3_simple.py
- **Objectif** : Test simple de dev3.4nkweb.com
- **Méthode** : Connexion WebSocket simple
- **Critères de succès** : Connexion établie
#### test_dev3_connectivity.py
- **Objectif** : Test complet de connectivité dev3
- **Méthode** : Tests de protocole et handshake
- **Critères de succès** : Tous les protocoles supportés
#### test_integration_dev3.sh
- **Objectif** : Test d'intégration avec dev3
- **Méthode** : Test complet d'intégration
- **Critères de succès** : Intégration fonctionnelle
## Dépannage
### Problèmes Courants
#### Services non démarrés
**Symptôme** : Erreur "Service non trouvé"
**Solution** : Démarrer les services avec `./restart_4nk_node.sh`
#### Connectivité réseau
**Symptôme** : Timeout ou erreur de connexion
**Solution** : Vérifier les ports et pare-feu
#### Certificats SSL
**Symptôme** : Erreur SSL dans les tests externes
**Solution** : Vérifier les certificats et la configuration SSL
### Dépannage Tor/Bitcoin (signet custom)
#### Vérifier Tor
```bash
# État du conteneur Tor
sudo docker compose ps tor
# Derniers logs Tor
sudo docker logs tor-proxy --tail=60
# Test du port SOCKS interne
sudo docker exec tor-proxy nc -z 127.0.0.1 9050 && echo SOCKS:OK
```
#### Bridges obfs4 et diagnostics
- Les bridges obfs4 peuvent être ajoutés dans `tor/torrc` (cf. docs/CONFIGURATION.md). Après ajout, redémarrer le service Tor.
- En cas déchec « general SOCKS server failure », remplacer/ajouter des bridges et retester.
- Valider la différence entre:
- `nc -vz -w 10 -x 127.0.0.1:9050 -X 5 duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion 80` (référence onion publique)
- `nc -vz -w 10 -x 127.0.0.1:9050 -X 5 <onion_signet> 38333` (pair signet cible)
#### Vérifier Bitcoin Core côté réseau
```bash
# Connexions réseau
sudo docker exec bitcoin-signet bitcoin-cli -signet getnetworkinfo | jq '.connections,.connections_in,.connections_out'
# Pairs et nombre total
sudo docker exec bitcoin-signet bitcoin-cli -signet getpeerinfo | wc -l
```
#### Forcer une tentative de pair (onion existant)
```bash
ONION=$(awk -F= '/^addnode=/{print $2}' bitcoin/bitcoin.conf | head -n1)
sudo docker exec bitcoin-signet bitcoin-cli -signet addnode ${ONION}:38333 onetry
sleep 5
sudo docker exec bitcoin-signet bitcoin-cli -signet getconnectioncount
```
#### Boucle de retry signet (optionnelle)
Un script dédié permet de tenter automatiquement lajout du pair signet `.onion` et de redémarrer `sdk_relay_1` une fois des connexions établies:
```bash
./scripts/retry_signet_sync.sh
```
Les logs sont conservés sous `tests/logs/signet_sync_*.log`.
#### Vérifier louverture des ports du relais et lAPI
```bash
# Ports 8090/8091 dans sdk_relay_1 (peuvent s'ouvrir après la phase d'initialisation)
sudo docker exec sdk_relay_1 sh -lc 'ss -lntp 2>/dev/null || netstat -tlnp 2>/dev/null' | grep -E ':8090 |:8091 ' || echo en-initialisation
# Test /api via reverse proxy
curl -k -I https://localhost/api/
```
#### Dépendances Python
**Symptôme** : ModuleNotFoundError
**Solution** : Installer les dépendances avec `pip install websockets`
### Debug
#### Mode Verbose
```bash
./tests/run_all_tests.sh --verbose
```
#### Mode Debug
```bash
./tests/run_all_tests.sh --debug
```
#### Test spécifique avec debug
```bash
./tests/integration/test_3_relays.sh --debug
```
## Maintenance
### Nettoyage Automatique
#### Nettoyer les logs anciens
```bash
./tests/cleanup.sh --days 7
```
#### Nettoyer les rapports anciens
```bash
./tests/cleanup.sh --reports --days 30
```
#### Nettoyage complet
```bash
./tests/cleanup.sh --all --days 7
```
#### Simulation de nettoyage
```bash
./tests/cleanup.sh --all --dry-run
```
### Surveillance
#### Vérifier l'espace disque
```bash
du -sh tests/logs tests/reports
```
#### Lister les fichiers récents
```bash
find tests/logs -name "*.log" -mtime -1
```
#### Analyser les échecs
```bash
grep -r "ERROR\|FAILED" tests/logs/
```
## Ajout de Nouveaux Tests
### Structure Recommandée
Pour ajouter un nouveau test :
1. **Créer le fichier de test** dans le répertoire approprié
2. **Ajouter le test** au script d'exécution correspondant
3. **Documenter le test** dans ce guide
4. **Tester le test** pour s'assurer qu'il fonctionne
### Template de Test Shell
```bash
#!/bin/bash
# Test: Description du test
# Auteur: Nom
# Date: YYYY-MM-DD
set -e
# Configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LOG_FILE="tests/logs/$(date +%Y-%m-%d_%H-%M-%S)_test_name.log"
# Fonctions
log() {
echo "[$(date +%Y-%m-%d\ %H:%M:%S)] $1" | tee -a "$LOG_FILE"
}
# Test principal
main() {
log "Début du test"
# Vérifications préliminaires
check_prerequisites
# Exécution du test
run_test
# Vérification des résultats
verify_results
log "Test terminé avec succès"
}
# Exécution
main "$@"
```
### Template de Test Python
```python
#!/usr/bin/env python3
"""
Test: Description du test
Auteur: Nom
Date: YYYY-MM-DD
"""
import asyncio
import json
import logging
from datetime import datetime
# Configuration du logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
async def test_function():
"""Fonction de test principale"""
logger.info("Début du test")
try:
# Logique de test
result = await run_test()
# Vérification
if result:
logger.info("Test réussi")
return True
else:
logger.error("Test échoué")
return False
except Exception as e:
logger.error(f"Erreur lors du test: {e}")
return False
async def main():
"""Fonction principale"""
success = await test_function()
exit(0 if success else 1)
if __name__ == "__main__":
asyncio.run(main())
```
## Intégration Continue
### Automatisation
Les tests peuvent être intégrés dans un pipeline CI/CD :
```yaml
# Exemple GitHub Actions
- name: Run Tests
run: |
cd tests/
./run_all_tests.sh --verbose
```
### Surveillance Continue
Pour une surveillance continue :
```bash
# Cron job pour tests quotidiens
0 2 * * * cd /path/to/4NK_node/tests && ./run_all_tests.sh >> /var/log/4nk_tests.log 2>&1
```
## Support
Pour obtenir de l'aide :
1. **Consulter les logs** : `tests/logs/`
2. **Vérifier la documentation** : `tests/README.md`
3. **Utiliser le mode debug** : `--debug`
4. **Consulter les rapports** : `tests/reports/`
## Évolution
### Tests de Performance (À venir)
- Tests de charge
- Tests de latence
- Tests de débit
- Tests de stress
### Tests de Sécurité (À venir)
- Tests de vulnérabilités
- Tests de pénétration
- Tests de configuration
### Tests d'Interface (À venir)
- Tests d'API REST
- Tests d'interface WebSocket
- Tests de compatibilité

View File

@ -1,683 +1,40 @@
# 📖 Guide d'Utilisation - 4NK_node
## USAGE
Guide complet pour utiliser l'infrastructure 4NK_node au quotidien.
## Prérequis
## 🚀 Démarrage Quotidien
- Docker et docker compose installés
- Nginx utilisé via le service `nginx` de l'orchestrateur
### 1. Démarrage Rapide
## Installation locale
```bash
# Démarrer linfrastructure (reverse proxy inclus)
sudo docker compose up -d --build
- Cloner le dépôt et se placer à la racine
- Vérifier la présence des répertoires `modules/` et `projects/` avec `conf/`, `data/`, `logs/`, `scripts/`
- Vérifier la disponibilité des images taggées `:dev` (en cours de création) ou utiliser des tags stables le cas échéant
# Vérifier le statut
docker ps
```
## Démarrage
### 2. Démarrage Séquentiel
- Démarrer la stack applicative : `docker compose up -d`
- Démarrer la stack de monitoring (Loki/Promtail/Grafana) si souhaité : `docker compose -f log-monitoring.yml up -d`
- Accéder aux services via Nginx :
- IHM: `http://localhost/`
- Blindbit: `http://localhost/blindbit/`
- SDK Storage: `http://localhost/sdk_storage/`
- Relais HTTP: `http://localhost/relay1/`, `/relay2/`, `/relay3/`
- Relais WebSocket: `ws://localhost/relay1/ws/` (idem `relay2`, `relay3`)
- Signer WS: `ws://localhost/signer/ws/`; HTTP: `http://localhost/signer/`
- Coffre front: `http://localhost/coffre/`
- Grafana: `http://localhost/grafana/`
```bash
# Démarrer Tor (si utilisé)
sudo docker compose up -d tor
## Commandes utiles
# Démarrer Bitcoin Core
sudo docker compose up -d bitcoin
# Attendre la synchronisation Bitcoin
echo "Attendre la synchronisation Bitcoin (10-30 minutes)..."
docker logs bitcoin-signet | grep "progress"
# Démarrer Blindbit
sudo docker compose up -d blindbit
# Démarrer les relais et le reverse proxy
sudo docker compose up -d sdk_relay_1 sdk_relay_2 sdk_relay_3 reverse_proxy
```
### 3. Vérification du Démarrage
```bash
# Vérifier tous les services
docker ps
# Vérifier les logs
docker-compose logs --tail=50
# Vérifier la connectivité
./test_final_sync.sh
```
## 🔧 Opérations Quotidiennes
### 1. Surveillance des Services
```bash
# Statut des services
docker ps
# Logs en temps réel
docker-compose logs -f
# Utilisation des ressources
docker stats
# Espace disque
docker system df
```
### 2. Monitoring de la Synchronisation
```bash
# Surveillance de la synchronisation
./monitor_sync.sh
# Test de synchronisation
./test_sync_logs.sh
# Test des messages WebSocket
python3 test_websocket_messages.py
```
### 3. Gestion des Logs
```bash
# Logs de tous les services
docker-compose logs -f
# Logs d'un service spécifique
docker logs bitcoin-signet
docker logs blindbit-oracle
docker logs sdk_relay_1
# Logs avec timestamps
docker-compose logs -t
# Logs depuis une date
docker-compose logs --since="2024-01-01T00:00:00"
# Logs des 100 dernières lignes
docker-compose logs --tail=100
```
## 🌐 Utilisation via reverse proxy
### 1. Configuration des Relais
L'infrastructure utilise 3 relais locaux :
Les accès externes se font via le reverse proxy unique :
- UI : `https://<IP_VM>/`
- API : `https://<IP_VM>/api/`
- WebSocket : `wss://<IP_VM>/ws/`
- Signer WS : `wss://<IP_VM>/signer/ws/`
- Storage : `https://<IP_VM>/storage/`
### 2. Test de Connectivité des Relais
```bash
# Test de connectivité de base
./test_final_sync.sh
# Test de synchronisation
./test_sync_logs.sh
# Test des messages WebSocket
python3 test_websocket_messages.py
# Test de charge
python3 test_websocket_messages.py --load-test
```
### 3. Utilisation de sdk_storage
```bash
# Stocker une valeur (exemple)
curl -k -H 'Content-Type: application/json' \
-X POST https://<IP_VM>/storage/store \
-d '{"key":"<64 hex>","value":"<hex>","ttl":120}'
# Récupérer une valeur
curl -k https://<IP_VM>/storage/retrieve/<64 hex>
```
### 4. Surveillance de la Synchronisation
```bash
# Surveillance en temps réel
./monitor_sync.sh
# Test de synchronisation forcé
./test_sync_logs.sh force
# Test de synchronisation en continu
./test_sync_logs.sh continuous
```
## 🔗 Connexion aux Services
### 1. Bitcoin Core RPC
```bash
# Connexion via curl
curl -u bitcoin:your_password --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getblockchaininfo", "params": []}' -H 'content-type: text/plain;' http://localhost:18443/
# Connexion via bitcoin-cli
docker exec bitcoin-signet bitcoin-cli -signet getblockchaininfo
# Vérifier la synchronisation
docker exec bitcoin-signet bitcoin-cli -signet getblockchaininfo | jq '.verificationprogress'
```
### 2. Blindbit API
```bash
# Test de connectivité
curl -s http://localhost:8000/
# Vérifier le statut
curl -s http://localhost:8000/status
# Obtenir des filtres
curl -s http://localhost:8000/filters
```
### 3. sdk_relay WebSocket
```bash
# Test de connectivité WebSocket
curl -v -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Sec-WebSocket-Key: test" http://localhost:8090/
# Test avec wscat (si installé)
wscat -c ws://localhost:8090
# Test avec Python
python3 test_websocket_messages.py
```
## 🧪 Tests et Validation
### 1. Tests de Base
```bash
# Test de connectivité complet
./test_final_sync.sh
# Test de synchronisation
./test_sync_logs.sh
# Test des messages
./test_messages.sh
# Test des 3 relais
./test_3_relays.sh
```
### 2. Tests de Performance
```bash
# Test de charge WebSocket
for i in {1..10}; do
python3 test_websocket_messages.py &
done
wait
# Test de connectivité multiple
netstat -tlnp | grep -E "(8090|8092|8094)"
# Test de performance
docker stats --no-stream
```
### 3. Tests de Sécurité
```bash
# Vérifier les ports exposés
netstat -tuln | grep -E "(8090|8092|8094)"
# Vérifier les logs d'accès
docker logs sdk_relay_1 | grep -E "(ERROR|WARN)" | tail -20
# Vérifier l'utilisation des ressources
docker stats --no-stream | grep sdk_relay
```
## 🔧 Configuration et Maintenance
### 1. Modification de Configuration
```bash
# Modifier la configuration Bitcoin Core
sudo docker-compose down
nano bitcoin/bitcoin.conf
sudo docker-compose up -d bitcoin
# Modifier la configuration Blindbit
nano blindbit/blindbit.toml
sudo docker-compose restart blindbit
# Modifier la configuration des relais
nano sdk_relay/.conf.docker.relay1
sudo docker-compose restart sdk_relay_1
```
### 2. Redémarrage des Services
```bash
# Redémarrage complet
./restart_4nk_node.sh
# Redémarrage d'un service spécifique
docker-compose restart bitcoin
docker-compose restart blindbit
docker-compose restart sdk_relay_1
# Redémarrage avec reconstruction
docker-compose down
docker-compose build --no-cache
docker-compose up -d
```
### 3. Sauvegarde et Restauration
```bash
# Sauvegarde des données
docker exec bitcoin-signet tar czf /tmp/bitcoin-backup.tar.gz /home/bitcoin/.bitcoin
docker cp bitcoin-signet:/tmp/bitcoin-backup.tar.gz ./backup/
# Sauvegarde des configurations
tar czf config-backup.tar.gz sdk_relay/.conf* external_nodes.conf
# Restauration
docker cp ./backup/bitcoin-backup.tar.gz bitcoin-signet:/tmp/
docker exec bitcoin-signet tar xzf /tmp/bitcoin-backup.tar.gz -C /
```
## 🌐 Gestion des Nœuds Externes
### 1. Ajout de Nœuds Externes
```bash
# Ajouter un nœud externe
./add_external_node.sh add external-relay-1 external-relay-1.example.com:8090
# Lister les nœuds configurés
./add_external_node.sh list
# Tester la connectivité
./add_external_node.sh test external-relay-1
# Supprimer un nœud
./add_external_node.sh remove external-relay-1
```
### 2. Configuration Multi-Sites
```bash
# Site principal
./add_external_node.sh add site-paris-1 paris-relay-1.4nk.net:8090
./add_external_node.sh add site-paris-2 paris-relay-2.4nk.net:8090
# Site secondaire
./add_external_node.sh add site-lyon-1 lyon-relay-1.4nk.net:8090
./add_external_node.sh add site-lyon-2 lyon-relay-2.4nk.net:8090
# Site de backup
./add_external_node.sh add backup-1 backup-relay-1.4nk.net:8090
```
### 3. Test d'Intégration
```bash
# Test d'intégration complet
./test_integration_dev3.sh
# Test de connectivité dev3
python3 test_dev3_simple.py
# Test de connectivité avancé
python3 test_dev3_connectivity.py
```
## 📊 Monitoring et Alertes
### 1. Monitoring de Base
```bash
# Surveillance de la synchronisation
./monitor_sync.sh
# Monitoring en continu
while true; do
echo "=== $(date) ==="
docker stats --no-stream | grep -E "(sdk_relay|bitcoin)"
echo "WebSocket connections:"
netstat -an | grep :8090 | wc -l
sleep 30
done
```
### 2. Monitoring Avancé
```bash
# Script de monitoring complet
cat > monitor_advanced.sh << 'EOF'
#!/bin/bash
while true; do
clear
echo "=== 4NK_node Monitoring ==="
echo "Date: $(date)"
echo ""
echo "Services:"
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
echo ""
echo "Ressources:"
docker stats --no-stream | grep -E "(sdk_relay|bitcoin|blindbit)"
echo ""
echo "Connexions WebSocket:"
netstat -an | grep :8090 | wc -l
echo ""
echo "Espace disque:"
df -h | grep -E "(bitcoin|blindbit)"
echo ""
sleep 60
done
EOF
chmod +x monitor_advanced.sh
./monitor_advanced.sh
```
### 3. Alertes Automatiques
```bash
# Script d'alerte simple
cat > alert_monitor.sh << 'EOF'
#!/bin/bash
# Vérifier Bitcoin Core
if ! docker ps | grep -q "bitcoin-signet.*Up"; then
echo "ALERTE: Bitcoin Core n'est pas en cours d'exécution!"
fi
# Vérifier les relais
for i in {1..3}; do
if ! docker ps | grep -q "sdk_relay_$i.*Up"; then
echo "ALERTE: Relay $i n'est pas en cours d'exécution!"
fi
done
# Vérifier l'espace disque
if [ $(df / | awk 'NR==2 {print $5}' | sed 's/%//') -gt 90 ]; then
echo "ALERTE: Espace disque faible!"
fi
EOF
chmod +x alert_monitor.sh
# Ajouter au cron pour surveillance automatique
echo "*/5 * * * * /path/to/alert_monitor.sh" | crontab -
```
## 🔒 Sécurité
### 1. Vérification de Sécurité
```bash
# Vérifier les ports exposés
netstat -tuln | grep -E "(8090|8092|8094)"
# Vérifier les permissions
ls -la sdk_relay/.conf*
ls -la bitcoin/bitcoin.conf
ls -la blindbit/blindbit.toml
# Vérifier les logs de sécurité
docker logs sdk_relay_1 | grep -E "(ERROR|WARN|SECURITY)" | tail -20
```
### 2. Configuration de Pare-feu
```bash
# Autoriser seulement les ports nécessaires
sudo ufw allow 18443/tcp # Bitcoin Core RPC
sudo ufw allow 8090/tcp # sdk_relay WebSocket
sudo ufw allow 8000/tcp # Blindbit API
sudo ufw enable
# Vérifier les règles
sudo ufw status numbered
```
### 3. Rotation des Logs
```bash
# Configuration de rotation des logs
cat > /etc/logrotate.d/4nk-node << EOF
/var/lib/docker/containers/*/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
copytruncate
}
EOF
```
## 🚨 Dépannage
### 1. Problèmes Courants
#### Service Ne Démarre Pas
```bash
# Vérifier les logs
docker logs <service_name>
# Vérifier la configuration
docker exec <service_name> cat /path/to/config
# Redémarrer le service
docker restart <service_name>
```
#### Problèmes de Connectivité
```bash
# Tester la connectivité réseau
docker exec <service_name> ping <target>
# Vérifier la résolution DNS
docker exec <service_name> nslookup <target>
# Tester les ports
docker exec <service_name> nc -z <target> <port>
```
#### Problèmes de Synchronisation
```bash
# Vérifier les logs de synchronisation
docker logs sdk_relay_1 | grep -E "(Sync|Relay|Mesh)"
# Forcer la synchronisation
docker restart sdk_relay_1 sdk_relay_2 sdk_relay_3
# Vérifier la connectivité entre relais
./test_sync_logs.sh force
```
### 2. Logs de Debug
```bash
# Logs détaillés
docker-compose logs -f --tail=100
# Logs d'un service spécifique
docker logs <service_name> -f
# Logs avec timestamps
docker-compose logs -t
# Logs depuis une date
docker-compose logs --since="2024-01-01T00:00:00"
```
### 3. Outils de Debug
```bash
# Debug du container sdk_relay
./sdk_relay/debug_container.sh
# Test du healthcheck
./sdk_relay/test_healthcheck.sh
# Test de connectivité
./sdk_relay/test_connectivity.sh
# Test simple
./sdk_relay/test_simple.sh
```
## 📈 Performance
### 1. Optimisation
```bash
# Limiter l'utilisation CPU
docker-compose up -d --scale bitcoin=1
# Optimiser la mémoire
docker stats --no-stream | grep sdk_relay
# Nettoyer l'espace disque
docker system prune -f
```
### 2. Monitoring de Performance
```bash
# Surveillance des ressources
docker stats
# Surveillance des connexions
netstat -an | grep :8090 | wc -l
# Surveillance de l'espace disque
df -h
```
### 3. Tests de Charge
```bash
# Test de charge simple
for i in {1..50}; do
python3 test_websocket_messages.py &
sleep 0.1
done
wait
# Test de charge avancé
python3 test_websocket_messages.py --load-test --duration=300
```
## 🔄 Maintenance
### 1. Sauvegarde Régulière
```bash
# Script de sauvegarde automatique
cat > backup_4nk.sh << 'EOF'
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/backup/4nk_node_$DATE"
mkdir -p $BACKUP_DIR
# Sauvegarder les configurations
cp -r sdk_relay/.conf* $BACKUP_DIR/
cp external_nodes.conf $BACKUP_DIR/
# Sauvegarder les données Bitcoin
docker exec bitcoin-signet tar czf /tmp/bitcoin-backup.tar.gz /home/bitcoin/.bitcoin
docker cp bitcoin-signet:/tmp/bitcoin-backup.tar.gz $BACKUP_DIR/
echo "Sauvegarde terminée: $BACKUP_DIR"
EOF
chmod +x backup_4nk.sh
```
### 2. Mise à Jour
```bash
# Mise à jour de l'infrastructure
git pull origin main
./restart_4nk_node.sh
# Mise à jour des images
docker-compose build --no-cache
docker-compose up -d
```
### 3. Nettoyage
```bash
# Nettoyer les conteneurs arrêtés
docker container prune -f
# Nettoyer les images non utilisées
docker image prune -f
# Nettoyer les volumes non utilisés
docker volume prune -f
# Nettoyer tout
docker system prune -a -f
```
## 📝 Checklist Quotidienne
- [ ] Services démarrés et fonctionnels
- [ ] Bitcoin Core synchronisé
- [ ] Relais connectés et synchronisés
- [ ] Tests de connectivité passés
- [ ] Logs vérifiés (pas d'erreurs critiques)
- [ ] Ressources système OK
- [ ] Sauvegarde effectuée (si nécessaire)
- [ ] Monitoring actif
## 🎯 Commandes Rapides
```bash
# Démarrage rapide
./restart_4nk_node.sh
# Statut des services
docker ps
# Logs en temps réel
docker-compose logs -f
# Test de connectivité
./test_final_sync.sh
# Surveillance
./monitor_sync.sh
# Arrêt propre
docker-compose down
```
---
**✨ Infrastructure 4NK_node - Utilisation optimale !**
- Mettre à jour les images: `docker compose pull`
- Voir les logs Nginx: `tail -f log/nginx/4nk_node.access.log`
- Voir les logs des services (montés): `tail -f modules/<service>/logs/*`
- Logs Promtail/Loki/Grafana: voir `log/` et `log-monitoring.yml`
## Dépannage
- Vérifier les hostnames Docker internes (DNS du réseau `4nk_network`): voir `docker-compose.yml`
- Les tags `:dev` sont en cours de création; en cas dindisponibilité, utiliser des tags stables temporaires
- Conf Tor: `modules/tor/conf/tor.conf` est montée si l'image Tor supporte `/etc/tor/torrc`
- Le reverse proxy Nginx sappuie sur les hostnames Docker (`*.4nk.local`); en cas de changement dIP/hostnames, mettre à jour `docker-compose.yml` et relancer `nginx`.

253
docs/nginx-host-setup.md Normal file
View File

@ -0,0 +1,253 @@
# Configuration Nginx sur l'hôte Debian pour 4NK_node
## Vue d'ensemble
Cette configuration installe Nginx directement sur l'hôte Debian pour servir de reverse proxy vers tous les services Docker 4NK_node. Cela permet d'avoir un point d'entrée unique et une meilleure gestion des accès.
## Architecture
```
Internet/Client → Nginx (hôte:80) → Services Docker 4NK_node
```
## Services exposés via Nginx
| Route | Service | Port Docker | Description |
|-------|---------|-------------|-------------|
| `/` | IHM Client Web | 3003 | Interface principale React |
| `/bitcoin/rpc/` | Bitcoin Core | 38332 | API JSON-RPC Bitcoin |
| `/bitcoin/p2p/` | Bitcoin Core | 38333 | Port P2P Bitcoin |
| `/blindbit/` | BlindBit | 8000 | API BlindBit |
| `/storage/` | SDK Storage | 8081 | API de stockage |
| `/relay1/` | SDK Relay 1 | 8090 | API Relay 1 |
| `/relay2/` | SDK Relay 2 | 8092 | API Relay 2 |
| `/relay3/` | SDK Relay 3 | 8094 | API Relay 3 |
| `/signer/` | SDK Signer | 9090 | API de signature |
| `/ihm/` | IHM Client | 3003 | Interface web |
| `/ihm-http/` | IHM Client | 8080 | Interface HTTP |
| `/grafana/` | Grafana | 3000 | Dashboard de monitoring |
| `/loki/` | Loki | 3100 | API de logs |
## Installation
### Prérequis
- Debian avec accès root/sudo
- Services Docker 4NK_node démarrés
- Port 80 disponible
### Installation automatique
```bash
cd 4NK_dev/4NK_node/conf
sudo ./install-nginx-host.sh
```
### Installation manuelle
1. **Installer Nginx**
```bash
sudo apt update
sudo apt install -y nginx
```
2. **Configurer les logs**
```bash
sudo mkdir -p /var/log/nginx/4nk-node
sudo chown www-data:www-data /var/log/nginx/4nk-node
```
3. **Installer la configuration**
```bash
sudo cp nginx.conf /etc/nginx/nginx.conf
sudo nginx -t
sudo systemctl restart nginx
sudo systemctl enable nginx
```
## Configuration
### Fichier principal
- **Fichier**: `conf/nginx.conf`
- **Emplacement système**: `/etc/nginx/nginx.conf`
### Caractéristiques
- **Rate limiting**: 10 req/s pour les APIs, 1 req/s pour les connexions
- **Gzip compression**: Optimisé pour les réponses HTTP
- **Security headers**: Protection XSS, CSRF, etc.
- **WebSocket support**: Pour les services temps réel
- **Health check**: Endpoint `/health` pour la surveillance
### Logs
- **Accès**: `/var/log/nginx/4nk-node-access.log`
- **Erreurs**: `/var/log/nginx/4nk-node-error.log`
- **Format**: Logs détaillés avec upstream information
## Utilisation
### Test de connectivité
```bash
# Test du health check
curl http://localhost/health
# Test Bitcoin RPC
curl -X POST http://localhost/bitcoin/rpc/ \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "1.0", "id": "test", "method": "getblockchaininfo", "params": []}'
# Test BlindBit
curl http://localhost/blindbit/health
```
### Monitoring
```bash
# Statut du service
sudo systemctl status nginx
# Logs en temps réel
sudo tail -f /var/log/nginx/4nk-node-access.log
# Logs d'erreurs
sudo tail -f /var/log/nginx/4nk-node-error.log
```
## Sécurité
### Headers de sécurité
- `X-Frame-Options: SAMEORIGIN`
- `X-XSS-Protection: 1; mode=block`
- `X-Content-Type-Options: nosniff`
- `Referrer-Policy: no-referrer-when-downgrade`
- `Content-Security-Policy: default-src 'self' http: https: data: blob: 'unsafe-inline'`
### Rate Limiting
- **APIs**: 10 requêtes par seconde avec burst de 20
- **Connexions**: 1 requête par seconde avec burst de 5
### Accès réseau
- **Écoute**: Port 80 sur toutes les interfaces
- **Upstream**: Connexions locales vers les ports Docker exposés
## Dépannage
### Problèmes courants
1. **Port 80 déjà utilisé**
```bash
sudo netstat -tlnp | grep :80
sudo systemctl stop apache2 # Si Apache est installé
```
2. **Configuration invalide**
```bash
sudo nginx -t
sudo nginx -T | grep -A 10 -B 10 "error"
```
3. **Permissions de logs**
```bash
sudo chown -R www-data:www-data /var/log/nginx/4nk-node
sudo chmod 755 /var/log/nginx/4nk-node
```
4. **Services Docker non accessibles**
```bash
# Vérifier que les services écoutent
sudo netstat -tlnp | grep -E "(38332|8000|8081|8090|9090|3003)"
# Vérifier les conteneurs Docker
docker ps
```
### Logs de débogage
```bash
# Activer le mode debug temporairement
sudo nginx -g "error_log /var/log/nginx/debug.log debug;"
# Redémarrer et vérifier
sudo systemctl restart nginx
sudo tail -f /var/log/nginx/debug.log
```
## Maintenance
### Mise à jour de la configuration
```bash
# Sauvegarder l'ancienne
sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup.$(date +%Y%m%d_%H%M%S)
# Installer la nouvelle
sudo cp nginx.conf /etc/nginx/nginx.conf
# Tester et redémarrer
sudo nginx -t && sudo systemctl reload nginx
```
### Rotation des logs
```bash
# Créer un script de rotation personnalisé
sudo tee /etc/logrotate.d/4nk-node-nginx << EOF
/var/log/nginx/4nk-node-*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 644 www-data www-data
postrotate
systemctl reload nginx
endscript
}
EOF
```
## Intégration avec le monitoring
### Grafana
- **URL**: `http://localhost/grafana/`
- **Datasource**: Loki configuré automatiquement
- **Dashboard**: 4NK Node Overview disponible
### Loki
- **URL**: `http://localhost/loki/`
- **Logs Nginx**: Intégrés via Promtail
- **Requêtes**: LogQL pour analyser les accès
## Support et développement
### Ajout de nouveaux services
1. Ajouter l'upstream dans la section `upstream`
2. Créer la location block correspondante
3. Tester la configuration : `sudo nginx -t`
4. Recharger : `sudo systemctl reload nginx`
### Configuration HTTPS
1. Obtenir les certificats SSL
2. Décommenter la section HTTPS dans `nginx.conf`
3. Configurer les chemins des certificats
4. Redémarrer Nginx
### Performance
- **Worker processes**: Auto-détection du nombre de CPU
- **Keepalive**: 32 connexions par upstream
- **Buffer sizes**: Optimisés pour les APIs
- **Timeouts**: 30s pour les APIs lentes (Bitcoin, BlindBit)

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

View File

@ -1,34 +0,0 @@
document.querySelectorAll('.tab').forEach(tab => {
tab.addEventListener('click', () => {
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
tab.classList.add('active');
document.querySelectorAll('.tab-content').forEach(content => content.classList.remove('active'));
document.getElementById(tab.getAttribute('data-tab')).classList.add('active');
});
});
function toggleMenu() {
var menu = document.getElementById('menu');
if (menu.style.display === 'block') {
menu.style.display = 'none';
} else {
menu.style.display = 'block';
}
}
//// Modal
function openModal() {
document.getElementById('modal').style.display = 'flex';
}
function closeModal() {
document.getElementById('modal').style.display = 'none';
}
// Close modal when clicking outside of it
window.onclick = function(event) {
const modal = document.getElementById('modal');
if (event.target === modal) {
closeModal();
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -1,6 +0,0 @@
function getCorrectDOM(componentTag) {
const dom = document?.querySelector(componentTag)?.shadowRoot || document;
return dom;
}
export { getCorrectDOM as g };

File diff suppressed because one or more lines are too long

View File

@ -1,13 +0,0 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>4NK UI</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<div id="app"></div>
<script type="module" src="/index.js"></script>
</body>
</html>

View File

@ -1 +0,0 @@
export { D as Database, M as MessageType, S as Services } from './index-C1Gp83RD.mjs';

View File

@ -1,14 +0,0 @@
import { S as Services } from './index-C1Gp83RD.mjs';
import { g as getCorrectDOM } from './document.utils-SxcZpxzG.mjs';
async function initProcessElement(id, zone) {
await getProcesses();
getCorrectDOM("process-4nk-component");
}
async function getProcesses() {
const service = await Services.getInstance();
const processes = await service.getProcesses();
return processes;
}
export { initProcessElement };

View File

@ -1,100 +0,0 @@
const createWorker=()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,
this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
function ca(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let e=0;e<b;e++){let f=a.readBits(8);c.push(f)}try{d+=decodeURIComponent(c.map(e=>\`%\${("0"+e.toString(16)).substr(-2)}\`).join(""))}catch(e){}return{bytes:c,text:d}}
function da(a,b){a=new ba(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===D.Terminator)return b;if(d===D.ECI)0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(7)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:B.ECI,assignmentNumber:-1});else if(d===D.Numeric){var e=a,f=[];d="";for(var g=
e.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),m=Math.floor(h/10)%10;h%=10;f.push(48+k,48+m,48+h);d+=k.toString()+m.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);if(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;f.push(48+e,48+g);d+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");f.push(48+e);d+=e.toString()}b.text+=
d;b.bytes.push(...f);b.chunks.push({type:B.Numeric,text:d})}else if(d===D.Alphanumeric){e=a;f=[];d="";for(g=e.readBits([9,11,13][c]);2<=g;)m=e.readBits(11),k=Math.floor(m/45),m%=45,f.push(F[k].charCodeAt(0),F[m].charCodeAt(0)),d+=F[k]+F[m],g-=2;1===g&&(e=e.readBits(6),f.push(F[e].charCodeAt(0)),d+=F[e]);b.text+=d;b.bytes.push(...f);b.chunks.push({type:B.Alphanumeric,text:d})}else if(d===D.Byte)d=ca(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:B.Byte,bytes:d.bytes,text:d.text});
else if(d===D.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));b.text+=f;b.bytes.push(...d);b.chunks.push({type:B.Kanji,bytes:d,text:f})}else d===D.StructuredAppend&&b.chunks.push({type:B.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}
class G{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;
if(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new G(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);for(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new G(this.field,c)}multiplyPoly(a){if(this.isZero()||
a.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let f=0;f<c;f++){let g=b[f];for(let h=0;h<d;h++)e[f+h]=H(e[f+h],this.field.multiply(g,a[h]))}return new G(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;let c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new G(this.field,
a)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(d=>{b^=d}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=H(this.field.multiply(a,b),this.coefficients[d]);return b}}function H(a,b){return a^b}
class ea{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);this.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new G(this,Uint8ClampedArray.from([0]));this.one=new G(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===
a)throw Error("Can't invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,b){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new G(this,a)}log(a){if(0===a)throw Error("Can't take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}
function fa(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let h=e;b=c;e=f;if(b.isZero())return null;c=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let k=c.degree()-b.degree(),m=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(k,m));c=c.addOrSubtract(b.multiplyByMonomial(k,m))}f=f.multiplyPoly(e).addOrSubtract(h);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);
if(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}
function ha(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new ea(285,256,0);var d=new G(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new G(a,e);d=fa(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;e=d[1];
f=b.length;d=Array(f);for(g=0;g<f;g++){h=a.inverse(b[g]);let k=1;for(let m=0;m<f;m++)g!==m&&(k=a.multiply(k,H(1,a.multiply(b[m],h))));d[g]=a.multiply(e.evaluateAt(h),a.inverse(k));0!==a.generatorBase&&(d[g]=a.multiply(d[g],h))}for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}
let I=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,
dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,
ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},
{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,
34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,
ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},
{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},
{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,
dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,
dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},
{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},
{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},
{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,
ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,
74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,
versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,
dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,
dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},
{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},
{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},
{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},
{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},
{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,
ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,
dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,
dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},
{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},
{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,
ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,
26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},
{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},
{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,
dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},
{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,
dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},
{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,
dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},
{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,
dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],
errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,
versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},
{numBlocks:61,dataCodewordsPerBlock:16}]}]}];function J(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function K(a,b){return b<<1|a}
let ia=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,
dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,
formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,
dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],ja=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%
2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2];
function ka(a,b,c){c=ja[c.dataMask];let d=a.height;var e=17+4*b.versionNumber;let f=x.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===g&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=[];h=g=0;e=!0;for(let k=d-1;0<k;k-=2){6===
k&&k--;for(let m=0;m<d;m++){let l=e?d-1-m:m;for(let n=0;2>n;n++){let q=k-n;if(!f.get(q,l)){h++;let r=a.get(q,l);c({y:l,x:q})&&(r=!r);g=g<<1|r;8===h&&(b.push(g),g=h=0)}}}e=!e}return b}
function la(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return I[c-1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=K(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let g=b-9;g>=b-11;g--)d=K(a.get(e,g),d);a=Infinity;let f;for(let g of I){if(g.infoBits===c||g.infoBits===d)return g;b=J(c,g.infoBits);b<a&&(f=g,a=b);b=J(d,g.infoBits);b<a&&(f=g,a=b)}if(3>=a)return f}
function ma(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=K(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=K(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=K(a.get(8,e),c);for(e=d-8;e<d;e++)c=K(a.get(e,8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of ia){if(f===b||f===c)return g;e=J(b,f);e<a&&(d=g,a=e);b!==c&&(e=J(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}
function na(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(h=>{for(let k=0;k<h.numBlocks;k++)e.push({numDataCodewords:h.dataCodewordsPerBlock,codewords:[]}),f+=h.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());if(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let h of e)h.codewords.push(a.shift());
return e}function L(a){let b=la(a);if(!b)return null;var c=ma(a);if(!c)return null;a=ka(a,b,c);var d=na(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((e,f)=>e+f.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let e of d){d=ha(e.codewords,e.codewords.length-e.numDataCodewords);if(!d)return null;for(let f=0;f<e.numDataCodewords;f++)c[a++]=d[f]}try{return da(c,b.versionNumber)}catch(e){return null}}
function M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};let g=b.x-c.x;var h=d.x-c.x;let k=b.y-c.y,m=d.y-c.y;c=g*m-h*k;h=(e*m-h*f)/c;e=(g*f-e*k)/c;return{a11:b.x-a.x+h*b.x,a12:b.y-a.y+h*b.y,a13:h,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}
function oa(a,b,c,d){a=M(a,b,c,d);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}
function pa(a,b){var c=oa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+d.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,m=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,l=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,n=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,q=d.a13*
c.a31+d.a23*c.a32+d.a33*c.a33;c=x.createEmpty(b.dimension,b.dimension);d=(r,u)=>{const p=g*r+m*u+q;return{x:(e*r+h*u+l)/p,y:(f*r+k*u+n)/p}};for(let r=0;r<b.dimension;r++)for(let u=0;u<b.dimension;u++){let p=d(u+.5,r+.5);c.set(u,r,a.get(Math.floor(p.x),Math.floor(p.y)))}return{matrix:c,mappingFunction:d}}let N=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2));function O(a){return a.reduce((b,c)=>b+c)}
function qa(a,b,c){let d=N(a,b),e=N(b,c),f=N(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}
function ra(a,b,c,d){d=(O(P(a,c,d,5))/7+O(P(a,b,d,5))/7+O(P(c,a,d,5))/7+O(P(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(N(a,b)/d);a=Math.round(N(a,c)/d);a=Math.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}
function Q(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),m=Math.abs(b-h),l=Math.floor(-k/2),n=g<a?1:-1,q=h<b?1:-1,r=!0;for(let u=g,p=h;u!==a+n;u+=n){g=f?p:u;h=f?u:p;if(c.get(g,h)!==r&&(r=!r,e.push({x:g,y:h}),e.length===d+1))break;l+=m;if(0<l){if(p===b)break;p+=q;l-=k}}c=
[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(N(e[f],e[f+1])):c.push(0);return c}function P(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=Q(a,b,c,Math.ceil(d/2));a=Q(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function R(a,b){let c=O(a)/O(b),d=0;b.forEach((e,f)=>{d+=Math.pow(a[f]-e*c,2)});return{averageSize:c,error:d}}
function S(a,b,c){try{let d=P(a,{x:-1,y:a.y},c,b.length),e=P(a,{x:a.x,y:-1},c,b.length),f=P(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=P(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=R(d,b),k=R(e,b),m=R(f,b),l=R(g,b),n=(h.averageSize+k.averageSize+m.averageSize+l.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+m.error*m.error+l.error*l.error)+(Math.pow(h.averageSize-n,2)+Math.pow(k.averageSize-n,2)+Math.pow(m.averageSize-n,2)+
Math.pow(l.averageSize-n,2))/n}catch(d){return Infinity}}function T(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}
function sa(a){var b=[],c=[];let d=[];var e=[];for(let p=0;p<=a.height;p++){var f=0,g=!1;let t=[0,0,0,0,0];for(let v=-1;v<=a.width;v++){var h=a.get(v,p);if(h===g)f++;else{t=[t[1],t[2],t[3],t[4],f];f=1;g=h;var k=O(t)/7;k=Math.abs(t[0]-k)<k&&Math.abs(t[1]-k)<k&&Math.abs(t[2]-3*k)<3*k&&Math.abs(t[3]-k)<k&&Math.abs(t[4]-k)<k&&!h;var m=O(t.slice(-3))/3;h=Math.abs(t[2]-m)<m&&Math.abs(t[3]-m)<m&&Math.abs(t[4]-m)<m&&h;if(k){let z=v-t[3]-t[4],y=z-t[2];k={startX:y,endX:z,y:p};m=c.filter(w=>y>=w.bottom.startX&&
y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<m.length?m[0].bottom=k:c.push({top:k,bottom:k})}if(h){let z=v-t[4],y=z-t[3];h={startX:y,y:p,endX:z};k=e.filter(w=>y>=w.bottom.startX&&y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<k.length?
k[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(v=>v.bottom.y!==p&&2<=v.bottom.y-v.top.y));c=c.filter(v=>v.bottom.y===p);d.push(...e.filter(v=>v.bottom.y!==p));e=e.filter(v=>v.bottom.y===p)}b.push(...c.filter(p=>2<=p.bottom.y-p.top.y));d.push(...e);c=[];for(var l of b)2>l.bottom.y-l.top.y||(b=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4,e=(l.top.y+l.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[l.top.endX-l.top.startX,l.bottom.endX-l.bottom.startX,l.bottom.y-l.top.y+
1],f=O(f)/f.length,g=S({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((p,t)=>p.score-t.score);l=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var n of c)n!==e&&f.push(Object.assign(Object.assign({},n),{score:n.score+Math.pow(n.size-e.size,2)/e.size}));f.sort((p,t)=>p.score-t.score);l.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}l.sort((p,t)=>p.score-t.score);let {topRight:q,topLeft:r,bottomLeft:u}=qa(...l[0].points);
l=U(a,d,q,r,u);n=[];l&&n.push({alignmentPattern:{x:l.alignmentPattern.x,y:l.alignmentPattern.y},bottomLeft:{x:u.x,y:u.y},dimension:l.dimension,topLeft:{x:r.x,y:r.y},topRight:{x:q.x,y:q.y}});l=T(a,q);b=T(a,r);c=T(a,u);(a=U(a,d,l,b,c))&&n.push({alignmentPattern:{x:a.alignmentPattern.x,y:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:l.x,y:l.y},dimension:a.dimension});return 0===n.length?null:n}
function U(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ra(d,c,e,a))}catch(l){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(N(d,e)+N(d,c))/2/g;e=1-3/c;let m={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(l=>{const n=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4;l=(l.top.y+l.bottom.y+1)/2;if(a.get(Math.floor(n),Math.floor(l))){var q=S({x:Math.floor(n),y:Math.floor(l)},[1,1,1],a)+N({x:n,y:l},m);return{x:n,y:l,score:q}}}).filter(l=>!!l).sort((l,n)=>l.score-n.score);return{alignmentPattern:15<=
c&&b.length?b[0]:m,dimension:f}}
function V(a){var b=sa(a);if(!b)return null;for(let e of b){b=pa(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let f=d+1;f<c.height;f++)c.get(d,f)!==c.get(f,d)&&(c.set(d,f,!c.get(d,f)),c.set(f,d,!c.get(f,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,location:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,
e.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}let ta={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},canOverwriteImage:!0};function W(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}
function X(a,b,c,d={}){let e=Object.create(null);W(e,ta);W(e,d);d="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var m=0;if(h){var l=new Uint8ClampedArray(a.buffer,m,k);m+=k}l=new A(b,c,l);if(g.useIntegerApproximation)for(var n=0;n<c;n++)for(var q=0;q<b;q++){var r=4*(n*b+q);l.set(q,n,g.red*a[r]+g.green*a[r+1]+
g.blue*a[r+2]+128>>8)}else for(n=0;n<c;n++)for(q=0;q<b;q++)r=4*(n*b+q),l.set(q,n,g.red*a[r]+g.green*a[r+1]+g.blue*a[r+2]);g=Math.ceil(b/8);n=Math.ceil(c/8);q=g*n;if(h){var u=new Uint8ClampedArray(a.buffer,m,q);m+=q}u=new A(g,n,u);for(q=0;q<n;q++)for(r=0;r<g;r++){var p=Infinity,t=0;for(var v=0;8>v;v++)for(let w=0;8>w;w++){let aa=l.get(8*r+w,8*q+v);p=Math.min(p,aa);t=Math.max(t,aa)}v=(p+t)/2;v=Math.min(255,1.11*v);24>=t-p&&(v=p/2,0<q&&0<r&&(t=(u.get(r,q-1)+2*u.get(r-1,q)+u.get(r-1,q-1))/4,p<t&&(v=t)));
u.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.createEmpty(b,c);r=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,m,k),r=new x(a,b)):r=x.createEmpty(b,c));for(b=0;b<n;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=n-3;h=2>b?2:b>h?h:b;k=0;for(m=-2;2>=m;m++)for(p=-2;2>=p;p++)k+=u.get(c+m,h+p);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)m=8*a+h,p=8*b+k,t=l.get(m,p),q.set(m,p,t<=c),f&&r.set(m,p,!(t<=c))}f=f?{binarized:q,inverted:r}:{binarized:q};let {binarized:z,inverted:y}=f;(f=V(d?
y:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};
self.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;
break;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}
`]),{type:"application/javascript"}));
export { createWorker };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,877 +0,0 @@
:root {
--primary-color
: #3A506B;
/* Bleu métallique */
--secondary-color
: #B0BEC5;
/* Gris acier */
--accent-color
: #D68C45;
/* Cuivre */
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
background-image: url(../assets/bgd.webp);
background-repeat:no-repeat;
background-size: cover;
background-blend-mode :soft-light;
height: 100vh;
}
.message {
margin: 30px 0;
font-size: 14px;
overflow-wrap: anywhere;
}
.message strong{
font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
font-size: 20px;
}
/** Modal Css */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
justify-content: center;
align-items: center;
z-index: 3;
}
.modal-content {
width: 55%;
height: 30%;
background-color: white;
border-radius: 4px;
padding: 20px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}
.modal-title {
margin: 0;
padding-bottom: 8px;
width: 100%;
font-size: 0.9em;
border-bottom: 1px solid #ccc;
}
.confirmation-box {
/* margin-top: 20px; */
align-content: center;
width: 70%;
height: 20%;
/* padding: 20px; */
font-size: 1.5em;
color: #333333;
top: 5%;
position: relative;
}
/* Confirmation Modal Styles */
#confirmation-modal {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
z-index: 1000;
}
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
}
.modal-content {
background: white;
padding: 20px;
border-radius: 8px;
width: 90%;
max-width: 500px;
max-height: 80vh;
overflow-y: auto;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.modal-confirmation {
text-align: left;
padding: 10px;
}
.modal-confirmation h3 {
margin-bottom: 15px;
color: var(--primary-color);
font-size: 1.1em;
}
.modal-confirmation p {
margin: 8px 0;
font-size: 0.9em;
line-height: 1.4;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid #eee;
}
.modal-footer button {
padding: 8px 16px;
border-radius: 4px;
border: none;
cursor: pointer;
font-size: 0.9em;
}
.btn-primary {
background: var(--primary-color);
color: white;
}
.btn-secondary {
background: var(--secondary-color);
color: white;
}
/* Responsive adjustments */
@media only screen and (max-width: 600px) {
.modal-content {
width: 95%;
margin: 10px;
padding: 15px;
}
.modal-confirmation h3 {
font-size: 1em;
}
.modal-confirmation p {
font-size: 0.85em;
}
}
.nav-wrapper {
position: fixed;
z-index: 2;
background: radial-gradient(circle, white, var(--primary-color));
/* background-color: #CFD8DC; */
display: flex;
justify-content: flex-end;
align-items: center;
color: #37474F;
height: 9vh;
width: 100vw;
left: 0;
top: 0;
box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, .2), 0px 16px 24px 2px rgba(0, 0, 0, .14), 0px 6px 30px 5px rgba(0, 0, 0, .12);
.nav-right-icons {
display: flex;
.notification-container {
position: relative;
display: inline-block;
}
.notification-bell, .burger-menu {
z-index: 3;
height: 20px;
width: 20px;
margin-right: 1rem;
}
.notification-badge {
position: absolute;
top: -.7rem;
left: -.8rem;
background-color: red;
color: white;
border-radius: 50%;
padding: 2.5px 6px;
font-size: 0.8em;
font-weight: bold;
}
}
.notification-board {
position: absolute;
width: 20rem;
min-height: 8rem;
background-color: white;
right: 0.5rem;
display: none;
border-radius: 4px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
display: none;
.notification-element {
padding: .8rem 0;
width: 100%;
&:hover {
background-color: rgba(26, 28, 24, .08);
}
}
.notification-element:not(:last-child) {
border-bottom: 1px solid;
}
}
}
.brand-logo {
height: 100%;
width: 100vw;
align-content: center;
position: relative;
display: flex;
position: absolute;
align-items: center;
justify-content: center;
text-align: center;
font-size: 1.5em;
font-weight: bold;
}
.container {
text-align: center;
display: grid;
height: 100vh;
grid-template-columns: repeat(7, 1fr);
gap: 10px;
grid-auto-rows: 10vh 15vh 1fr;
}
.title-container {
grid-column: 2 / 7;
grid-row: 2;
}
.page-container {
grid-column: 2 / 7;
grid-row: 3 ;
justify-content: center;
display: flex;
padding: 1rem;
box-sizing: border-box;
max-height: 60vh;
}
h1 {
font-size: 2em;
margin: 20px 0;
}
@media only screen and (min-width: 600px) {
.tab-container {
display: none;
}
.page-container {
display: flex;
align-items: center;
}
.process-container {
grid-column: 3 / 6;
grid-row: 3 ;
.card {
min-width: 40vw;
}
}
.separator {
width: 2px;
background-color: #78909C;
height: 80%;
margin: 0 0.5em;
}
.tab-content {
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
height: 80%;
}
}
@media only screen and (max-width: 600px) {
.process-container {
grid-column: 2 / 7;
grid-row: 3 ;
}
.container {
grid-auto-rows: 10vh 15vh 15vh 1fr;
}
.tab-container {
grid-column: 1 / 8;
grid-row: 3;
}
.page-container {
grid-column: 2 / 7;
grid-row: 4 ;
}
.separator {
display: none;
}
.tabs {
display: flex;
flex-grow: 1;
overflow: hidden;
z-index: 1;
border-bottom-style: solid;
border-bottom-width: 1px;
border-bottom-color: #E0E4D6;
}
.tab {
flex: 1;
text-align: center;
padding: 10px 0;
cursor: pointer;
font-size: 1em;
color: #6200ea;
&:hover {
background-color: rgba(26, 28, 24, .08);
}
}
.tab.active {
border-bottom: 2px solid #6200ea;
font-weight: bold;
}
.card.tab-content {
display: none;
}
.tab-content.active {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 80%;
}
.modal-content {
width: 80%;
height: 20%;
}
}
.qr-code {
display: flex;
justify-content: center;
align-items: center;
height: 200px;
}
.emoji-display {
font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
font-size: 20px;
}
#emoji-display-2{
margin-top: 30px;
font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
font-size: 20px;
}
#okButton{
margin-bottom: 2em;
cursor: pointer;
background-color: #D0D0D7;
color: white;
border-style: none;
border-radius: 5px;
color: #000;
padding: 2px;
margin-top: 10px;
}
.pairing-request {
font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
font-size: 14px;
margin-top: 0px;
}
.sp-address-btn {
margin-bottom: 2em;
cursor: pointer;
background-color: #D0D0D7;
color: white;
border-style: none;
border-radius: 5px;
color: #000;
padding: 2px;
}
.camera-card {
display: flex;
justify-content: center;
align-items: center;
/* height: 200px; */
}
.btn {
display: inline-block;
padding: 10px 20px;
background-color: var(--primary-color);
color: white;
text-align: center;
border-radius: 5px;
cursor: pointer;
text-decoration: none;
}
.btn:hover {
background-color: #3700b3;
}
.card {
min-width: 300px;
border: 1px solid #e0e0e0;
border-radius: 8px;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
box-sizing: border-box;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
height: 60vh;
justify-content: flex-start;
padding: 1rem;
overflow-y: auto;
}
.card-content {
flex-grow: 1;
flex-direction: column;
display: flex;
justify-content: flex-start;
align-items: center;
text-align: left;
font-size: .8em;
position: relative;
left: 2vw;
width: 90%;
.process-title {
font-weight: bold;
padding: 1rem 0;
}
.process-element {
padding: .4rem 0;
&:hover {
background-color: rgba(26, 28, 24, .08);
}
&.selected {
background-color: rgba(26, 28, 24, .08);
}
}
}
.card-description {
padding: 20px;
font-size: 1em;
color: #333;
width: 90%;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 0px;
}
.card-action {
width: 100%;
}
.menu-content {
display: none;
position: absolute;
top: 3.4rem;
right: 1rem;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 5px;
overflow: hidden;
}
.menu-content a {
display: block;
padding: 10px 20px;
text-decoration: none;
color: #333;
border-bottom: 1px solid #e0e0e0;
&:hover {
background-color: rgba(26, 28, 24, .08);
}
}
.menu-content a:last-child {
border-bottom: none;
}
.qr-code-scanner {
display: none;
}
/* QR READER */
#qr-reader div {
position: inherit;
}
#qr-reader div img{
top: 15px ;
right: 25px;
margin-top: 5px;
}
/* INPUT CSS **/
.input-container {
position: relative;
width: 100%;
background-color: #ECEFF1;
}
.input-field {
width: 36vw;
padding: 10px 0;
font-size: 1em;
border: none;
border-bottom: 1px solid #ccc;
outline: none;
background: transparent;
transition: border-color 0.3s;
}
.input-field:focus {
border-bottom: 2px solid #6200ea;
}
.input-label {
position: absolute;
margin-top: -0.5em;
top: 0;
left: 0;
padding: 10px 0;
font-size: 1em;
color: #999;
pointer-events: none;
transition: transform 0.3s, color 0.3s, font-size 0.3s;
}
.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
transform: translateY(-20px);
font-size: 0.8em;
color: #6200ea;
}
.input-underline {
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 2px;
background-color: #6200ea;
transition: width 0.3s, left 0.3s;
}
.input-field:focus ~ .input-underline {
width: 100%;
left: 0;
}
.dropdown-content {
position: absolute;
flex-direction: column;
top: 100%;
left: 0;
width: 100%;
max-height: 150px;
overflow-y: auto;
border: 1px solid #ccc;
border-radius: 4px;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
display: none;
z-index: 1;
}
.dropdown-content span {
padding: 10px;
cursor: pointer;
list-style: none;
}
.dropdown-content span:hover {
background-color: #f0f0f0;
}
/** AUTOCOMPLETE **/
select[data-multi-select-plugin] {
display: none !important;
}
.multi-select-component {
width: 36vw;
padding: 5px 0;
font-size: 1em;
border: none;
border-bottom: 1px solid #ccc;
outline: none;
background: transparent;
display: flex;
flex-direction: row;
height: auto;
width: 100%;
-o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.autocomplete-list {
border-radius: 4px 0px 0px 4px;
}
.multi-select-component:focus-within {
box-shadow: inset 0px 0px 0px 2px #78ABFE;
}
.multi-select-component .btn-group {
display: none !important;
}
.multiselect-native-select .multiselect-container {
width: 100%;
}
.selected-processes {
background-color: white;
padding: 0.4em;
}
.selected-wrapper {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
display: inline-block;
border: 1px solid #d9d9d9;
background-color: #ededed;
white-space: nowrap;
margin: 1px 5px 5px 0;
height: 22px;
vertical-align: top;
cursor: default;
}
.selected-wrapper .selected-label {
max-width: 514px;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
padding-left: 4px;
vertical-align: top;
}
.selected-wrapper .selected-close {
display: inline-block;
text-decoration: none;
font-size: 14px;
line-height: 1.49em;
margin-left: 5px;
padding-bottom: 10px;
height: 100%;
vertical-align: top;
padding-right: 4px;
opacity: 0.2;
color: #000;
text-shadow: 0 1px 0 #fff;
font-weight: 700;
}
.search-container {
display: flex;
flex-direction: row;
}
.search-container .selected-input {
background: none;
border: 0;
height: 20px;
width: 60px;
padding: 0;
margin-bottom: 6px;
-webkit-box-shadow: none;
box-shadow: none;
}
.search-container .selected-input:focus {
outline: none;
}
.dropdown-icon.active {
transform: rotateX(180deg)
}
.search-container .dropdown-icon {
display: inline-block;
padding: 10px 5px;
position: absolute;
top: 5px;
right: 5px;
width: 10px;
height: 10px;
border: 0 !important;
/* needed */
-webkit-appearance: none;
-moz-appearance: none;
/* SVG background image */
background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Ctitle%3Edown-arrow%3C%2Ftitle%3E%3Cg%20fill%3D%22%23818181%22%3E%3Cpath%20d%3D%22M10.293%2C3.293%2C6%2C7.586%2C1.707%2C3.293A1%2C1%2C0%2C0%2C0%2C.293%2C4.707l5%2C5a1%2C1%2C0%2C0%2C0%2C1.414%2C0l5-5a1%2C1%2C0%2C1%2C0-1.414-1.414Z%22%20fill%3D%22%23818181%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fsvg%3E");
background-position: center;
background-size: 10px;
background-repeat: no-repeat;
}
.search-container ul {
position: absolute;
list-style: none;
padding: 0;
z-index: 3;
margin-top: 29px;
width: 100%;
right: 0px;
background: #fff;
border: 1px solid #ccc;
border-top: none;
border-bottom: none;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.search-container ul :focus {
outline: none;
}
.search-container ul li {
display: block;
text-align: left;
padding: 8px 29px 2px 12px;
border-bottom: 1px solid #ccc;
font-size: 14px;
min-height: 31px;
}
.search-container ul li:first-child {
border-top: 1px solid #ccc;
border-radius: 4px 0px 0 0;
}
.search-container ul li:last-child {
border-radius: 4px 0px 0 0;
}
.search-container ul li:hover.not-cursor {
cursor: default;
}
.search-container ul li:hover {
color: #333;
background-color: #f0f0f0;
;
border-color: #adadad;
cursor: pointer;
}
/* Adding scrool to select options */
.autocomplete-list {
max-height: 130px;
overflow-y: auto;
}
/**************************************** Process page card ******************************************************/
.process-card {
min-width: 300px;
border: 1px solid #e0e0e0;
border-radius: 8px;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
min-height: 40vh;
max-height: 60vh;
justify-content: space-between;
padding: 1rem;
overflow-y: auto;
}
.process-card-content {
text-align: left;
font-size: .8em;
position: relative;
left: 2vw;
width: 90%;
.process-title {
font-weight: bold;
padding: 1rem 0;
}
.process-element {
padding: .4rem 0;
&:hover {
background-color: rgba(26, 28, 24, .08);
}
&.selected {
background-color: rgba(26, 28, 24, .08);
}
}
.selected-process-zone {
background-color: rgba(26, 28, 24, .08);
}
}
.process-card-description {
padding: 20px;
font-size: 1em;
color: #333;
width: 90%;
}
.process-card-action {
width: 100%;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,597 +0,0 @@
/* Styles de base */
:root {
--primary-color: #3A506B;
/* Bleu métallique */
--secondary-color: #B0BEC5;
/* Gris acier */
--accent-color: #D68C45;
/* Cuivre */
}
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
/* 4NK NAVBAR */
.brand-logo {
text-align: center;
font-size: 1.5em;
font-weight: bold;
}
.nav-wrapper {
position: fixed;
background: radial-gradient(circle, white, var(--primary-color));
display: flex;
justify-content: space-between;
align-items: center;
color: #37474F;
height: 9vh;
width: 100vw;
left: 0;
top: 0;
box-shadow: 0px 8px 10px -5px rgba(0, 0, 0, .2), 0px 16px 24px 2px rgba(0, 0, 0, .14), 0px 6px 30px 5px rgba(0, 0, 0, .12);
}
/* Icônes de la barre de navigation */
.nav-right-icons {
display: flex;
}
.notification-bell,
.burger-menu {
height: 20px;
width: 20px;
margin-right: 1rem;
cursor: pointer;
}
.notification-container {
position: relative;
/* Conserve la position pour le notification-board */
display: inline-flex;
align-items: center;
}
.notification-board {
position: absolute;
/* Position absolue pour le placer par rapport au container */
top: 40px;
right: 0;
background-color: white;
border: 1px solid #ccc;
padding: 10px;
width: 200px;
max-height: 300px;
overflow-y: auto;
/* Scroll si les notifications dépassent la taille */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
z-index: 10;
/* Définit la priorité d'affichage au-dessus des autres éléments */
display: none;
/* Par défaut, la notification est masquée */
}
.notification-item{
cursor: pointer;
}
.notification-badge {
position: absolute;
top: -18px;
right: 35px;
background-color: red;
color: white;
border-radius: 50%;
padding: 4px 8px;
font-size: 12px;
display: none;
/* S'affiche seulement lorsqu'il y a des notifications */
z-index: 10;
}
/* Par défaut, le menu est masqué */
#menu {
display: none;
/* Menu caché par défaut */
transition: display 0.3s ease-in-out;
}
.burger-menu {
cursor: pointer;
}
/* Icône burger */
#burger-icon {
cursor: pointer;
}
.menu-content {
display: none;
position: absolute;
top: 3.4rem;
right: 1rem;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 5px;
overflow: hidden;
}
.menu-content a {
display: block;
padding: 10px 20px;
text-decoration: none;
color: #333;
border-bottom: 1px solid #e0e0e0;
&:hover {
background-color: rgba(26, 28, 24, .08);
}
}
.menu-content a:last-child {
border-bottom: none;
}
/* Ajustement pour la barre de navigation fixe */
.container {
display: flex;
flex: 1;
height: 90vh;
margin-top: 9vh;
margin-left: -1%;
text-align: left;
width: 100vw;
}
/* Liste des groupes */
.group-list {
width: 25%;
background-color: #1f2c3d;
color: white;
padding: 20px;
box-sizing: border-box;
overflow-y: auto;
border-right: 2px solid #2c3e50;
flex-shrink: 0;
padding-right: 10px;
height: 91vh;
}
.group-list ul {
cursor: pointer;
list-style: none;
padding: 0;
padding-right: 10px;
margin-left: 20px;
}
.group-list li {
margin-bottom: 20px;
padding: 15px;
border-radius: 8px;
background-color: #273646;
cursor: pointer;
transition: background-color 0.3s, box-shadow 0.3s;
}
.group-list li:hover {
background-color: #34495e;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.group-list .member-container {
position: relative;
}
.group-list .member-container button {
margin-left: 40px;
padding: 5px;
cursor: pointer;
background: var(--primary-color);
color: white;
border: 0px solid var(--primary-color);
border-radius: 50px;
position: absolute;
top: -25px;
right: -25px;
}
.group-list .member-container button:hover {
background: var(--accent-color)
}
/* Zone de chat */
.chat-area {
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
background-color:#f1f1f1;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
margin: 1% 0% 0.5% 1%;
}
/* En-tête du chat */
.chat-header {
background-color: #34495e;
color: white;
padding: 15px;
font-size: 20px;
font-weight: bold;
border-radius: 10px 10px 0 0;
text-align: center;
}
/* Messages */
.messages {
flex: 1;
padding: 20px;
overflow-y: auto;
background-color: #f1f1f1;
border-top: 1px solid #ddd;
}
.message-container {
display: flex;
margin: 8px;
}
.message-container .message {
align-self: flex-start;
}
.message-container .message.user {
align-self: flex-end;
margin-left: auto;
color: white;
}
.message {
max-width: 70%;
padding: 10px;
border-radius: 12px;
background:var(--secondary-color);
margin: 2px 0;
}
/* Messages de l'utilisateur */
.message.user {
background: #2196f3;
color: white;
}
.message-time {
font-size: 0.7em;
opacity: 0.7;
margin-left: 0px;
margin-top: 5px;
}
/* Amélioration de l'esthétique des messages */
/* .message.user:before {
content: '';
position: absolute;
top: 10px;
right: -10px;
border: 10px solid transparent;
border-left-color: #3498db;
} */
/* Zone de saisie */
.input-area {
padding: 10px;
background-color: #bdc3c7;
display: flex;
align-items: center;
border-radius: 10px;
margin: 1%;
/* Alignement vertical */
}
.input-area input[type="text"] {
flex: 1;
/* Prend l'espace restant */
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
.input-area .attachment-icon {
margin: 0 10px;
cursor: pointer;
display: flex;
align-items: center;
}
.input-area button {
padding: 10px;
margin-left: 10px;
background-color: #2980b9;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.input-area button:hover {
background-color: #1f608d;
}
.tabs {
display: flex;
margin: 20px 0px;
gap: 10px;
}
.tabs button {
padding: 10px 20px;
cursor: pointer;
background: var(--primary-color);
color: white;
border: 0px solid var(--primary-color);
margin-right: 5px;
border-radius: 10px;
}
.tabs button:hover {
background: var(--secondary-color);
color: var(--primary-color);
}
/* Signature */
.signature-area {
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
background-color:#f1f1f1;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
margin: 1% 0% 0.5% 1%;
transition: all 1s ease 0.1s;
visibility: visible;
}
.signature-area.hidden {
opacity: 0;
visibility: hidden;
display: none;
pointer-events: none;
}
.signature-header {
display: flex;
align-items: center;
justify-content: center;
background-color: var(--primary-color);
color: white;
border-radius: 10px 10px 0 0;
padding-left: 4%;
}
.signature-content {
padding: 10px;
background-color: var(--secondary-color);
color: var(--primary-color);
height: 100%;
border-radius: 10px;
margin: 1%;
display: flex;
flex-direction: column;
align-items: center;
}
.signature-description {
height: 20%;
width: 100%;
margin: 0% 10% 0% 10%;
overflow: auto;
display: flex;
}
.signature-description li {
margin: 1% 0% 1% 0%;
list-style: none;
padding: 2%;
border-radius: 10px;
background-color: var(--primary-color);
color: var(--secondary-color);
width: 20%;
text-align: center;
cursor: pointer;
font-weight: bold;
margin-right: 2%;
overflow: auto;
}
.signature-description li .member-list {
margin-left: -30%;
}
.signature-description li .member-list li {
width: 100%;
}
.signature-description li .member-list li:hover {
background-color: var(--secondary-color);
color: var(--primary-color);
}
.signature-documents {
height: 80%;
width: 100%;
margin: 0% 10% 0% 10%;
overflow: auto;
display: flex;
}
.signature-documents-header {
display: flex;
width: 100%;
height: 15%;
align-items: center;
}
#request-document-button {
background-color: var(--primary-color);
color: white;
border: none;
border-radius: 10px;
padding: 8px;
cursor: pointer;
margin-left: 5%;
font-weight: bold;
}
#request-document-button:hover {
background-color: var(--accent-color);
font-weight: bold;
}
#close-signature {
cursor: pointer;
align-items: center;
margin-left: auto;
margin-right: 2%;
border-radius: 50%;
background-color: var(--primary-color);
color: white;
border: none;
padding: -3%;
margin-top: -5%;
font-size: 1em;
font-weight: bold;
}
#close-signature:hover {
background-color: var(--secondary-color);
color: var(--primary-color);
}
/* REQUEST MODAL */
.request-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal-content {
background-color: var(--secondary-color);
padding: 20px;
border-radius: 8px;
position: relative;
min-width: 300px;
}
.close-modal {
position: absolute;
top: 10px;
right: 10px;
border: none;
background: none;
font-size: 1.5em;
cursor: pointer;
font-weight: bold;
}
.close-modal:hover {
color: var(--accent-color);
}
.modal-members {
display: flex;
justify-content: space-between;
}
.modal-members ul li{
list-style: none;
}
.file-upload-container {
margin: 10px 0;
}
.file-list {
margin-top: 10px;
}
.file-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 5px;
margin: 5px 0;
background: var(--background-color-secondary);
border-radius: 4px;
}
.remove-file {
background: none;
border: none;
color: var(--text-color);
cursor: pointer;
padding: 0 5px;
}
.remove-file:hover {
color: var(--error-color);
}
#message-input {
width: 100%;
height: 50px;
resize: none;
padding: 10px;
box-sizing: border-box;
overflow: auto;
max-width: 100%;
border-radius: 10px;
}
/* Responsive */
@media screen and (max-width: 768px) {
.group-list {
display: none;
/* Masquer la liste des groupes sur les petits écrans */
}
.chat-area {
margin: 0;
}
}
::-webkit-scrollbar {
width: 5px;
height: 5px;
}
::-webkit-scrollbar-track {
background: var(--primary-color);
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
background: var(--secondary-color);
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--accent-color);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
export declare function unpair(): Promise<void>;
export declare function initHeader(): Promise<void>;

View File

@ -1 +0,0 @@
export declare function closeConfirmationModal(): Promise<void>;

View File

@ -1,10 +0,0 @@
export default class QrScannerComponent extends HTMLElement {
videoElement: any;
wrapper: any;
qrScanner: any;
constructor();
connectedCallback(): void;
initializeScanner(): Promise<void>;
onQrCodeScanned(result: any): Promise<void>;
disconnectedCallback(): void;
}

View File

@ -1 +0,0 @@
export declare function initValidationModal(processDiffs: any): Promise<void>;

View File

@ -1,14 +0,0 @@
export interface ValidationRule {
quorum: number;
fields: string[];
min_sig_member: number;
}
/**
* Loads and injects the modal HTML into the document if not already loaded.
*/
export declare function loadValidationRuleModal(templatePath?: string): Promise<void>;
/**
* Opens the modal and lets the user input a ValidationRule.
* Calls the callback with the constructed rule on submit.
*/
export declare function showValidationRuleModal(onSubmit: (rule: ValidationRule) => void): void;

View File

@ -1,3 +0,0 @@
export { default as Services } from './services/service';
export { default as Database } from './services/database.service';
export { MessageType } from './models/process.model';

View File

@ -1,24 +0,0 @@
import { DocumentSignature } from '~/models/signature.models';
export interface Group {
id: number;
name: string;
description: string;
roles: Array<{
name: string;
members: Array<{
id: string | number;
name: string;
}>;
documents?: Array<any>;
}>;
commonDocuments: Array<{
id: number;
name: string;
visibility: string;
description: string;
createdAt?: string | null;
deadline?: string | null;
signatures?: DocumentSignature[];
status?: string;
}>;
}

View File

@ -1,10 +0,0 @@
export interface Member {
id: string | number;
name: string;
email?: string;
avatar?: string;
processRoles?: Array<{
processId: number | string;
role: string;
}>;
}

View File

@ -1,13 +0,0 @@
import { SignatureComponent } from './pages/signature/signature-component';
import { SignatureElement } from './pages/signature/signature';
import { AccountComponent } from './pages/account/account-component';
import { AccountElement } from './pages/account/account';
export { SignatureComponent, SignatureElement, AccountComponent, AccountElement };
declare global {
interface HTMLElementTagNameMap {
'signature-component': SignatureComponent;
'signature-element': SignatureElement;
'account-component': AccountComponent;
'account-element': AccountElement;
}
}

View File

@ -1,118 +0,0 @@
export declare const ALLOWED_ROLES: string[];
export declare const STORAGE_KEYS: {
pairing: string;
wallet: string;
process: string;
data: string;
};
export declare const defaultRows: {
column1: string;
column2: string;
column3: string;
}[];
export declare const mockNotifications: {
[key: string]: Notification[];
};
export declare const notificationMessages: string[];
export declare const mockDataRows: {
column1: string;
column2: string;
column3: string;
column4: string;
column5: string;
column6: string;
processName: string;
zone: string;
}[];
export declare const mockProcessRows: ({
process: string;
role: string;
notification: {
messages: {
id: number;
read: boolean;
date: string;
message: string;
}[];
unread?: undefined;
total?: undefined;
};
} | {
process: string;
role: string;
notification: {
unread: number;
total: number;
messages: {
id: number;
read: boolean;
date: string;
message: string;
}[];
};
})[];
export declare const mockContracts: {
'Contract #123': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #456': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #789': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #101': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #102': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #103': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #104': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #105': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
'Contract #106': {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
};
};

View File

@ -1,38 +0,0 @@
export interface Row {
column1: string;
column2: string;
column3: string;
}
export interface Contract {
title: string;
date: string;
parties: string[];
terms: string[];
content: string;
}
export interface WalletRow {
column1: string;
column2: string;
column3: string;
}
export interface DataRow {
column1: string;
column2: string;
column3: string;
column4: string;
column5: string;
column6: string;
processName: string;
zone: string;
}
export interface Notification {
message: string;
timestamp: string;
isRead: boolean;
}
export interface NotificationMessage {
id: number;
read: boolean;
date: string;
message: string;
}

View File

@ -1,119 +0,0 @@
export const groupsMock: {
id: number;
name: string;
description: string;
commonDocuments: {
id: number;
name: string;
description: string;
visibility: string;
status: string;
createdAt: null;
deadline: null;
signatures: never[];
}[];
roles: ({
name: string;
members: {
id: number;
name: string;
}[];
documents: ({
id: number;
name: string;
description: string;
visibility: string;
createdAt: string;
deadline: string;
signatures: ({
member: {
id: number;
name: string;
};
signed: boolean;
signedAt: string;
} | {
member: {
id: number;
name: string;
};
signed: boolean;
signedAt?: undefined;
})[];
status?: undefined;
} | {
id: number;
name: string;
description: string;
visibility: string;
createdAt: null;
deadline: null;
signatures: never[];
status?: undefined;
} | {
id: number;
name: string;
description: string;
visibility: string;
status: string;
createdAt: null;
deadline: null;
signatures: never[];
})[];
} | {
name: string;
members: {
id: number;
name: string;
}[];
documents: ({
id: number;
name: string;
description: string;
visibility: string;
createdAt: string;
deadline: string;
signatures: {
member: {
id: number;
name: string;
};
signed: boolean;
signedAt: string;
}[];
status?: undefined;
} | {
id: number;
name: string;
description: string;
visibility: string;
status: string;
createdAt: null;
deadline: null;
signatures: never[];
} | {
id: number;
name: string;
description: string;
visibility: string;
status: string;
createdAt: string;
deadline: string;
signatures: ({
member: {
id: number;
name: string;
};
signed: boolean;
signedAt: string;
} | {
member: {
id: number;
name: string;
};
signed: boolean;
signedAt?: undefined;
})[];
})[];
})[];
}[];

View File

@ -1,10 +0,0 @@
export const membersMock: {
id: number;
name: string;
avatar: string;
email: string;
processRoles: {
processId: number;
role: string;
}[];
}[];

View File

@ -1,9 +0,0 @@
export declare const messagesMock: {
memberId: number;
messages: {
id: number;
sender: string;
text: string;
time: string;
}[];
}[];

View File

@ -1,6 +0,0 @@
import { Device, Process, SecretsStore } from "pkg/sdk_client";
export interface BackUp {
device: Device;
secrets: SecretsStore;
processes: Record<string, Process>;
}

View File

@ -1,24 +0,0 @@
export interface INotification {
id: number;
title: string;
description: string;
sendToNotificationPage?: boolean;
path?: string;
}
export interface IUser {
id: string;
information?: any;
}
export interface IMessage {
id: string;
message: any;
}
export interface UserDiff {
new_state_merkle_root: string;
field: string;
previous_value: string;
new_value: string;
notify_user: boolean;
need_validation: boolean;
proof: any;
}

View File

@ -1,56 +0,0 @@
export interface IProcess {
id: number;
name: string;
description: string;
icon?: string;
zoneList: IZone[];
}
export interface IZone {
id: number;
name: string;
path: string;
icon?: string;
}
export interface INotification {
id: number;
title: string;
description: string;
sendToNotificationPage?: boolean;
path?: string;
}
export declare enum MessageType {
LISTENING = "LISTENING",
REQUEST_LINK = "REQUEST_LINK",
LINK_ACCEPTED = "LINK_ACCEPTED",
CREATE_PAIRING = "CREATE_PAIRING",
PAIRING_CREATED = "PAIRING_CREATED",
ERROR = "ERROR",
VALIDATE_TOKEN = "VALIDATE_TOKEN",
RENEW_TOKEN = "RENEW_TOKEN",
GET_PAIRING_ID = "GET_PAIRING_ID",
GET_PROCESSES = "GET_PROCESSES",
GET_MY_PROCESSES = "GET_MY_PROCESSES",
PROCESSES_RETRIEVED = "PROCESSES_RETRIEVED",
RETRIEVE_DATA = "RETRIEVE_DATA",
DATA_RETRIEVED = "DATA_RETRIEVED",
DECODE_PUBLIC_DATA = "DECODE_PUBLIC_DATA",
PUBLIC_DATA_DECODED = "PUBLIC_DATA_DECODED",
GET_MEMBER_ADDRESSES = "GET_MEMBER_ADDRESSES",
MEMBER_ADDRESSES_RETRIEVED = "MEMBER_ADDRESSES_RETRIEVED",
CREATE_PROCESS = "CREATE_PROCESS",
PROCESS_CREATED = "PROCESS_CREATED",
UPDATE_PROCESS = "UPDATE_PROCESS",
PROCESS_UPDATED = "PROCESS_UPDATED",
NOTIFY_UPDATE = "NOTIFY_UPDATE",
UPDATE_NOTIFIED = "UPDATE_NOTIFIED",
VALIDATE_STATE = "VALIDATE_STATE",
STATE_VALIDATED = "STATE_VALIDATED",
HASH_VALUE = "HASH_VALUE",
VALUE_HASHED = "VALUE_HASHED",
GET_MERKLE_PROOF = "GET_MERKLE_PROOF",
MERKLE_PROOF_RETRIEVED = "MERKLE_PROOF_RETRIEVED",
VALIDATE_MERKLE_PROOF = "VALIDATE_MERKLE_PROOF",
MERKLE_PROOF_VALIDATED = "MERKLE_PROOF_VALIDATED",
ADD_DEVICE = "ADD_DEVICE",
DEVICE_ADDED = "DEVICE_ADDED"
}

Some files were not shown because too many files have changed in this diff Show More