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 · 2 comments
Open

Plugins: Add StorageAPI #208

fubuloubu opened this issue Oct 28, 2021 · 2 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

@antazoey
Copy link
Member

antazoey commented Jul 8, 2024

Question: Is there a default StorageAPI implementation we will want to ship with core Ape?

@fubuloubu
Copy link
Member Author

fubuloubu commented Jul 9, 2024

Question: Is there a default StorageAPI implementation we will want to ship with core Ape?

I think this concept got muddied up over the years, the current iteration of this idea is formalizing package and source querying capability via the query system, so it is possible to find packages (and publish) using multiple sources instead of just etherscan or disk cache. The "default implementation" we'd want to ship with Ape is whatever we want to use for publishing sources officially out of the box

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

3 participants