Every message received its id will be add to this list to prevent duplicate messages.
The list will contains only 2^16 ids.
| Description |
Data Type |
Comments |
| Ids |
Vec
| Contains all the network message ids |
Message types
Privmsg
| Description |
Data Type |
Comments |
| id |
String |
A Hash of all metadata including the previous Privmsg's id |
| nickname |
String |
The nickname for the sender (must be less than 32 chars) |
| target |
String |
The target for the Privmsg (recipient) |
| message |
String |
The Privmsg's content |
| timestamp |
i64 |
The timestamp for Privmsg (created by the sender) |
| read_confirms |
u8 |
A confirmation counter |
| prev_id |
String |
The id for the previous Privmsg |
Inv
On receiving a new Privmsg, the node must broadcast this message to all other nodes
| Description |
Data Type |
Comments |
| Id |
String |
A unique ID string |
| Hash |
String |
A hash of all Privmsg's metadata RIPEMD-160(Privmsg) |
GetMsgs
On receiving an Inv message if the node doesn't have the hash in Inv,
Then the node will send back a GetMsgs to request the Privmsg
| Description |
Data Type |
Comments |
| Invs |
Vec
| A list of Privmsg hashes |
SyncHash
Every 2 seconds each node must broadcast this message which contains the height of its chain
to ensure the chain remain roughly in sync.
| Description |
Data Type |
Comments |
| Height |
u64 |
The Height of the chain |
Hashes
Once receiving a SyncHash message, the node will send back all the missed hashes from the height in SyncHash
| Description |
Data Type |
Comments |
| Hashes |
Vec
| A list of Privmsg hashes |
| Height |
u64 |
The height of chain in which the first message in the Hashes list begin |