Add required methods for decentralised consensus

This commit is contained in:
Michael Pivato
2019-01-15 09:29:24 +10:30
parent e6db8c8882
commit 96582b3657

View File

@@ -1,3 +1,6 @@
import paho.mqtt.client as mqtt
import time
class Voter:
'''
This class acts to replicate sensor information with the network to come to a consensus
@@ -19,8 +22,21 @@ class Voter:
on_vote: Callback to get the required vote to broadcast.
'''
self.on_vote = on_vote
self.client = mqtt.Client()
def submit_vote(self):
# Publish to swarm where all other voters will receive a vote.
# Wait a certain amount of time for responses, then fuse the information.
self.fuse_algorithm()
# Need the error and number of timestamps since voting started to finalise the consensus.
def fuse_algorithm(self):
pass
def
def on_message(self, client, userdata, message):
pass