Пример #1
0
 async def on_connect(self, peer: WSChiaConnection):
     # Sends a handshake to the harvester
     msg = harvester_protocol.HarvesterHandshake(
         self.get_public_keys(),
         self.pool_public_keys,
     )
     if peer.connection_type is NodeType.HARVESTER:
         msg = Message("harvester_handshake", msg)
         await peer.send_message(msg)
Пример #2
0
 async def _on_connect(self):
     # Sends a handshake to the harvester
     pool_sks: List[PrivateKey] = [
         PrivateKey.from_bytes(bytes.fromhex(ce))
         for ce in self.key_config["pool_sks"]
     ]
     msg = harvester_protocol.HarvesterHandshake(
         [sk.get_public_key() for sk in pool_sks])
     yield OutboundMessage(NodeType.HARVESTER,
                           Message("harvester_handshake", msg),
                           Delivery.BROADCAST)
Пример #3
0
 async def _on_connect(self):
     # Sends a handshake to the harvester
     msg = harvester_protocol.HarvesterHandshake(self._get_public_keys(),
                                                 self.pool_public_keys)
     yield OutboundMessage(NodeType.HARVESTER,
                           Message("harvester_handshake", msg),
                           Delivery.RESPOND)
     if self.current_weight in self.challenges:
         for posf in self.challenges[self.current_weight]:
             message = harvester_protocol.NewChallenge(posf.challenge_hash)
             yield OutboundMessage(
                 NodeType.HARVESTER,
                 Message("new_challenge", message),
                 Delivery.BROADCAST,
             )
Пример #4
0
 async def _on_connect(self):
     # Sends a handshake to the harvester
     msg = harvester_protocol.HarvesterHandshake(self.pool_public_keys)
     yield OutboundMessage(NodeType.HARVESTER,
                           Message("harvester_handshake", msg),
                           Delivery.RESPOND)