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

Filecoin Integration #513

Closed

Conversation

richardblythman
Copy link

Filecoin integration from core tech earmarks.
Works with complementary PR to ocean.py.

Changes proposed in this PR:

  • Check if file content is encrypted, and if so decrypt
  • Create an environmental variable for Filecoin urls
  • Add functionality for working with new Filecoin file structure object
  • Add tests for getting download url and building download response

@LoznianuAnamaria
Copy link

LoznianuAnamaria commented Jul 8, 2022

Hi @richardblythman 😄 Thanks for opening up this PR!

We are currently working on some architectural adjustments to make file storage integrations easier. The changes are now in review/testing.
Once the architectural changes are merged, please rebase your PR against the main and do the necessary adjustments for the new OOP file structure.
Thank you 🙏

@calina-c
Copy link
Contributor

Hi, Richard! The new file backend architecture has been merged to accomodate easier integration of new backends. Can you please rebase? Feel free to ask if you have any questions about the new flow.

@richardblythman
Copy link
Author

Hi @AnaLoznianu and @calina-c. Thanks for your messages.
I just rebased the PR as requested. There is still some work to do on making the tests pass, so I marked this as a draft for now.

if self.type != "ipfs":
filename = url.split("/")[-1]
else:
filename = "ipfs_file"
Copy link
Contributor

Choose a reason for hiding this comment

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

In my #485, I created a get_filename() method on the EndUrlType. I think this approach makes sense because it pushes filename responsibility to the FileType rather than handling all possible file types here.

https://github.com/oceanprotocol/provider/pull/485/files#diff-93405ed414e4da17f9e0876341cceb4f2ab1f6ffc30bf0d2a5b06322fb1b2e98R194

Then for IPFS and Arweave file types, I used uuid4() to create a unique file name (in case there are multiple files associated with a given datatoken, I don't want the 2nd one to overwrite the first)

https://github.com/oceanprotocol/provider/pull/485/files#diff-d338e9aa7d024035ea7b7f8ba54c49b3f1811620fa57a0e3d3f7b8686c9ea8e5R70-R72

Would you be open to changing your implementation to match mine?

@LoznianuAnamaria
Copy link

The work is done in the DBS. Closing it for now

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

Successfully merging this pull request may close these issues.

None yet

4 participants