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

Can only publish to an IPFS daemon running on localhost:5001 #345

Open
aschmahmann opened this issue May 14, 2021 · 3 comments
Open

Can only publish to an IPFS daemon running on localhost:5001 #345

aschmahmann opened this issue May 14, 2021 · 3 comments
Labels
dif/easy Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now

Comments

@aschmahmann
Copy link
Contributor

We create an IPFS HTTP Client here

const ipfs = IpfsHttpClient()
which per the examples uses the default local go-ipfs port https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client#example.

It would be great if this could use the IPFS_PATH environment variable to attempt to locate the API file which will have a multiaddr in it and then pass that multiaddr into the HTTP client.

  1. Read environment variable
  2. Read API addr from file https://github.com/ipfs/go-ipfs-http-client/blob/3af36210f80fb86aae50da582b494ceddd64c3de/api.go#L70
  3. Convert multiaddr into IPv4/IPv6 URL and pass it into the client

It may even be worth upstreaming these few lines of code into the HTTP Client as an alternative construction option (WDYT @achingbrain)

@aschmahmann aschmahmann added the need/triage Needs initial labeling and prioritization label May 14, 2021
@lidel lidel added dif/easy Someone with a little familiarity can pick up P3 Low: Not priority right now effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature and removed need/triage Needs initial labeling and prioritization labels May 21, 2021
@lidel
Copy link
Member

lidel commented May 21, 2021

@aschmahmann we triaged this as P3, but lmk if its blocking you on anything.

ps. http-client library accepts both URL and Multiaddr these days: https://github.com/ipfs/js-ipfs/blob/00fd709a7b71e7cf354ea452ebce460dd7375d34/packages/ipfs-http-client/src/lib/core.js#L32

@aschmahmann
Copy link
Contributor Author

ok, so just reading the environment variable and related file then. It'd be nice to fix this since it's probably just a few lines of code, but it's operationally not too hard to work around once you know the issue is there 😄.

If someone decides to do this should it just be done in this repo or upstreamed to the http client?

@lidel
Copy link
Member

lidel commented May 22, 2021

I could open upstream PR so ipfs-http-client running in Node could leverage presence of process.env.IPFS_PATH for improving the default behavior, but it should be ignored in browser – @achingbrain does this sound like something you want in ipfs-http-client or should I open PR here instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dif/easy Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now
Projects
None yet
Development

No branches or pull requests

2 participants