-
Notifications
You must be signed in to change notification settings - Fork 489
fix: change from deprecated ipfs-api to ipfs-http-client #1535
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
const IpfsApi = require('ipfs-api'); | ||
const IPFS = require('ipfs-http-client'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One small thing, not really a PR blocker. Usually in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm using all constants because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd go with Michael here. I'd even rename it |
||
|
||
const __embarkIPFS = {}; | ||
|
||
|
@@ -10,7 +10,7 @@ __embarkIPFS.setProvider = function (options) { | |
try { | ||
if (!options) { | ||
self._config = options; | ||
self._ipfsConnection = IpfsApi('localhost', '5001'); | ||
self._ipfsConnection = IPFS('localhost', '5001'); | ||
self._getUrl = "http://localhost:8080/ipfs/"; | ||
} else { | ||
const ipfsOptions = {host: options.host || options.server, protocol: 'http'}; | ||
|
@@ -20,7 +20,7 @@ __embarkIPFS.setProvider = function (options) { | |
if (options.port && options.port !== 'false') { | ||
ipfsOptions.port = options.port; | ||
} | ||
self._ipfsConnection = IpfsApi(ipfsOptions); | ||
self._ipfsConnection = IPFS(ipfsOptions); | ||
self._getUrl = options.getUrl || "http://localhost:8080/ipfs/"; | ||
} | ||
resolve(self); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks embarkjs-ipfs which relies on the variable
IpfsAPI