Ejemplo n.º 1
0
 def send_get_blocks(self, block_slot_or_root: Union[BlockNumber, Hash32],
                     max_blocks: int) -> None:
     cmd = GetBeaconBlocks(self.cmd_id_offset, self.snappy_support)
     data = {
         'block_slot_or_root': block_slot_or_root,
         'max_blocks': max_blocks,
     }
     header, body = cmd.encode(data)
     self.send(header, body)
Ejemplo n.º 2
0
 def send_get_blocks(self, block_slot_or_root: Union[Slot, Hash32],
                     max_blocks: int, request_id: int) -> None:
     cmd = GetBeaconBlocks(self.cmd_id_offset, self.snappy_support)
     header, body = cmd.encode(
         GetBeaconBlocksMessage(
             request_id=request_id,
             block_slot_or_root=block_slot_or_root,
             max_blocks=max_blocks,
         ))
     self.transport.send(header, body)