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

Gateway improvements #180

Open
4 of 13 tasks
lidel opened this issue Feb 17, 2021 · 2 comments
Open
4 of 13 tasks

Gateway improvements #180

lidel opened this issue Feb 17, 2021 · 2 comments
Labels
epic need/analysis Needs further analysis before proceeding topic/http-api topic/http-gateway

Comments

@lidel
Copy link
Member

lidel commented Feb 17, 2021

This a placeholder for gathering references to create a more fleshed out plan.

We have distinct Gateway (/ipfs, /ipns) and API (/api/v0) endpoints today, and only the most basic read operations can be executed via Gateway.

Exposing /api/v0 on the gateway was a mistake, and we need to work towards removing the need for it.

The goal here would be to shift what is possible on the Gateway endpoints natively, so most popular operations like manipulating IPLD work without touching the advanced API.


Ordered improvements

Lower effort, high impact

Things well understood, with clear implementation plan:

High impact maintenance work

Things that do not add anything new, but need to happen to solve production issues, improve devexp, and create solid foundations for wider community to participate in Gateway work beyond MVP features listed in the section above.

Higher effort, high impact

Things that have extremely high impact, but need some additional research / design to happen.


Old Brainstorm

Below is the landscape of things worth considering.

No regrets

Things worth doing

Other ideas

Big complexity and low impact for user running it on localhost.

@lidel lidel added need/analysis Needs further analysis before proceeding need/triage Needs initial labeling and prioritization topic/http-gateway topic/http-api labels Feb 17, 2021
@lidel lidel changed the title Writable Gateway Gateway improvements Apr 15, 2021
@lidel lidel added epic and removed need/triage Needs initial labeling and prioritization labels Jun 18, 2021
@RangerMauve
Copy link

Regarding being able to POST to a gateway, I think it would be useful to support multipart/form-data in order to upload a bunch of files at once.

E.g. using the FormData API in browsers: https://developer.mozilla.org/en-US/docs/Web/API/FormData

I've done some tests in the Agregore Browser and in the ipfs-protocol-compliance-suite and it's been pretty nice for ergonomics.

Here's what it could look like from a user's perspective:

const formData = new FormData()

formData.append('file', new Blob(['hello world!']), 'example1.txt')
formData.append('file', new Blob(['Goodbye World?']), 'example2.txt')

// Post to empty directory CID
const postResponse = await fetch('ipfs://bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354/', {
  method: 'POST',
  body: formData
})

const newURL = await postResponse.text()

// newURL will be a directory with `example1.txt` and `example2.txt`

This will also play well with people using file inputs or drag and drop to upload data.

@lidel lidel pinned this issue Mar 8, 2022
@lidel
Copy link
Member Author

lidel commented Mar 11, 2022

Created ipfs/specs#375 for tracking ideas around "Writable Gateways"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic need/analysis Needs further analysis before proceeding topic/http-api topic/http-gateway
Projects
None yet
Development

No branches or pull requests

2 participants