Commit 2b3e6ec8 authored by UNHALE NILESH ARUN's avatar UNHALE NILESH ARUN

successfully created 2 blocks

parent 1f9d4d83
0 19
0 24
0 27
1 2
1 20
1 19
0 29
0 13
1 5
1 28
2 6
3 22
3 12
4 16
4 7
4 25
5 28
5 15
2 23
2 18
3 20
3 19
3 10
3 4
4 21
4 9
4 24
5 26
5 25
5 11
6 11
6 17
6 8
6 26
7 22
7 28
7 23
8 13
8 25
8 22
8 18
9 22
9 18
9 24
10 21
9 28
10 25
10 16
11 19
11 23
12 22
12 17
13 29
14 25
14 15
12 15
12 14
12 21
13 22
14 27
14 17
14 26
15 18
15 29
16 20
17 24
18 23
18 21
18 22
23 27
25 28
15 20
16 17
17 20
19 20
19 24
21 26
22 23
23 29
25 27
27 29
......@@ -19,6 +19,7 @@ class OverlayNode(Node):
self.blockchain = [genesisBlock]
self.tentativeblockchain = []
self.currentRound = 1 # round is equivalent ot block height
self.step = 0
self.currentRoleCount = 20
......@@ -196,7 +197,6 @@ class OverlayNode(Node):
msgs = self.uniqueReceivedMessages.pop(Config.PRIORITY_MSG_type)
msgs.sort(key=lambda priority_msg_other: priority_msg_other[4])
# list(map(lambda x: x[4], msgs)) # list only priorities
self.logger.info("Priority proposals from other nodes (number of proposal, proposals) : {}".format((len(msgs),list(map(lambda x: x[4], msgs)))))
# self.logger.info("Priority proposals from other nodes (number of proposal, proposals) : {}".format((len(msgs),msgs)))
for priority_msg_other in msgs :
......@@ -693,16 +693,17 @@ class OverlayNode(Node):
if hblockSTAR == CountVotes_FINAL['return_block_hash']:
FNALIZED_BLOCK_msg = (
Config.FINALIZED_BLOCK_msg_type,hblockSTAR )
self.logger.info("broadcsting FINALIZED BLOCK : {}".format(FNALIZED_BLOCK_msg))
self.broadcast(self.network.time, FNALIZED_BLOCK_msg)
self.logger.info("FINALIZED BLOCK in round :"+str(self.currentRound)+" : {}".format(FNALIZED_BLOCK_msg))
self.blockchain.append(str((self.currentPreviousHash,hblockSTAR)))
else:
TENTATIVE_BLOCK_msg = (Config.TENTATIVE_BLOCK_msg_type, hblockSTAR)
self.logger.info("broadcsting FINALIZED BLOCK : {}".format(TENTATIVE_BLOCK_msg))
self.broadcast(self.network.time, TENTATIVE_BLOCK_msg)
self.logger.info("TENTATIVE BLOCK in round :"+str(self.currentRound)+" : {}".format(TENTATIVE_BLOCK_msg))
self.tentativeblockchain.append(str((self.currentPreviousHash,hblockSTAR)))
self.logger.info("BLOCKCHAIN : {}".format(self.blockchain))
# self.logger.info(self.uniqueReceivedMessages)
yield "resume", 40000
yield "resume", 40
......
......@@ -12,7 +12,7 @@ class TimeSimulator(object):
return "Time : "+ str(self._systemTime)
def startTicking(self,callback):
for i in range(10000):
for i in range(100000):
self._systemTime = self._systemTime + 1
logger.info(self)
callback(str(self._systemTime))
......
......@@ -7,5 +7,5 @@ rm -rf ASim.log
rm -rf console.log
python3 Starter.py > console.log
#python3 Starter.py | tee console.log
\ No newline at end of file
#python3 Starter.py > console.log
python3 Starter.py | tee console.log
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment