IPFS Module
- class ipfs_dict_chain.IPFS.IPFSCache[source]
Bases:
object
A simple cache for IPFS data.
- exception ipfs_dict_chain.IPFS.IPFSError[source]
Bases:
Exception
Custom exception for IPFS-related errors.
- async ipfs_dict_chain.IPFS._add_json(data: Dict) str [source]
Add JSON data to IPFS and return its Content Identifier (CID).
- Parameters:
data (Dict) – The JSON data to be added to IPFS.
- Returns:
The Content Identifier (CID) of the added JSON data.
- Return type:
- async ipfs_dict_chain.IPFS._get_json(cid: str) Dict [source]
Retrieve JSON data from IPFS by its Content Identifier (CID) and cache the result.
- Parameters:
cid (str) – The Content Identifier (CID) of the JSON data in IPFS.
- Returns:
The JSON data retrieved from IPFS.
- Return type:
Dict
- ipfs_dict_chain.IPFS.add_json(data: Dict) str [source]
Add JSON data to IPFS and return its Content Identifier (CID) using a synchronous wrapper.
- Parameters:
data (Dict) – The JSON data to be added to IPFS.
- Returns:
The Content Identifier (CID) of the added JSON data.
- Return type: