134 lines
5.7 KiB
Markdown
134 lines
5.7 KiB
Markdown
# Architecture des Flux et Services - LeCoffre Node
|
|
|
|
## Tableau des Services - IP/Domaines et Ports
|
|
|
|
### 🏠 **Services Locaux (Docker Compose)**
|
|
|
|
| Service | Container | Port Local | Port Interne | Protocole | URL d'accès |
|
|
|---------|-----------|------------|--------------|-----------|-------------|
|
|
| **tor** | tor-proxy | - | 9050 | TCP | Réseau interne uniquement |
|
|
| **bitcoin** | bitcoin-signet | - | 38332 (RPC)<br>38333 (P2P)<br>29000 (ZMQ hash)<br>29001 (ZMQ rawtx) | TCP | Réseau interne uniquement |
|
|
| **blindbit** | blindbit-oracle | 0.0.0.0:8000 | 8000 | HTTP | http://0.0.0.0:8000 |
|
|
| **sdk_relay** | sdk_relay | 0.0.0.0:8090<br>0.0.0.0:8091 | 8090 (WS)<br>8091 (HTTP) | WebSocket/HTTP | ws://0.0.0.0:8090<br>http://0.0.0.0:8091 |
|
|
| **lecoffre-back** | lecoffre-back | 0.0.0.0:8080 | 8080 | HTTP | http://0.0.0.0:8080 |
|
|
| **lecoffre-front** | lecoffre-front | 127.0.0.2:3004 | 3000 | HTTP | http://127.0.0.2:3004 |
|
|
| **ihm_client** | ihm_client | 0.0.0.0:3003 | 3003 | HTTP | http://0.0.0.0:3003 |
|
|
| **sdk_signer** | sdk_signer | 0.0.0.0:3001 | 3001 | HTTP/WebSocket | http://0.0.0.0:3001 |
|
|
| **sdk_storage** | sdk_storage | 0.0.0.0:8081 | 8080 | HTTP | http://0.0.0.0:8081 |
|
|
|
|
### 🌐 **Services Externes**
|
|
|
|
| Service | Domaine | Port | Protocole | URL d'accès | Statut |
|
|
|---------|---------|------|-----------|-------------|--------|
|
|
| **Bootstrap Relay** | dev3.4nkweb.com | 443 | WSS | wss://dev3.4nkweb.com/ws/ | ✅ Actif |
|
|
| **Signer Externe** | dev3.4nkweb.com | 9090 | WS | ws://dev3.4nkweb.com:9090 | ✅ Actif |
|
|
| **Signer Base** | dev3.4nkweb.com | 443 | HTTPS | https://dev3.4nkweb.com | ✅ Actif |
|
|
| **Mempool** | mempool2.4nkweb.com | 443 | HTTPS | https://mempool2.4nkweb.com | ✅ Actif |
|
|
| **Storage** | dev4.4nkweb.com | 443 | HTTPS | https://dev4.4nkweb.com/storage | ✅ Actif |
|
|
|
|
### 🔄 **Proxy Nginx (dev4.4nkweb.com)**
|
|
|
|
| Route | Destination | Port | Protocole | Description |
|
|
|-------|-------------|------|-----------|-------------|
|
|
| **/** | ihm_client | 3003 | HTTP | Interface principale |
|
|
| **/lecoffre** | lecoffre-front | 3004 | HTTP | Application LeCoffre |
|
|
| **/api/** | lecoffre-back | 8080 | HTTP | API Backend |
|
|
| **/back/** | lecoffre-back | 8080 | HTTP | API Backend (alias) |
|
|
| **/ws/** | sdk_relay | 8090 | WebSocket | Relay WebSocket |
|
|
| **/signer/** | sdk_signer | 3001 | HTTP/WebSocket | Service Signer |
|
|
| **/src/service-workers/** | ihm_client | 3003 | HTTP | Service Workers |
|
|
|
|
### 🏠 **Proxy Nginx Local (local.4nkweb.com)**
|
|
|
|
| Route | Destination | Port | Protocole | Description |
|
|
|-------|-------------|------|-----------|-------------|
|
|
| **/** | Redirection | 3000 | HTTP | Redirige vers port 3000 |
|
|
| **/lecoffre/** | lecoffre-front | 3004 | HTTP | Application LeCoffre local |
|
|
|
|
### 🔧 **Configuration Bitcoin Signet**
|
|
|
|
| Service | Port | Protocole | Description |
|
|
|---------|------|-----------|-------------|
|
|
| **RPC** | 38332 | TCP | Interface RPC Bitcoin |
|
|
| **P2P** | 38333 | TCP | Réseau peer-to-peer |
|
|
| **ZMQ Hash** | 29000 | TCP | Notifications de blocs |
|
|
| **ZMQ RawTx** | 29001 | TCP | Notifications de transactions |
|
|
| **Tor** | 9050 | TCP | Proxy Tor |
|
|
|
|
### 🌐 **Réseau Docker**
|
|
|
|
| Réseau | Subnet | Driver | Services |
|
|
|--------|--------|--------|----------|
|
|
| **btcnet** | 172.20.0.0/16 | bridge | Tous les services |
|
|
|
|
### 🔗 **Variables d'Environnement Clés**
|
|
|
|
| Variable | Valeur | Service |
|
|
|----------|--------|---------|
|
|
| **VITE_BOOTSTRAPURL** | wss://dev4.4nkweb.com/ws/ | ihm_client |
|
|
| **SIGNER_WS_URL** | ws://dev3.4nkweb.com:9090 | sdk_signer |
|
|
| **SIGNER_BASE_URL** | https://dev3.4nkweb.com | sdk_signer |
|
|
| **RELAY_URLS** | wss://dev4.4nkweb.com/ws/,wss://dev3.4nkweb.com/ws/ | sdk_signer |
|
|
| **bootstrap_url** | wss://dev3.4nkweb.com/ws/ | sdk_relay |
|
|
| **storage** | https://dev4.4nkweb.com/storage | sdk_relay |
|
|
|
|
---
|
|
|
|
## Flux d'Architecture
|
|
|
|
### 🔄 **Flux Principal**
|
|
|
|
```
|
|
Internet → dev4.4nkweb.com (Nginx) → Services Locaux
|
|
```
|
|
|
|
1. **Frontend** : `https://dev4.4nkweb.com/lecoffre` → lecoffre-front (127.0.0.2:3004)
|
|
2. **API** : `https://dev4.4nkweb.com/api/` → lecoffre-back (0.0.0.0:8080)
|
|
3. **IHM** : `https://dev4.4nkweb.com/` → ihm_client (0.0.0.0:3003)
|
|
4. **WebSocket** : `https://dev4.4nkweb.com/ws/` → sdk_relay (0.0.0.0:8090)
|
|
|
|
### 🔗 **Flux de Redirection**
|
|
|
|
```
|
|
local.4nkdev.com → local.4nkweb.com → https://dev4.4nkweb.com/lecoffre
|
|
```
|
|
|
|
### 🌐 **Flux Externes**
|
|
|
|
- **Bootstrap** : `wss://dev3.4nkweb.com/ws/` (Relay externe)
|
|
- **Signer** : `ws://dev3.4nkweb.com:9090` (Actuellement inactif)
|
|
- **Mempool** : `https://mempool2.4nkweb.com` (Réseau Bitcoin Signet)
|
|
|
|
---
|
|
|
|
## ⚠️ **Points d'Attention**
|
|
|
|
1. **dev3.4nkweb.com:9090** - Service signer externe actuellement inactif
|
|
2. **dev3.4nkweb.com** - Retourne 502 Bad Gateway (services backend indisponibles)
|
|
3. **Ports 0.0.0.0** - Services locaux uniquement accessibles depuis la machine
|
|
4. **Ports 127.0.0.2** - lecoffre-front sur interface séparée
|
|
|
|
## 📋 **Ordre de Démarrage des Services**
|
|
|
|
Selon les règles du projet, l'ordre de démarrage est :
|
|
|
|
1. **tor** - Proxy anonyme
|
|
2. **bitcoin** - Nœud Bitcoin Signet
|
|
3. **blindbit** - Oracle Bitcoin
|
|
4. **sdk_storage** - Stockage temporaire
|
|
5. **sdk_relay** - Relais des transactions
|
|
6. **sdk_signer** - Signature des processus
|
|
7. **ihm_client** - Interface utilisateur
|
|
|
|
---
|
|
|
|
## 🔧 **Configuration Critique**
|
|
|
|
- **Mempool du réseau signet** : `https://mempool2.4nkweb.com/fr/docs/api/rest`
|
|
- **Test de connectivité Bitcoin** : `docker exec bitcoin-signet bitcoin-cli -signet -rpccookiefile=/home/bitcoin/.bitcoin/signet/.cookie getblockchaininfo`
|
|
- **Test WebSocket Bootstrap** : `wss://dev3.4nkweb.com/ws/`
|
|
|
|
---
|
|
|
|
Met à jour ce document si tu détectes des incohérences ou pose des questions pour confirmer.
|
|
Propose des améliorations dans un document lecoffre_node/IA_agents/todo.md |