Algorithm 1 PBFT Consensus for Block Addition in Blockchain by Cloud Server |
-
1:
Input: Block as shown in Figure 3, transactions pool , transactions threshold , number of nodes: , minimal approval
-
2:
Output: Commitment for block addition ()
-
3:
Assume that a cloud server node () is elected as a leader
-
4:
picks a fresh timestamp and creates a block with
-
5:
sets and sends to follower cloud server nodes () for voting request
-
6:
for each follower do
-
7:
if (() and () and () and ()) then
-
8:
Set
-
9:
end if
-
10:
end for
-
11:
if () then
-
12:
Add to the blockchain
-
13:
Broadcast commitment message to
-
14:
end if
|