More work on persisting data to disk.

Blockstore now storing the data, whereas datastore is storing the key
and filename. The key should be the multihash (currently the sha256, not
the multihash), and the value is the filename (base32).
This commit is contained in:
jmjatlanta 2016-12-14 12:07:43 -05:00
parent 88d177cf4a
commit 033dd767b4
20 changed files with 564 additions and 57 deletions

View file

@ -64,4 +64,13 @@ int ipfs_repo_fsrepo_free(struct FSRepo* config);
*/
int ipfs_repo_fsrepo_init(struct FSRepo* config);
/***
* Write a block to the datastore and blockstore
* @param block the block to write
* @param fs_repo the repo to write to
* @returns true(1) on success
*/
int ipfs_repo_fsrepo_block_write(struct Block* block, const struct FSRepo* fs_repo);
int ipfs_repo_fsrepo_block_read(const struct Cid* cid, struct Block** block, const struct FSRepo* fs_repo);
#endif /* fs_repo_h */