Can only publish to an IPFS daemon running on localhost:5001
#345 opened on May 14, 2021
Repository metrics
- Stars
- (49 stars)
- PR merge metrics
- (PR metrics pending)
Description
We create an IPFS HTTP Client here https://github.com/ipfs/distributions/blob/7d79fddb8dee3fda74a5b0728da8478db1b2f97d/scripts/dist.js#L23 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.
- Read environment variable
- Read API addr from file https://github.com/ipfs/go-ipfs-http-client/blob/3af36210f80fb86aae50da582b494ceddd64c3de/api.go#L70
- 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)