From 01328a08efa805200902735960c296eaa6801851 Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Sun, 21 Jul 2024 20:05:54 +0700 Subject: [PATCH] Update protocol.js --- core/sidra-chain/protocol.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/sidra-chain/protocol.js b/core/sidra-chain/protocol.js index 9749628..58ca8c5 100644 --- a/core/sidra-chain/protocol.js +++ b/core/sidra-chain/protocol.js @@ -1,10 +1,12 @@ import { SidraChain } from './chain'; import { SidraNode } from './node'; +import { Consensus } from './consensus'; class SidraProtocol { constructor(chain, node) { this.chain = chain; this.node = node; + this.consensus = new Consensus(node); } createBlock(transactions) { @@ -20,7 +22,8 @@ class SidraProtocol { } achieveConsensus() { - // Implement a consensus mechanism to ensure network agreement + // Use the consensus mechanism to achieve agreement on a block + this.consensus.achieveConsensus(); } }