This repository was archived by the owner on Mar 10, 2020. It is now read-only.
v40.0.0
Code Refactoring
- async await roundup (#1173) (3e5967a), closes #1103
- convert config API to async await (#1155) (621973c)
- move files to root level (#1150) (559a97d)
Features
Reverts
BREAKING CHANGES
- The
log.tailmethod now returns an async iterator that yields log messages. Use it like:for await (const message of ipfs.log.tail()) { console.log(message) }
- The response to a call to
log.levelnow returns an object that has camel cased keys. i.e.MessageandErrorproperties have changed tomessageanderror. - Dropped support for go-ipfs <= 0.4.4 in
swarm.peersresponse. - The signature for
ipfs.mounthas changed fromipfs.mount([ipfsPath], [ipnsPath])toipfs.mount([options]). Whereoptionsis an optional object that may contain two boolean propertiesipfsPathandipnsPath. The response object has also changed to be camel case. See https://docs.ipfs.io/reference/api/http/#api-v0-mount. - Default ping
countof 1 in client has been removed. The default ping count is now whatever the IPFS node defaults it to (currently 10). If you specifically need 1 ping message then please passcount: 1in options foripfs.ping(). - Multi parameter constructor options are no longer supported. To create a new IPFS HTTP client, pass a single parameter to the constructor. The parameter can be one of:
- String, formatted as one of:
- Multiaddr e.g. /ip4/127.0.0.1/tcp/5001
- URL e.g. http://127.0.0.1:5001
- Multiaddr instance
- Object, in format of either:
- Address and path e.g.
{ apiAddr: '/ip4/127.0.0.1/tcp/5001': apiPath: '/api/v0' }(Note:apiAddrcan also be a string in URL form or a Multiaddr instance) - Node.js style address e.g.
{ host: '127.0.0.1', port: 5001, protocol: 'http' }
- Address and path e.g.
- String, formatted as one of:
- Errors returned from request failures are now all
HTTPErrors which carry aresponseproperty. This is aResponsethat can be used to inspect all information relating to the HTTP response. This means that theerr.statusorerr.statusCodeproperty should now be accessed viaerr.response.status. - files in
src/files-regularhave moved tosrc. Thesrc/files-mfsdirectory has been renamed tosrc/files. If you were previously requiring files from these directories e.g.require('ipfs-http-client/src/files-regular/add')then please be aware that they have moved. - Kebab case options are no longer supported. Please use camel case option names as defined in the
interface-ipfs-coredocs. e.g. theallow-offlineoption toname.publishshould be passed asallowOffline.- Note that you can pass additional query string parameters in the
searchParamsoption available to all API methods.
- Note that you can pass additional query string parameters in the