Change code structure to use blocks
Description
To go forward with our objective of exchanging blocks of data between peers, the entire codebase as been modifier to use blocks instead of Vec (except for the functions that do the actual data send, where the data needs to be serialized to be sent over a stream / socket).
List of changes
- Use Block<F,G> everywhere where necessary
- Komodo is now a submodule git for Dragoonfly (this might require a setup step to ensure it works everywhere, with a
git submodule init komodo
- Store a test setup as a file in dragoonfly to not generate it each time
- Change the CLI in Nushell to work with the new structure
- Rewrite a part of handle_command to use functions that return errors for a better error handling (more parts of the code will probably follow in the same logic), as before we were forced to match and return through the sender if there was an error (which led to giant match pyramids)
Known bug
There is a bug also present in the main that happens when we get the record via kademlia, which is due to a mix between two incompatible handling of file exchanging, where one method will delete the queryID of the exchange before kademlia finished its own request. The fix will be implemented in the next PR and involves changing the way file exchanges are made, by querying the providers of a given file and not requesting the file through Kademlia
Additional notes
- Tests don't work yet with the CLI due to the previously mentioned bug
- For an unknown reason, doing the same thing as the test but directly with the CLI will generate the errors but still manage to make a successful file exchange (at least on my end, which is why I would like any reviewer to pull the branch and follow the steps of the
message_exchange
test to see if they can successfully exchange a small image for example)
Edited by DISSOUBRAY Nathan