Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create new core data & blockstore that acts as a cache/buffered store #287

Open
SgtPooki opened this issue Jan 4, 2024 · 0 comments
Assignees
Labels
dif/medium Prior experience is likely helpful effort/days Estimated to take multiple days, but less than a week kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up status/in-progress In progress

Comments

@SgtPooki
Copy link
Member

SgtPooki commented Jan 4, 2024

see ipfs/helia-http-gateway#18

We should be able to use a store like so:

import { BufferedBlockstore, MemoryBlockstore } from 'blockstore-core'
import { LevelBlockstore } from 'blockstore-level'

const myBlockStore = new BufferedBlockstore(new MemoryBlockstore(), new LevelBlockstore('path'), {})

That would take any blockstore as a "fronting" blockstore, and another blockstore as a "backing" blockstore, and would use the front blockstore for immediate writes (cache), and flush that data to the backing blockstore according to some criteria.

This should work similar to https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/network/peers/datastore.ts?rgh-link-date=2023-10-19T14%3A35%3A02Z#L71 but be more generic (i.e. not just for peer data)

@SgtPooki SgtPooki added the need/triage Needs initial labeling and prioritization label Jan 4, 2024
@SgtPooki SgtPooki self-assigned this Jan 4, 2024
@SgtPooki SgtPooki added P1 High: Likely tackled by core team if no one steps up dif/medium Prior experience is likely helpful effort/days Estimated to take multiple days, but less than a week kind/enhancement A net-new feature or improvement to an existing feature status/in-progress In progress and removed need/triage Needs initial labeling and prioritization labels Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dif/medium Prior experience is likely helpful effort/days Estimated to take multiple days, but less than a week kind/enhancement A net-new feature or improvement to an existing feature P1 High: Likely tackled by core team if no one steps up status/in-progress In progress
Projects
Status: 🏃‍♀️ In Progress
Development

No branches or pull requests

1 participant