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

IPFS: use IPFS Gateway API #5600

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

IPFS: use IPFS Gateway API #5600

wants to merge 2 commits into from

Conversation

isum
Copy link
Contributor

@isum isum commented Aug 13, 2024

This PR implements a new IPFS client that connects and sends requests to the IPFS Gateway. The existing IPFS RPC API client has been refactored to reuse new code.

The --ipfs CLI argument accepts both IPFS Gateway URLs and RPC API URLs, and the appropriate client is automatically detected and created.

Closes #5573

Todos

  • Clean up tests affected by the changes
  • Add unit tests for new clients

@isum isum self-assigned this Aug 13, 2024
@isum isum force-pushed the ion/use-ipfs-gateway-api branch 3 times, most recently from 60c8b2d to 465e4fc Compare August 15, 2024 16:22
@fordN fordN requested a review from mangas August 26, 2024 15:52
Introduces a new IPFS gateway client, refactoring the existing
RPC API client to reuse the new code. Also introduces some new
types and concepts to make working with IPFS easier.
Integrates the new IPFS types and clients into the existing codebase,
replacing the old types and client.
Box::new(self)
}

async fn send_test_request(&self) -> anyhow::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this is trying to achieve, is this only used for tests or is this a check for something specific? If it's only used for tests, could it be marked with cfg(test) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test requests are used to check which type of API a server address supports (RPC or Gateway) in order to initialize the appropriate client.

Copy link
Contributor

@mangas mangas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, I think this should be tested in the integration cluster before merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use IPFS gateway API
3 participants