IPFSCache
IPFS cache that uses an index db to store ipfs results in. Will be passed to the blockchain-core for automated caching.
constructor
IPFS cache that uses an index db to store ipfs results in.
Returns
IPFSCache
instance
Example
const ipfsCache = new IPFSCache();
get
gets an cached ipfs result
Parameters
hash
- string
: ipfs hash to load the data from
Returns
Promise
returns string
: ipfs result
add
ipfsCache.add(hash, data);
adds a ipfs value into the idb store cache
Parameters
hash
- string
: ipfs hash to store the data for
data
- any
: data to store for the ipfs hash
Returns
Promise
returns void
: resolved when done