-
Notifications
You must be signed in to change notification settings - Fork 10
Network
xiaocong edited this page Nov 7, 2018
·
10 revisions
The following diagram lists all fields of Network Protocol.
|-------byte-------|------byte------|------byte------|------byte------| (4bytes)
|---HeaderLength---|
|-------------------------------- Magic ------------------------------|
|-------------------------------- Code -------------------------------|
|-------------------------------- DataLength -------------------------|
|-------------------------------- DataChecksum -----------------------|
|-------------------------------- Reserved ---------------------------|
|-------------------------------- Body -------------------------------|
- Magic
- Code
- DataLength
- DataChecksum
- Reserved
- Body
- The total length of the message header.
- Check for if the message is for Mainnet or Testnet.
- Stand for the types of message:
- 0x00 Ping
- 0x01 Pong
- 0x02 PeerDiscover
- 0x03 PeerDiscoverReply
- 0x04 NewBlockMsg
- 0x05 TransacionMsg
- 0x10 LocateForkPointRequest
- 0x11 LocateForkPointResponse
- 0x12 BlockChunkRequest
- 0x13 BlockChunkResponse
- The total length of message body.
- The CRC32 checksum of the data.
- reserved field.
- The message body.
- The body length is dynamically expanding, the maximum length is 512MB.