Skip to content

Expose applyOperation for backup and restore purpose - #1238

Open
pergerk wants to merge 1 commit into
orbitdb:mainfrom
pergerk:feat/expose-applyOperation
Open

pergerk wants to merge 1 commit into
orbitdb:mainfrom
pergerk:feat/expose-applyOperation

Conversation

@pergerk

@pergerk pergerk commented Sep 12, 2025 •

Copy link
Copy Markdown

Hello Team.
I'm using applyOperation for restore purpose.
@helia/car & @ipld/car helps with backup and restore but for rebuilt indexes I have to call applyOperation.
Follow the example
`
const reader = await CarReader.fromIterable(readableStream);//car file stream
await car(ipfs).import(reader, {
onProgress: () => {
blocksCount++;
},
});
for (const cid of await reader.getRoots()) {
const block = await reader.get(cid);
if(block) {
const entry = logEntryDecoder(block);
const database = getDatabaseByAddress(entry.id);
database.applyOperation(entry);
}

`
Is this action correct or I have to use another way to do this ?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant