Maintain a local database of known objects. The database should survive reboots.
Implement a function to map objects to objectids. The objectid is obtained by taking
the blake2s hash of the canonical JSON representation of the object. You can test your
function using the Genesis block and its blockid given in the protocol description.
Implement object exchange using the getobject, ihaveobject, object messages.
a) On receiving an ihaveobject message, request the sender for the object using a
getobject message if the object is not already in your database.
b) On receiving an object, ignore objects that are already in your database. Accept
objects that are new and store them in your database if they are valid.
c) Implement gossiping: Broadcast the knowledge of newly received valid objects to
your peers by sending an ihaveobject message to all your connected peers.
d) On receiving a getobject message, send the requested object if you have it in your
database
Useful links
DB interface documentation
Scope: