2022-02-22 20:34:19 +00:00
|
|
|
from enum import IntEnum, auto
|
2022-02-16 06:49:32 +00:00
|
|
|
|
2022-02-22 20:34:19 +00:00
|
|
|
class GossipCommands(IntEnum):
|
2022-02-16 06:49:32 +00:00
|
|
|
PING = 1
|
|
|
|
ANNOUNCE = auto()
|
|
|
|
PEER_EXCHANGE = auto()
|
|
|
|
STREAM_BLOCKS = auto()
|
|
|
|
PUT_BLOCKS = auto()
|
|
|
|
|
2022-02-24 07:03:50 +00:00
|
|
|
|
|
|
|
def command_to_byte(cmd: GossipCommands):
|
|
|
|
return int(cmd).to_bytes(1, 'big')
|