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

Plugins: Add StorageAPI #208

Open
fubuloubu opened this issue Oct 28, 2021 · 0 comments
Open

Plugins: Add StorageAPI #208

fubuloubu opened this issue Oct 28, 2021 · 0 comments
Labels
category: feature New feature or request

Comments

@fubuloubu
Copy link
Member

fubuloubu commented Oct 28, 2021

Overview

Add support for lookups to various file storage locations, such as over http/https (via requests as 1st class plugin), ipfs/ipns/ipld (via py-ipfs-http-client or Infura, etc.), and any other relevant URI types which share data (Swarm is... still a thing bzz://...).

Use cases may include: downloading projects and manifest files, uploading/pinning manifest files, fetching source code, querying ethereum data (cached via IPLD), storing contract ABIs and bytecode, etc.

Specification

class StorageAPI:
    @property
    def uri_types(self) -> Set[Uri]:
        """Set of URI Types that this plugin handles"""

    def fetch(self, uri: Uri) -> Deserializable:
        """Obtain content at URI and store it on disk, returning file handle to content"""
        # NOTE: URI Type must be in `self.uri_types`
        # NOTE: Content can be cached in plugin data folder, or via other means (IPFS client data folder)
        # NOTE: Path returned can be a file or folder, handle appropriately

    def push(self, content: Serializable) -> Uri:
        ...

Dependencies

No dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants