diff --git a/blockchain_integration/pi_network/dapi/blockchain/data/storage/ipfs/ipfs.h b/blockchain_integration/pi_network/dapi/blockchain/data/storage/ipfs/ipfs.h new file mode 100644 index 000000000..d72b97191 --- /dev/null +++ b/blockchain_integration/pi_network/dapi/blockchain/data/storage/ipfs/ipfs.h @@ -0,0 +1,37 @@ +#ifndef IPFS_H +#define IPFS_H + +#include +#include +#include +#include +#include + +class IPFS { +public: + IPFS(const std::string& repo_path); + ~IPFS(); + + // Add a file to the IPFS repository + void add_file(const std::string& file_path); + + // Get a file from the IPFS repository + std::string get_file(const std::string& cid); + + // Pin a file to the IPFS repository + void pin_file(const std::string& cid); + + // Unpin a file from the IPFS repository + void unpin_file(const std::string& cid); + + // Get a list of all files in the IPFS repository + std::vector list_files(); + +private: + std::string repo_path_; + std::unordered_map file_map_; + libp2p::crypto::Key private_key_; + libp2p::crypto::Hash hash_function_; +}; + +#endif // IPFS_H