Skip to content

Commit

Permalink
Update node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 21, 2024
1 parent 1ee1a28 commit 3839895
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions core/sidra-chain/node.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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;

0 comments on commit 3839895

Please sign in to comment.