Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

IPFS protocol for querying block data #6075

Open
gavofyork opened this issue May 19, 2020 · 2 comments
Open

IPFS protocol for querying block data #6075

gavofyork opened this issue May 19, 2020 · 2 comments
Labels
J0-enhancement An additional feature request.
Milestone

Comments

@gavofyork
Copy link
Member

gavofyork commented May 19, 2020

Substrate should provide an IPFS implementation over its libp2p to allow for querying certain data from chains. A (the?) offchain worker local storage should be able to be given data to store which can be indexed quickly with a Blake2 hash. The hash should be able to be used to query via IPFS (or is it bitswap protocol?) over libp2p in order to retrieve its preimage.

Rough API endpoints:

Two new OCW APIs:

  • publish(data: &[u8], until: BlockNumber) -> [u8; 32]
  • unpublish([u8; 32])

Preimage lookup over libp2p for anything published up until block number until and not since unpublished.

Usecase: it should be possible for any IPFS browser node to locate and retrieve unexpired data published through an OCW pubish call.

@gavofyork gavofyork added this to the Ideas milestone May 19, 2020
@gavofyork gavofyork added the J0-enhancement An additional feature request. label May 19, 2020
@xlc xlc mentioned this issue May 20, 2020
5 tasks
@expenses
Copy link
Contributor

@dvc94ch How in-development is libp2p-bitswap? I have a branch here: https://github.com/paritytech/substrate/tree/ashley-bitswap that attempts to integrate it into substrate, is libp2p-bitswap stable enough for us to do this, or does it need more work?

@dvc94ch
Copy link
Contributor

dvc94ch commented Jul 31, 2020

It works ok, although I do need to spend some time on it. There are optimizations in https://blog.ipfs.io/2020-02-14-improved-bitswap-for-container-distribution/ that aren't implemented, and there's there will likely be incompatibilities once you reach a high throughput as currently the messages aren't split into whatever the maximum message size is.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

3 participants