mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-10-07 22:57:07 +00:00
Merge remote-tracking branch 'refs/remotes/origin/main'
This commit is contained in:
@@ -16,13 +16,17 @@ const ManifestStore = async ({ ipfs, storage } = {}) => {
|
||||
*/
|
||||
|
||||
storage = storage || await ComposedStorage(
|
||||
await LRUStorage({ size: 1000 }),
|
||||
await LRUStorage({ size: 100000 }),
|
||||
await IPFSBlockStorage({ ipfs, pin: true })
|
||||
)
|
||||
|
||||
const get = async (address) => {
|
||||
const bytes = await storage.get(address)
|
||||
const { value } = await Block.decode({ bytes, codec, hasher })
|
||||
if (value) {
|
||||
// Write to storage to make sure it gets pinned on IPFS
|
||||
await storage.put(address, bytes)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
|
||||
@@ -318,6 +318,8 @@ const Log = async (identity, { logId, logHeads, access, entryStorage, headsStora
|
||||
/* 6. Add the new entry to heads (=union with current heads) */
|
||||
await _heads.add(entry)
|
||||
|
||||
await _entries.put(entry.hash, entry.bytes)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user