ncantu 26a53327a4 Enhance: Complete dashboard documentation and new services integration
**Motivations:**
- Complete documentation for dashboard, domains, ports and environment configuration
- Add new services (ClamAV API, Watermark API) to the infrastructure
- Enhance dashboard with new pages and improved functionality
- Improve deployment scripts and service configurations

**Root causes:**
- Missing comprehensive documentation for infrastructure setup
- Need for antivirus scanning service integration
- Need for watermark service integration
- Dashboard required additional pages and features

**Correctifs:**
- Added comprehensive documentation in docs/ (DASHBOARD.md, DOMAINS_AND_PORTS.md, ENVIRONMENT.md)
- Updated systemd service files with proper environment variables
- Enhanced nginx proxy configuration script
- Updated maintenance documentation

**Evolutions:**
- Added new ClamAV API service (api-clamav) for file scanning
- Added new Watermark API service (api-filigrane) for document watermarking
- Enhanced signet-dashboard with new learn.html page
- Improved dashboard UI with better styles and navigation
- Enhanced app.js with new functionality and better error handling
- Updated API documentation page with complete endpoint descriptions
- Added deployment scripts for watermark and nginx configuration
- Updated hash and UTXO lists with latest data
- Enhanced server.js with new routes and improved Bitcoin RPC integration

**Pages affectées:**
- docs/DASHBOARD.md: New comprehensive dashboard documentation
- docs/DOMAINS_AND_PORTS.md: New infrastructure domains and ports documentation
- docs/ENVIRONMENT.md: New environment variables documentation
- docs/MAINTENANCE.md: Updated maintenance procedures
- docs/README.md: Updated main documentation
- signet-dashboard/public/app.js: Enhanced with new features
- signet-dashboard/public/styles.css: Improved styling
- signet-dashboard/public/index.html: Enhanced main page
- signet-dashboard/public/learn.html: New educational page
- signet-dashboard/public/api-docs.html: Enhanced API documentation
- signet-dashboard/public/hash-list.html: Updated hash list page
- signet-dashboard/public/utxo-list.html: Updated UTXO list page
- signet-dashboard/public/join-signet.html: Updated join signet page
- signet-dashboard/src/server.js: Enhanced server with new routes
- signet-dashboard/start.sh: Updated startup script
- signet-dashboard/signet-dashboard.service: Updated systemd service
- api-anchorage/anchorage-api.service: Updated systemd service
- api-faucet/faucet-api.service: Updated systemd service
- configure-nginx-proxy.sh: Enhanced nginx configuration script
- add-watermark-certificate.sh: New watermark certificate script
- deploy-watermark-nginx.sh: New deployment script
- api-clamav/: New ClamAV API service
- api-filigrane/: New Watermark API service
- hash_list.txt, utxo_list.txt: Updated with latest data
- anchor_count.txt: Updated anchor count
2026-01-25 17:43:05 +01:00

