import blockchain; import extensions; // version 0.0.1 Ping message union PingPayload { Ping, Pong, } table PingMessage { payload: PingPayload, } table Ping { nonce: Uint32, } table Pong { nonce: Uint32, } vector NodeVec ; vector Node2Vec ; array Uint16 [byte; 2]; option PortOpt (Uint16); // discovery 0.0.1 union DiscoveryPayload { GetNodes, Nodes, } table DiscoveryMessage { payload: DiscoveryPayload, } table GetNodes { version: Uint32, count: Uint32, listen_port: PortOpt, } table GetNodes2 { version: Uint32, count: Uint32, listen_port: PortOpt, required_flags: Uint64, } table Nodes { announce: Bool, items: NodeVec, } table Nodes2 { announce: Bool, items: Node2Vec, } table Node { addresses: BytesVec, } table Node2 { addresses: BytesVec, flags: Uint64, } // identify 0.0.1 vector AddressVec
; table Address { bytes: Bytes, } table IdentifyMessage { // These are the addresses on which the peer is listening as multi-addresses. listen_addrs: AddressVec, // Observed each other's ip observed_addr: Address, // Custom message to indicate self ability, such as list protocols supported identify: Bytes, }