Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
algorand
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nilak
algorand
Commits
3f7afffa
Commit
3f7afffa
authored
Apr 16, 2019
by
THAKARE AKSHAY HARIBHAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jotted down the algorand algo in monolithic format
parent
d0179bd3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
1 deletion
+75
-1
Node.py
Node.py
+4
-1
OverlayNode.py
OverlayNode.py
+38
-0
TestTodoList.py
TestTodoList.py
+33
-0
No files found.
Node.py
View file @
3f7afffa
...
...
@@ -54,6 +54,9 @@ class Node(SystemEntity):
payload
.
pop
(
0
)
# removed source header
payload
.
pop
(
0
)
#removed destination header
def
startNodeLifeCycle
(
self
):
pass
def
simulate
(
self
,
time
):
# self.logger.info("simulating .. ")
...
...
@@ -84,7 +87,7 @@ class Node(SystemEntity):
# not task pending at this time
pass
pass
if
__name__
==
'__main__'
:
# node = Node('1')
...
...
OverlayNode.py
View file @
3f7afffa
...
...
@@ -10,6 +10,44 @@ class OverlayNode(Node):
super
(
OverlayNode
,
self
)
.
processMessage
(
time
,
payload
)
print
(
"from overlay node : "
+
str
(
payload
))
def
startNodeLifeCycle
(
self
):
'''THis is monolithic algorand algorithm for a NOde'''
while
True
:
#increment round number
'''
TODo check if node is selected as BLOCK_PROPOSER
if yes
then
select highest priority subuser and gossip the message
wait for lambda_proposer=3 sec and hear other block propositions
take decision based on received propositions and determine if himself is a highest priority or not
if yes
broacast the block proposal <format of block proposal>
everybody except highest priority block proposer waits for t_proposer+t_block time to here the proposed block
if received proposal
then
start BA* with this new block
validate sortition of proposed block
if yes
then
start reduction
else
vote for empty block
else
start BA* with empty block
'''
pass
pass
...
...
TestTodoList.py
View file @
3f7afffa
...
...
@@ -124,6 +124,38 @@ def testclassLessGenerator():
print
(
task
)
print
(
i
)
class
TestYieldSequence
:
def
__init__
(
self
):
self
.
o
=
self
.
A
()
def
A
(
self
):
print
(
"started A"
)
yield
2
print
(
"Finishing A"
)
def
B
(
self
):
print
(
"Started B"
)
try
:
next
(
self
.
o
)
except
StopIteration
:
pass
print
(
"Ending B"
)
def
C
(
self
):
print
(
"started C"
)
try
:
next
(
self
.
o
)
except
StopIteration
:
pass
print
(
"Ending C"
)
def
testExecutionSequenceYield
(
self
):
self
.
B
()
self
.
C
()
if
__name__
==
'__main__'
:
# testSortition()
# testVerifyVRF()
...
...
@@ -131,3 +163,4 @@ if __name__ == '__main__':
# testclassLessGenerator()
# testGeneratorClass()
testSelfReferGen
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment