IPFS Pub Sub
Description
Pub/Sub in general uses ifps-pubsub library which is using the libp2p gossip protocol
All communications should be defined in OpenAPI yaml files under the project gRPCForSuperGenius.
The readme for how to generate C++ code is in the README.md in that project
Processing pub/sub
After a processing block is in the database, the processing nodes (clients device), syncs to the database using CRDT system. Once they find a node to be processed they use pub/sub to Join or Create pub/sub room for processing a set of blocks.
On the SGNUS SDK side, it should be fairly straightforward to make functions for multiple devices, basically using pub/sub over ipfs to communicate to find microjobs. The node grabbing the job can break it up into 10 microjobs and publish a channel. The channel could have jobprocessing_%BLOCKID% in which BLOCKID is the CRDT database node that contains the processing information.
Each of these rooms would then have a sub-room which is the microjobs #. For instance, if there are 1,000 sub-blocks to process, then there would be 100 1,000/10 microjob rooms.
jobprocessing_%BLOCKID%_%MICROJOB% pub/sub channel/room
The pub/sub ARE nodes to find microjobs, this is very similar to a game player looking for a lobby to join a peer-to-peer game.
The pub/sub to find jobs is basically a cache of jobs in the queue eventually.
Each processing node will use the function in Genius SDK to get MicroJob and then publish the results. Right now the processing can be stubbed out like this.
Handling of processing grid structure changes
If a host leaves, somebody else will have to take the position by either recreating the microjob list or grabbing it on the first entry into the room.
Also if a peer leaves the room (drops connection) or doesn't respond within XX timelimit for processing, they get kicked out of the room so another can process the data. Each room (pub/sub topic) also has a limit of # processors to join. Probably 11 to start. 10 processors and 1 verifier node. The verifier is randomly chosen and it is unknown by anybody even the verifier until all processing is done and they have to submit to SGNUS node that processing is complete and verified.
Processing Chunks.
A Chunk structure is defined to allow widths and strides (line and block) to be able to define sub-blocks within a data stream.