Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

IPFSHostWithLocalReader does not respect the port parameter #10

Open
jeichel-miovision opened this issue Aug 27, 2018 · 0 comments
Open

Comments

@jeichel-miovision
Copy link

jeichel-miovision commented Aug 27, 2018

I came across an unexpected behaviour when running IPFSHostWithLocalReader with a local IPFS Daemon with the API on 5001 and web interface on 8080 when publishing and installing an ethpm package.

I specified the following config (tried both ipfs_port: "8080" and ipfs_port: "5001")

  ethpm: {
    ipfs_host: "127.0.0.1",
    ipfs_protocol: "http",
    ipfs_port: "8080",
    registry: "0x8011df4830b4f696cd81393997e5371b93338878",
    install_provider_uri: "https://ropsten.infura.io/truffle"
  }

I did not expect IPFSHostWithLocalReader to try and visit http://127.0.0.1:80. While the base class, IPFSHost, still uses the API interface, the default class used by truffle publish, IPFSHostWithLocalReader uses the web interface with the default port based on the protocol.

Fix:
I created a commit that fixed the issue for me...
jeichel-miovision@2740d11

However, before creating a PR, I think the bug needs a better fix. I think ethpm, at least in the truffle context, might benefit from having two port properties, ipfs_api_port, and ipfs_web_port. Since I'm still relatively new to using truffle, this is a bigger task than I'm currently comfortable with as it probably affects many other trufflesuite and derivative projects.

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

No branches or pull requests

1 participant