Skip to content

Add function to update a CAR file from a CAR slice (diff). #543

@groceryheist

Description

@groceryheist

I want to periodically update a local snapshot (repo_snapshot) of a repo with a known did repodid. The snapshot is a CAR_file corresponding to a known commit rev. I can get a CAR file which is a "diff" (aka CAR slice) between the snapshot and the current repo state:

paramsdict = models.ComAtprotoSyncGetRepo.ParamsDict(did=repodid, since=rev)
repo_diff = client.com.atproto.sync.get_repo(params=paramsdict)

I want to update my snapshot CAR file from the diff. I imagine a function such as

updated_snapshot = CAR.utils.update(repo_snapshot, repo_diff)

The reason is to efficiently keep an almost-up to date local copy of a repo using bandwidth efficiently without having to handle the firehose.

This functionality might already be available in packages for manipulating merkle search trees, but I want to suggest that this package include such functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions