예제 #1
0
 def get_PULL_DATA(self):
     payload = dict(_NAME_=MsgPullData.NAME,
                    identifier=MsgPullData.IDENT,
                    ver=2,
                    token=random.randint(0, 2**16 - 1),
                    MAC=self.mac)
     payload_raw = encode_message(payload)
     return payload_raw, (self.server_address, self.port_up)
예제 #2
0
 def __get_PUSH_DATA__(self, payload):
     """
     Sends PUSH_DATA message to miner with payload contents
     :param payload: raw payload
     :return:
     """
     top = dict(_NAME_=MsgPushData.NAME,
                identifier=MsgPushData.IDENT,
                ver=2,
                token=random.randint(0, 2**16 - 1),
                MAC=self.mac,
                data=payload)
     payload_raw = encode_message(top)
     return payload_raw, (self.server_address, self.port_up)