Blockstore (IPLD)/KV Interface, Backed by SQLite + State Effect
zeeshanlakhani opened this issue · 0 comments
zeeshanlakhani commented
Summary
For storing resources (Wasm modules) related to IPLD blocks (Host runtime) as well as other useful block information within the context of a running workflow (Guest, State Effect), we need a way to store this information, that works by way of Wasm/Wasi execution and is persisted into SQLite (up to some time/storage limit ~ #264).
This covers multiple storage use cases.
Components
- Streaming in modules/resources & Host blockstore.
- This starts as native Rust, but can become an inject Wasm module at the top of workflows.
- Guest State Effect ~ KV/Blockstore.
- Wasm interface(s)/component(s) (separate DB).
- Host Needs:
- Ability to stream in chunks and store them.
- Question: Two separate modules or not (stream and chunk) vs. (stream and store).
- Store fetched resources as IPLD Cid (key) => bytes in a specialized table.
- Migration(s) / Schema.
- This operates with two compiled Wasm/Wasi interfaces: 1) SQLite and 2) KV-store
- References:
- https://github.com/bytecodealliance/wasmtime/tree/main/crates/component-macro/tests/codegen
- https://github.com/bytecodealliance/preview2-prototyping <----
- More looks in on spin: https://github.com/fermyon/spin/blob/main/wit/preview2/sqlite.wit and https://github.com/fermyon/spin/blob/main/wit/preview2/key-value.wit (and impls)
- References:
- Ability to stream in chunks and store them.
- References:
- Host Needs:
- Content handle injection
- Wasm interface(s)/component(s) (separate DB).