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

refactor: remove path and ref from module args also findBin #458

Merged
merged 5 commits into from
Feb 10, 2020

Conversation

hugomrdias
Copy link
Member

@hugomrdias hugomrdias commented Feb 10, 2020

Since we're not passing modules to .spawn() there's no danger of passing module refs over http, so we can remove the .path and .ref arguments when specifying which ipfs-http-client and ipfs modules to use, instead setting them up when you configure the daemon factory, either in-proc or as a server in an .aegir file.

Also removes the findBin command magic in favour of being explicit about which binary you want the factory to use.

If you need to support env vars like IPFS_GO_EXEC, do that when you set up the factory, for example:

const factory = createFactory({
  ipfsBin: process.env.IPFS_GO_EXEC || require('go-ipfs-dep').path()
})

Also fixes up the examples and upgrades the ipfs dep to run tests against the async/await refactor.

BREAKING CHANGES:

  • .path and .ref args removed from ipfsModule and ipfsHttpModule
  • findBin function removed

Since we're not passing modules to `.spawn()` there's no danger of
passing module refs over http, so we can remove the `.path` and
`.ref` arguments when specifying which `ipfs-http-client` and `ipfs`
modules to use, instead setting them up when you configure the
daemon factory, either in-proc or as a server in an `.aegir` file.

Also removes the `findBin` command magic in favour of being explicit
about which binary you want the factory to use.

If you need to support env vars like `IPFS_GO_EXEC`, do that when
you set up the factory.

BREAKING CHANGES:

- `.path` and `.ref` args removed from `ipfsModule` and `ipfsHttpModule`
- `findBin` function removed
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.

2 participants