fix: support POST-only API of go-ipfs 0.5

go-ipfs 0.5  will block `GET` commands on the API port, requiring
every  command (RPC) to be sent as HTTP `POST` request.

This bumps ipfs-http-client version to 41.0.1, which sends only POST requests
while maintaining the old API (async iterators that landed in 42.x)

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
This commit is contained in:
Marcin Rataj 2020-04-21 23:04:49 +02:00 committed by Mark Robert Henderson
parent f2cfaa8d1a
commit 2115820e18
3 changed files with 574 additions and 440 deletions

View File

@ -160,14 +160,17 @@ initIPFSInstance().then(ipfs => {
```
### Module with IPFS Daemon
Alternatively, you can use [ipfs-api](https://npmjs.org/package/ipfs-api) to use `orbit-db` with a locally running IPFS daemon. Use this method if you're using `orbitd-db` to develop **backend** or **desktop** applications, eg. with [Electron](https://electron.atom.io).
Alternatively, you can use [ipfs-http-client](https://www.npmjs.com/package/ipfs-http-client) to use `orbit-db` with a locally running IPFS daemon. Use this method if you're using `orbitd-db` to develop **backend** or **desktop** applications, eg. with [Electron](https://electron.atom.io).
Install dependencies:
```
npm install orbit-db ipfs-http-client
npm install orbit-db ipfs-http-client@41.0.1
```
**Note:** need to use v41.0.1 until support for modern JS API is added in [orbit-db#767](https://github.com/orbitdb/orbit-db/pull/767).
```javascript
const IpfsClient = require('ipfs-http-client')
const OrbitDB = require('orbit-db')

1000
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -45,9 +45,9 @@
"cross-env": "^6.0.3",
"datastore-level": "~0.14.0",
"fs-extra": "^7.0.1",
"go-ipfs-dep": "~0.4.20",
"go-ipfs-dep": "~0.4.23-3",
"ipfs": "~0.40.0",
"ipfs-http-client": "~37.0.1",
"ipfs-http-client": "~41.0.1",
"ipfs-repo": "~0.30.1",
"ipfsd-ctl": "~0.42.3",
"localstorage-level-migration": "~0.1.0",
@ -85,6 +85,9 @@
"build:docs/toc": "markdown-toc --no-first1 -i README.md && markdown-toc --no-first1 -i API.md && markdown-toc --no-first1 -i GUIDE.md && markdown-toc --no-first1 -i CHANGELOG.md && markdown-toc --no-first1 -i FAQ.md ",
"build:es5": "babel src --out-dir ./dist/es5/ --presets babel-preset-env --plugins babel-plugin-transform-runtime"
},
"go-ipfs": {
"version": "v0.5.0-rc2"
},
"standard": {
"env": "mocha",
"ignore": [