548 lines
22 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liste des UTXO - Bitcoin Ancrage Dashboard</title>
<link rel="stylesheet" href="styles.css">
<style>
.utxo-list-container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
.header-section {
margin-bottom: 30px;
}
.header-section h1 {
margin-bottom: 10px;
}
.header-section .back-link {
display: inline-block;
margin-bottom: 20px;
color: #007bff;
text-decoration: none;
}
.header-section .back-link:hover {
text-decoration: underline;
}
.info-section {
background: #f8f9fa;
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
}
.info-section p {
margin: 5px 0;
}
.category-section {
margin-bottom: 40px;
}
.category-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 15px 20px;
border-radius: 5px 5px 0 0;
margin-bottom: 0;
}
.category-header.bloc-rewards {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}
.category-header.ancrages {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.category-header.changes {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.category-header.fees {
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}
.category-header h2 {
margin: 0;
font-size: 1.5em;
}
.category-stats {
background: rgba(255, 255, 255, 0.2);
padding: 10px;
margin-top: 10px;
border-radius: 3px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.category-stats span {
margin-right: 20px;
}
.table-container {
overflow-x: auto;
background: white;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background: #f8f9fa;
color: #333;
font-weight: bold;
position: sticky;
top: 0;
}
tr:hover {
background: #f5f5f5;
}
.txid-cell {
font-family: monospace;
font-size: 0.9em;
}
.txid-link {
color: #007bff;
text-decoration: none;
}
.txid-link:hover {
text-decoration: underline;
}
.address-cell {
font-family: monospace;
font-size: 0.9em;
word-break: break-all;
}
.amount-cell {
text-align: right;
font-weight: bold;
}
.loading {
text-align: center;
padding: 40px;
font-size: 1.2em;
color: #666;
}
.error {
background: #f8d7da;
color: #721c24;
padding: 15px;
border-radius: 5px;
margin: 20px 0;
}
.refresh-button {
background: #28a745;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
margin-top: 10px;
}
.refresh-button:hover {
background: #218838;
}
.refresh-button:disabled {
background: #6c757d;
cursor: not-allowed;
}
.total-amount {
font-size: 1.2em;
font-weight: bold;
color: #28a745;
}
.empty-message {
padding: 20px;
text-align: center;
color: #666;
background: #f8f9fa;
border-radius: 0 0 5px 5px;
}
.status-spent {
color: #dc3545;
font-weight: bold;
}
.status-locked {
color: #ffc107;
font-weight: bold;
}
.status-available {
color: #28a745;
font-weight: bold;
}
.navigation-bar {
background: #f8f9fa;
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.navigation-bar a {
padding: 10px 20px;
background: white;
color: #007bff;
text-decoration: none;
border-radius: 5px;
border: 2px solid #007bff;
transition: all 0.3s;
font-weight: bold;
}
.navigation-bar a:hover {
background: #007bff;
color: white;
}
.category-section {
scroll-margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<div class="utxo-list-container">
<div class="header-section">
<a href="/" class="back-link">← Retour au dashboard</a>
<h1>Liste des UTXO</h1>
<div class="info-section">
<p><strong>Total d'UTXO :</strong> <span id="utxo-count">-</span></p>
<p><strong>Capacité d'ancrage restante :</strong> <span id="available-for-anchor">-</span> ancrages</p>
<p><strong>Montant total :</strong> <span id="total-amount" class="total-amount">-</span></p>
<p><strong>Dernière mise à jour :</strong> <span id="last-update">-</span></p>
<button class="refresh-button" onclick="loadUtxoList()">Actualiser</button>
<a href="/api/utxo/list.txt" download="utxo_list.txt" style="margin-left: 10px; color: #007bff; text-decoration: none;">📥 Télécharger le fichier texte</a>
</div>
</div>
<div id="navigation" class="navigation-bar" style="display: none;">
<a href="#bloc-rewards">💰 Bloc Rewards</a>
<a href="#ancrages">🔗 Ancrages</a>
<a href="#changes">🔄 Changes</a>
<a href="#fees">💸 Frais</a>
</div>
<div id="content">
<div class="loading">Chargement des UTXO...</div>
</div>
</div>
</div>
<script>
const API_BASE_URL = window.location.origin;
// Charger la liste au chargement de la page
document.addEventListener('DOMContentLoaded', () => {
loadUtxoList();
});
function renderTable(utxos, categoryName, categoryLabel) {
if (utxos.length === 0) {
return `
<div class="category-section" id="${categoryName}">
<div class="category-header ${categoryName}">
<h2>${categoryLabel}</h2>
<div class="category-stats">
<span><strong>Nombre :</strong> 0</span>
<span><strong>Montant total :</strong> 0 🛡</span>
</div>
</div>
<div class="empty-message">Aucun UTXO dans cette catégorie.</div>
</div>
`;
}
const totalAmount = utxos.reduce((sum, utxo) => sum + utxo.amount, 0);
const totalSats = Math.round(totalAmount * 100000000);
const isAnchors = categoryName === 'ancrages';
const isBlocRewards = categoryName === 'bloc-rewards';
const isChanges = categoryName === 'changes';
// Pour les changes, compter les changes d'ancrage
let anchorChangesCount = 0;
let anchorChangesAmount = 0;
if (isChanges) {
const anchorChanges = utxos.filter(utxo => utxo.isAnchorChange);
anchorChangesCount = anchorChanges.length;
anchorChangesAmount = anchorChanges.reduce((sum, utxo) => sum + utxo.amount, 0);
}
let tableHTML = `
<div class="category-section" id="${categoryName}">
<div class="category-header ${categoryName}">
<h2>${categoryLabel}</h2>
<div class="category-stats">
<span><strong>Nombre :</strong> ${utxos.length.toLocaleString('fr-FR')}</span>
<span><strong>Montant total :</strong> ${formatBTC(totalAmount)} (${totalSats.toLocaleString('fr-FR')} ✅)</span>
${isChanges && anchorChangesCount > 0 ? `<span><strong>Changes d'ancrage :</strong> ${anchorChangesCount} (${formatBTC(anchorChangesAmount)})</span>` : ''}
</div>
</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Transaction ID</th>
<th>Vout</th>
<th>Adresse</th>
`;
if (isAnchors) {
tableHTML += `
<th>Numéro de bloc</th>
<th style="text-align: right;">Montant (✅)</th>
<th>Confirmations</th>
<th>Statut</th>
`;
} else if (isBlocRewards) {
tableHTML += `
<th style="text-align: right;">Montant (🛡)</th>
<th>Date</th>
<th>Confirmations</th>
<th>Statut</th>
`;
} else {
// Pour la section changes, ajouter une colonne pour indiquer si c'est un change d'ancrage
if (categoryName === 'changes') {
tableHTML += `
<th style="text-align: right;">Montant (🛡)</th>
<th style="text-align: right;">Montant (✅)</th>
<th>Confirmations</th>
<th>Type</th>
<th>Statut</th>
`;
} else {
tableHTML += `
<th style="text-align: right;">Montant (🛡)</th>
<th style="text-align: right;">Montant (✅)</th>
<th>Confirmations</th>
<th>Statut</th>
`;
}
}
tableHTML += `
</tr>
</thead>
<tbody>
`;
utxos.forEach((utxo) => {
const mempoolUrl = 'https://mempool.4nkweb.com/fr';
const txLink = `${mempoolUrl}/tx/${utxo.txid}`;
const amountSats = Math.round(utxo.amount * 100000000);
const amountBTC = Math.round(utxo.amount);
tableHTML += '<tr>';
tableHTML += `<td class="txid-cell"><a href="${txLink}" target="_blank" rel="noopener noreferrer" class="txid-link">${utxo.txid}</a></td>`;
tableHTML += `<td>${utxo.vout}</td>`;
tableHTML += `<td class="address-cell">${utxo.address || '-'}</td>`;
if (isAnchors) {
tableHTML += `<td>${utxo.blockHeight !== null && utxo.blockHeight !== undefined ? utxo.blockHeight.toLocaleString('fr-FR') : '-'}</td>`;
tableHTML += `<td class="amount-cell">${amountSats.toLocaleString('fr-FR')} ✅</td>`;
} else if (isBlocRewards) {
tableHTML += `<td class="amount-cell">${amountBTC.toLocaleString('fr-FR')} 🛡</td>`;
if (utxo.blockTime) {
const date = new Date(utxo.blockTime * 1000);
tableHTML += `<td>${date.toLocaleString('fr-FR', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })}</td>`;
} else {
tableHTML += '<td>-</td>';
}
} else {
tableHTML += `<td class="amount-cell">${amountBTC.toLocaleString('fr-FR')} 🛡</td>`;
tableHTML += `<td class="amount-cell">${amountSats.toLocaleString('fr-FR')} ✅</td>`;
}
tableHTML += `<td>${utxo.confirmations.toLocaleString('fr-FR')}</td>`;
// Colonne Type (uniquement pour les changes)
if (categoryName === 'changes') {
const changeType = utxo.isAnchorChange ? '🔗 Transaction d\'ancrage' : '🔄 Transaction normale';
tableHTML += `<td>${changeType}</td>`;
}
// Colonne Statut
let statusText = '';
let statusClass = '';
if (utxo.isSpentOnchain) {
statusText = 'Dépensé onchain';
statusClass = 'status-spent';
} else if (utxo.isLockedInMutex) {
statusText = 'Verrouillé';
statusClass = 'status-locked';
} else {
statusText = 'Disponible';
statusClass = 'status-available';
}
tableHTML += `<td class="${statusClass}">${statusText}</td>`;
tableHTML += '</tr>';
});
tableHTML += `
</tbody>
</table>
</div>
</div>
`;
return tableHTML;
}
async function loadUtxoList() {
const contentDiv = document.getElementById('content');
const refreshButton = document.querySelector('.refresh-button');
refreshButton.disabled = true;
contentDiv.innerHTML = '<div class="loading">Chargement des UTXO...</div>';
try {
const response = await fetch(`${API_BASE_URL}/api/utxo/list`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
const counts = data.counts || {};
const blocRewards = data.blocRewards || [];
const anchors = data.anchors || [];
const changes = data.changes || [];
const fees = data.fees || [];
document.getElementById('utxo-count').textContent = counts.total.toLocaleString('fr-FR');
document.getElementById('available-for-anchor').textContent = (counts.availableForAnchor || 0).toLocaleString('fr-FR');
// Calculer le montant total
const totalAmount = blocRewards.reduce((sum, utxo) => sum + utxo.amount, 0) +
anchors.reduce((sum, utxo) => sum + utxo.amount, 0) +
changes.reduce((sum, utxo) => sum + utxo.amount, 0);
document.getElementById('total-amount').textContent = formatBTC(totalAmount);
updateLastUpdateTime();
// Afficher la barre de navigation
document.getElementById('navigation').style.display = 'flex';
// Afficher les 4 listes
let html = '';
html += renderTable(blocRewards, 'bloc-rewards', '💰 Bloc Rewards (Récompenses de minage)');
html += renderTable(anchors, 'ancrages', '🔗 Ancrages (Transactions d\'ancrage)');
html += renderTable(changes, 'changes', '🔄 Changes (Monnaie de retour)');
html += renderFeesTable(fees, 'fees', '💸 Frais (Transactions d\'ancrage)');
contentDiv.innerHTML = html;
} catch (error) {
console.error('Error loading UTXO list:', error);
contentDiv.innerHTML = `<div class="error">Erreur lors du chargement de la liste des UTXO : ${error.message}</div>`;
} finally {
refreshButton.disabled = false;
}
}
function formatBTC(btc) {
if (btc === 0) return '0 🛡';
// Arrondir sans décimales
const roundedBTC = Math.round(btc);
if (roundedBTC === 0 && btc > 0) {
// Si arrondi à 0 mais qu'il y a un montant, afficher en sats
const sats = Math.round(btc * 100000000);
return `${sats.toLocaleString('fr-FR')}`;
}
return `${roundedBTC.toLocaleString('fr-FR')} 🛡`;
}
function renderFeesTable(fees, categoryName, categoryLabel) {
if (fees.length === 0) {
return `
<div class="category-section" id="${categoryName}">
<div class="category-header ${categoryName}">
<h2>${categoryLabel}</h2>
<div class="category-stats">
<span><strong>Nombre :</strong> 0</span>
<span><strong>Total des frais :</strong> 0 ✅</span>
</div>
</div>
<div class="empty-message">Aucune transaction avec frais onchain enregistrée.</div>
</div>
`;
}
const totalFees = fees.reduce((sum, fee) => sum + fee.fee, 0);
const totalFeesSats = Math.round(totalFees * 100000000);
let tableHTML = `
<div class="category-section" id="${categoryName}">
<div class="category-header ${categoryName}">
<h2>${categoryLabel}</h2>
<div class="category-stats">
<span><strong>Nombre :</strong> ${fees.length.toLocaleString('fr-FR')}</span>
<span><strong>Total des frais :</strong> ${formatBTC(totalFees)} (${totalFeesSats.toLocaleString('fr-FR')} ✅)</span>
</div>
</div>
<div class="table-container">
<table>
<thead>
<tr>
<th>Transaction ID</th>
<th>Frais (BTC)</th>
<th>Frais (✅)</th>
<th>Change Address</th>
<th>Change Amount</th>
<th>Bloc</th>
<th>Date</th>
<th>Confirmations</th>
</tr>
</thead>
<tbody>
`;
fees.forEach((fee) => {
const mempoolUrl = 'https://mempool.4nkweb.com/fr';
const txLink = `${mempoolUrl}/tx/${fee.txid}`;
const feeSats = fee.fee_sats || Math.round(fee.fee * 100000000);
tableHTML += '<tr>';
tableHTML += `<td class="txid-cell"><a href="${txLink}" target="_blank" rel="noopener noreferrer" class="txid-link">${fee.txid}</a></td>`;
tableHTML += `<td class="amount-cell">${fee.fee.toFixed(8)}</td>`;
tableHTML += `<td class="amount-cell">${feeSats.toLocaleString('fr-FR')} ✅</td>`;
tableHTML += `<td class="address-cell">${fee.changeAddress || '-'}</td>`;
tableHTML += `<td class="amount-cell">${fee.changeAmount ? formatBTC(fee.changeAmount) : '-'}</td>`;
tableHTML += `<td>${fee.blockHeight !== null && fee.blockHeight !== undefined ? fee.blockHeight.toLocaleString('fr-FR') : '-'}</td>`;
if (fee.blockTime) {
const date = new Date(fee.blockTime * 1000);
tableHTML += `<td>${date.toLocaleString('fr-FR', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })}</td>`;
} else {
tableHTML += '<td>-</td>';
}
tableHTML += `<td>${fee.confirmations.toLocaleString('fr-FR')}</td>`;
tableHTML += '</tr>';
});
tableHTML += `
</tbody>
</table>
</div>
</div>
`;
return tableHTML;
}
function updateLastUpdateTime() {
const now = new Date();
document.getElementById('last-update').textContent = now.toLocaleString('fr-FR');
}
</script>
<footer>
<p>Bitcoin Ancrage Dashboard - Équipe 4NK</p>
<a href="https://git.4nkweb.com/4nk/anchorage_layer_simple.git" target="_blank" rel="noopener noreferrer" class="git-link" title="Voir le code source sur Git">
<svg class="git-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
</svg>
</a>
</footer>
</body>
</html>