deleted logs and WebRTC issue
Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
21
oracle.js
21
oracle.js
@@ -84,8 +84,6 @@ Oracle Services:
|
||||
}
|
||||
}
|
||||
|
||||
console.log(chalk.yellow('🚀 Starting Ring Network Oracle Node...'));
|
||||
|
||||
const oracle = new OracleNode(options);
|
||||
|
||||
// Handle graceful shutdown
|
||||
@@ -103,37 +101,30 @@ process.on('SIGTERM', async () => {
|
||||
|
||||
// Connect to bootstrap node if specified
|
||||
if (options.bootstrap) {
|
||||
console.log(chalk.cyan(`🔗 Connecting to bootstrap node: ${options.bootstrap}`));
|
||||
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
const success = await oracle.joinRing(options.bootstrap);
|
||||
if (success) {
|
||||
console.log(chalk.green('✅ Successfully joined the ring network as Oracle!'));
|
||||
} else {
|
||||
console.log(chalk.red('❌ Failed to join the ring network'));
|
||||
}
|
||||
await oracle.joinRing(options.bootstrap);
|
||||
} catch (error) {
|
||||
console.error(chalk.red('Error joining network:'), error.message);
|
||||
// Connection failed
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
// Set up event handlers
|
||||
oracle.on('peerConnected', (peerId) => {
|
||||
console.log(chalk.blue(`👋 New peer connected: ${peerId.substring(0, 8)}`));
|
||||
// Peer connected
|
||||
});
|
||||
|
||||
oracle.on('peerDisconnected', (peerId) => {
|
||||
console.log(chalk.red(`👋 Peer disconnected: ${peerId.substring(0, 8)}`));
|
||||
// Peer disconnected
|
||||
});
|
||||
|
||||
oracle.on('ringMessage', ({ from, payload }) => {
|
||||
console.log(chalk.magenta(`📨 Ring message from ${from.substring(0, 8)}: ${JSON.stringify(payload)}`));
|
||||
// Ring message received
|
||||
});
|
||||
|
||||
oracle.on('oracleResponse', ({ from, payload }) => {
|
||||
console.log(chalk.cyan(`🔮 Oracle response from ${from.substring(0, 8)}: ${JSON.stringify(payload)}`));
|
||||
// Oracle response received
|
||||
});
|
||||
|
||||
// Interactive commands
|
||||
|
||||
Referencia en una nueva incidencia
Block a user