ncantu 20d115a31c feat: Add APIs, dashboard, documentation and improve scripts
**Motivations:**
- Add API services for anchorage and faucet functionality
- Add dashboard interface for signet monitoring
- Improve documentation and maintenance guides
- Enhance existing scripts for better functionality

**Root causes:**
- Need for API services to interact with Bitcoin Signet
- Need for user-friendly dashboard interface
- Need for comprehensive documentation
- Scripts required improvements for better reliability

**Correctifs:**
- Updated Dockerfile with better configuration
- Improved gen-bitcoind-conf.sh and gen-signet-keys.sh scripts
- Enhanced mine.sh, miner, run.sh, and setup-signet.sh scripts
- Updated env.example with new configuration options

**Evolutions:**
- Added api-anchorage service with anchor functionality
- Added api-faucet service for testnet coin distribution
- Added signet-dashboard for monitoring and management
- Added comprehensive documentation in docs/ directory
- Added configure-nginx-proxy.sh for proxy configuration
- Added update-signet.sh for signet updates
- Added ETAT_SYSTEME.md and START_DASHBOARD_AND_FAUCET.md guides
- Added .bitcoin-version file for version tracking

**Pages affectées:**
- Dockerfile
- env.example
- gen-bitcoind-conf.sh
- gen-signet-keys.sh
- mine.sh
- miner
- run.sh
- setup-signet.sh
- api-anchorage/ (new)
- api-faucet/ (new)
- signet-dashboard/ (new)
- docs/ (new)
- configure-nginx-proxy.sh (new)
- update-signet.sh (new)
- ETAT_SYSTEME.md (new)
- START_DASHBOARD_AND_FAUCET.md (new)
- .bitcoin-version (new)
- .env (modified)
- mempool/ (added)
2026-01-24 02:40:25 +01:00

31 lines
797 B
JavaScript

/**
* Logger simple pour le dashboard
*/
const LOG_LEVEL = process.env.LOG_LEVEL || 'info';
const levels = {
error: 0,
warn: 1,
info: 2,
debug: 3,
};
function log(level, message, meta = {}) {
const levelNum = levels[level] || 2;
const currentLevel = levels[LOG_LEVEL] || 2;
if (levelNum <= currentLevel) {
const timestamp = new Date().toISOString();
const metaStr = Object.keys(meta).length > 0 ? ` ${JSON.stringify(meta)}` : '';
console.log(`[${timestamp}] [${level.toUpperCase()}] ${message}${metaStr}`);
}
}
export const logger = {
error: (message, meta) => log('error', message, meta),
warn: (message, meta) => log('warn', message, meta),
info: (message, meta) => log('info', message, meta),
debug: (message, meta) => log('debug', message, meta),
};