From 3839895bb9e3fec0a697c75c2d8ce1be78971101 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sun, 21 Jul 2024 20:03:32 +0700 Subject: [PATCH] Update node.js --- core/sidra-chain/node.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/core/sidra-chain/node.js b/core/sidra-chain/node.js index 1deba53..92b11b8 100644 --- a/core/sidra-chain/node.js +++ b/core/sidra-chain/node.js @@ -1,9 +1,9 @@ -import { SidraChain } from './chain'; +import { Consensus } from './consensus'; class SidraNode { constructor() { - this.chain = new SidraChain(); - this.network = null; + this.stake = 0; + this.consensus = new Consensus(this); } init() { @@ -17,6 +17,18 @@ class SidraNode { sendMessage() { // Send messages to other nodes } + + updateStake(stake) { + // Update the node's stake + } + + proposeBlock() { + // Propose a new block to the network + } + + voteOnBlock(block) { + // Vote on a proposed block + } } export default SidraNode;