Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

kubo-rpc-client

ipfs63kApache-2.0 OR MIT5.1.0TypeScript support: included

A client library for the Kubo RPC API

http, http-client, ipfs, kubo, rpc, rpc-client

readme

kubo-rpc-client

ipfs.tech Discuss codecov CI

A client library for the Kubo RPC API

Table of contents

Install

$ npm i kubo-rpc-client

Browser <script> tag

Loading this module through a script tag will make it's exports available as KuboRpcClient in the global namespace.

<script src="https://unpkg.com/kubo-rpc-client/dist/index.min.js"></script>

Kubo RPC Client

JavaScript client library for the Kubo RPC API



Getting Started

We've come a long way, but this project is still in Alpha, lots of development is happening, APIs might change, beware of 🐉..

npm install --save kubo-rpc-client

Both the Current and Active LTS versions of Node.js are supported. Please see nodejs.org for what these currently are.

Next Steps

Usage

create([options])

create an instance of the HTTP API client

Parameters

None

Options

options can be a String, a URL or a Multiaddr which will be interpreted as the address of the IPFS node we wish to use the API of.

Alternatively it can be an object which may have the following keys:

Name Type Default Description
url String or URL or Multiaddr 'http://localhost:5001/api/v0' A URL that resolves to a running instance of the IPFS HTTP RPC API
protocol String 'http' The protocol to used (ignored if url is specified)
host String 'localhost' The host to used (ignored if url is specified)
port number 5001 The port to used (ignored if url is specified)
path String 'api/v0' The path to used (ignored if url is specified)
agent http.Agent http.Agent({ keepAlive: true, maxSockets: 6 }) An http.Agent used to control client behaviour (node.js only)

Returns

Type Description
Object An object that conforms to the IPFS Core API

Example

import { create } from 'kubo-rpc-client'

// connect to the default API address http://localhost:5001
const client = create()

// connect to a different API
const client = create({ url: "http://127.0.0.1:5002/api/v0" });

// connect using a URL
const client = create(new URL('http://127.0.0.1:5002'))

// call Core API methods
const { cid } = await client.add('Hello world!')

Do you use Kubo's API.Authorizations? Check the Custom Headers section.

API

kubo-rpc-client will not implement the IPFS Core API. Please see https://github.com/ipfs/kubo/issues/9125 for more information.

Additional Options

All core API methods take additional options specific to the HTTP API:

  • headers - An object or Headers instance that can be used to set custom HTTP headers. Note that this option can also be configured globally via the constructor options.
  • searchParams - An object or URLSearchParams instance that can be used to add additional query parameters to the query string sent with each request.

Instance Utils

  • ipfs.getEndpointConfig()

Call this on your client instance to return an object containing the host, port, protocol and api-path.

Static Types and Utils

Aside from the default export, kubo-rpc-client exports various types and utilities that are included in the bundle:

These can be accessed like this, for example:

import { CID } from 'kubo-rpc-client'

Glob source

A utility to allow files on the file system to be easily added to IPFS.

globSource(path, pattern, [options])
  • path: A path to a single file or directory to glob from
  • pattern: A pattern to match files under path
  • options: Optional options
  • options.hidden: Hidden/dot files (files or folders starting with a ., for example, .git/) are not included by default. To add them, use the option { hidden: true }.

Returns an async iterable that yields { path, content } objects suitable for passing to ipfs.add.

Example
import { create, globSource } from 'ipfs'

const ipfs = await create()

for await (const file of ipfs.addAll(globSource('./docs', '**/*'))) {
  console.log(file)
}
/*
{
  path: 'docs/assets/anchor.js',
  cid: CID('QmVHxRocoWgUChLEvfEyDuuD6qJ4PhdDL2dTLcpUy3dSC2'),
  size: 15347
}
{
  path: 'docs/assets/bass-addons.css',
  cid: CID('QmPiLWKd6yseMWDTgHegb8T7wVS7zWGYgyvfj7dGNt2viQ'),
  size: 232
}
...
*/

URL source

A utility to allow content from the internet to be easily added to IPFS.

urlSource(url)
  • url: A string URL or URL instance to send HTTP GET request to

Returns an async iterable that yields { path, content } objects suitable for passing to ipfs.add.

Example
import { create, urlSource } from 'kubo-rpc-client'
const ipfs = create()

const file = await ipfs.add(urlSource('https://ipfs.io/images/ipfs-logo.svg'))
console.log(file)

/*
{
  path: 'ipfs-logo.svg',
  cid: CID('QmTqZhR6f7jzdhLgPArDPnsbZpvvgxzCZycXK7ywkLxSyU'),
  size: 3243
}
*/

Running the daemon with the right port

To interact with the API, you need to have a local daemon running. It needs to be open on the right port. 5001 is the default, and is used in the examples below, but it can be set to whatever you need.

# Show the ipfs config API port to check it is correct
> ipfs config Addresses.API
/ip4/127.0.0.1/tcp/5001
# Set it if it does not match the above output
> ipfs config Addresses.API /ip4/127.0.0.1/tcp/5001
# Restart the daemon after changing the config

# Run the daemon
> ipfs daemon

Importing the module and usage

import { create } from 'kubo-rpc-client'

// connect to ipfs daemon API server
const ipfs = create('http://localhost:5001') // (the default in Node.js)

// or connect with multiaddr
const ipfs = create('/ip4/127.0.0.1/tcp/5001')

// or using options
const ipfs = create({ host: 'localhost', port: '5001', protocol: 'http' })

// or specifying a specific API path
const ipfs = create({ host: '1.1.1.1', port: '80', apiPath: '/ipfs/api/v0' })

In a web browser

through Browserify

Same as in Node.js, you just have to browserify the code before serving it. See the browserify repo for how to do that.

See the example in the examples folder to get a boilerplate.

through webpack

See the example in the examples folder to get an idea on how to use kubo-rpc-client with webpack.

from CDN

Instead of a local installation (and browserification) you may request a remote copy of IPFS API from jsDelivr.

To always request the latest version, use one of the following examples:

<!-- loading the minified version using jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/kubo-rpc-client/dist/index.min.js"></script>

For maximum security you may also decide to:

  • reference a specific version of IPFS API (to prevent unexpected breaking changes when a newer latest version is published)
  • generate a SRI hash of that version and use it to ensure integrity. Learn more also at the jsdelivr website
  • set the CORS settings attribute to make anonymous requests to CDN

Example:

<script
  src="https://www.jsdelivr.com/package/npm/kubo-rpc-client"
  integrity="sha384-5bXRcW9kyxxnSMbOoHzraqa7Z0PQWIao+cgeg327zit1hz5LZCEbIMx/LWKPReuB"
  crossorigin="anonymous"
></script>

CDN-based IPFS API provides the KuboRpcClient object of the global window object. Example:

const ipfs = window.KuboRpcClient.create({ host: 'localhost', port: 5001 })

If you omit the host and port, the client will parse window.host, and use this information. This also works, and can be useful if you want to write apps that can be run from multiple different gateways:

const ipfs = window.KuboRpcClient.create()

Custom Headers

If you wish to send custom headers with each request made by this library, for example, the Authorization header. This can be useful if your Kubo node has keys defined in API.Authorizations.

If you're using bearer:token, where token is abc123:

const ipfs = create({
  host: 'localhost',
  port: 5001,
  protocol: 'http',
  headers: {
    authorization: 'Bearer abc123'
  }
})

If you're using basic:user:password, where user:password is alice:secret:

const ipfs = create({
  host: 'localhost',
  port: 5001,
  protocol: 'http',
  headers: {
    // For Node.js, using:
    //    Buffer.from('alice:secret').toString('base64')
    // is preferred over using `btoa`.
    authorization: 'Basic ' + btoa('alice:secret')
  }
})

Global Timeouts

To set a global timeout for all requests pass a value for the timeout option:

// Timeout after 10 seconds
const ipfs = create({ timeout: 10000 })
// Timeout after 2 minutes
const ipfs = create({ timeout: '2m' })
// see https://www.npmjs.com/package/parse-duration for valid string values

Development

Testing

We run tests by executing npm test in a terminal window. This will run both Node.js and Browser tests, both in Chrome and PhantomJS. To ensure that the module conforms with the interface-ipfs-core spec, we run the batch of tests provided by the interface module, which can be found here.

Historical context

This module started as a direct mapping from the go-ipfs cli to a JavaScript implementation, although this was useful and familiar to a lot of developers that were coming to IPFS for the first time, it also created some confusion on how to operate the core of IPFS and have access to the full capacity of the protocol. After much consideration, we decided to create interface-ipfs-core with the goal of standardizing the interface of a core implementation of IPFS, and keep the utility functions the IPFS community learned to use and love, such as reading files from disk and storing them directly to IPFS.

License

Licensed under either of

Contribute

Contributions welcome! Please check out the issues.

Also see our contributing document for more information on how we work, and about contributing in general.

Please be aware that all interactions related to this repo are subject to the IPFS Code of Conduct.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

changelog

5.1.0 (2025-02-15)

Features

Dependencies

  • bump @multiformats/multiaddr-to-uri from 10.1.2 to 11.0.0 (#249) (dafa529)
  • bump parse-duration from 1.1.2 to 2.1.2 (#257) (3d28859)
  • dev: bump nock from 13.5.6 to 14.0.1 (#259) (06f6f1e)

5.0.2 (2024-10-29)

Dependencies

  • dev: bump aegir from 44.1.4 to 45.0.0 (#248) (72910b3)
  • dev: bump sinon from 18.0.1 to 19.0.2 (#245) (c612761)

5.0.1 (2024-09-12)

Bug Fixes

  • update ipfsd-ctl dep and remove overrides (#242) (f9935bc)

5.0.0 (2024-09-12)

⚠ BREAKING CHANGES

  • can only be used with the latest versions of @libp2p/peer-id, @libp2p/interface etc

Dependencies

4.1.3 (2024-09-12)

Dependencies

4.1.2 (2024-09-12)

Bug Fixes

Trivial Changes

  • rename master to main (5c7e42e)
  • Update .github/workflows/stale.yml [skip ci] (39f1bf2)

Dependencies

  • dev: bump aegir from 42.2.11 to 44.0.1 (#240) (17d702b)
  • dev: bump kubo from 0.28.0 to 0.29.0 (#238) (0d7729e)
  • dev: bump sinon from 17.0.2 to 18.0.0 (#234) (a4459dc)

4.1.1 (2024-04-23)

Dependencies

  • dev: bump ipfsd-ctl from 13.0.0 to 14.0.0 (#225) (66efeaf)

4.1.0 (2024-04-23)

Features

4.0.1 (2024-04-19)

Bug Fixes

  • export api types from module root (#223) (7266128)
  • isOnline should return false when node is offline (#222) (e9436ca)

Trivial Changes

4.0.0 (2024-04-18)

⚠ BREAKING CHANGES

  • parts of the Kubo object and dht APIs have been removed, this project is now TypeScript

Features

Documentation

3.0.4 (2024-02-29)

Documentation

3.0.3 (2024-02-06)

Bug Fixes

  • use /api/v0/routing instead of deprecated /api/v0/dht (#215) (7725de3)

Trivial Changes

  • Update .github/workflows/stale.yml [skip ci] (4e779a6)

3.0.2 (2023-11-29)

Bug Fixes

  • tests and update multiformats/multiaddr (#213) (8b2ee7f)

Trivial Changes

  • add or force update .github/workflows/js-test-and-release.yml (#161) (f326cee)
  • delete templates [skip ci] (#160) (a0aea33)
  • Update .github/workflows/stale.yml [skip ci] (76cbca8)
  • Update .github/workflows/stale.yml [skip ci] (4285a5b)

Documentation

  • improve authorization docs (5fc5592)

3.0.1 (2023-02-13)

Bug Fixes

  • key/gen: use correct key type casing (#145) (8b24a94)

Documentation

  • fix global variable for CDN version [ci skip] (2b129c7)

3.0.0 (2023-01-13)

⚠ BREAKING CHANGES

Co-authored-by: achingbrain alex@achingbrain.net

Dependencies

  • update multiformats to version 11.x.x (7053f35)

Documentation

2.0.3 (2023-01-13)

Bug Fixes

2.0.2 (2023-01-04)

Bug Fixes

  • remove bootstrap.clear() and bootstrap.reset() (#114) (a55a31b)

2.0.1 (2023-01-03)

Bug Fixes

Trivial Changes

  • Update .github/workflows/stale.yml [skip ci] (1550880)

Documentation

  • remove reference to CJS require in README (#100) (072f698)

2.0.0 (2022-12-15)

⚠ BREAKING CHANGES

  • Re-enable interface tests and get them succeeding (#83)

Features

Trivial Changes

  • move interface tests back to original name (56c5c28)

1.0.3 (2022-11-23)

Bug Fixes

1.0.2 (2022-11-02)

Bug Fixes

  • update all deps, fix compilation and tests (#63) (e83705c)

Trivial Changes

  • add workflow_dispatch ci (ec77f1b)
  • copy interface-ipfs-core tests (#49) (c899abb)
  • temporarily set releases to patch only (ef63c43)

1.0.1 (2022-09-23)

Dependencies

  • bump @multiformats/multiaddr from 10.3.3 to 11.0.0 (#25) (32b1939)

1.0.0 (2022-09-06)

⚠ BREAKING CHANGES

  • update to libp2p@0.38.x (#4151)
  • This module is now ESM only and there return types of some methods have changed
  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required
  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events
  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)
  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS
  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere
  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules
  • ipfs-repo upgrade requires repo migration to v10
  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

  • remove support for key.export over the http api
    • not really
  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

Features

Bug Fixes

Tests

  • add tests for different types of connection config (#3388) (e1a9712)

Documentation

Dependencies

Trivial Changes

1.0.0 (2022-09-06)

⚠ BREAKING CHANGES

  • update to libp2p@0.38.x (#4151)
  • This module is now ESM only and there return types of some methods have changed
  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required
  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events
  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)
  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS
  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere
  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules
  • ipfs-repo upgrade requires repo migration to v10
  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

  • remove support for key.export over the http api
    • not really
  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

Features

Bug Fixes

Tests

  • add tests for different types of connection config (#3388) (e1a9712)

Documentation

Dependencies

Trivial Changes

1.0.0 (2022-09-06)

⚠ BREAKING CHANGES

  • update to libp2p@0.38.x (#4151)
  • This module is now ESM only and there return types of some methods have changed
  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required
  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events
  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)
  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS
  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere
  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules
  • ipfs-repo upgrade requires repo migration to v10
  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

  • remove support for key.export over the http api
    • not really
  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

Features

Bug Fixes

Tests

  • add tests for different types of connection config (#3388) (e1a9712)

Documentation

Dependencies

Trivial Changes

1.0.0 (2022-09-06)

⚠ BREAKING CHANGES

  • update to libp2p@0.38.x (#4151)
  • This module is now ESM only and there return types of some methods have changed
  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required
  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events
  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)
  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS
  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere
  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules
  • ipfs-repo upgrade requires repo migration to v10
  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

  • remove support for key.export over the http api
    • not really
  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

Features

Bug Fixes

Tests

  • add tests for different types of connection config (#3388) (e1a9712)

Documentation

Dependencies

Trivial Changes

1.0.0 (2022-09-06)

⚠ BREAKING CHANGES

  • update to libp2p@0.38.x (#4151)
  • This module is now ESM only and there return types of some methods have changed
  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required
  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events
  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)
  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS
  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere
  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules
  • ipfs-repo upgrade requires repo migration to v10
  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

  • remove support for key.export over the http api
    • not really
  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

Features

Bug Fixes

Tests

  • add tests for different types of connection config (#3388) (e1a9712)

Documentation

Dependencies

Trivial Changes

1.0.0 (2022-09-06)

⚠ BREAKING CHANGES

  • update to libp2p@0.38.x (#4151)
  • This module is now ESM only and there return types of some methods have changed
  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required
  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events
  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)
  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS
  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere
  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules
  • ipfs-repo upgrade requires repo migration to v10
  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

  • remove support for key.export over the http api
    • not really
  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

Features

Bug Fixes

Tests

  • add tests for different types of connection config (#3388) (e1a9712)

Documentation

Dependencies

Trivial Changes

1.0.0 (2022-08-24)

⚠ BREAKING CHANGES

  • update to libp2p@0.38.x (#4151)
  • This module is now ESM only and there return types of some methods have changed
  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required
  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events
  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)
  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS
  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere
  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules
  • ipfs-repo upgrade requires repo migration to v10
  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

  • remove support for key.export over the http api
    • not really
  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

Features

Bug Fixes

Tests

  • add tests for different types of connection config (#3388) (e1a9712)

Documentation

Dependencies

Trivial Changes

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

57.0.3 (2022-06-24)

Bug Fixes

57.0.2 (2022-06-22)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • ipfs-core-types bumped from ^0.11.0 to ^0.11.1
      • ipfs-core-utils bumped from ^0.15.0 to ^0.15.1

57.0.1 (2022-06-01)

Bug Fixes

57.0.0 (2022-05-27)

⚠ BREAKING CHANGES

  • This module is now ESM only and there return types of some methods have changed

Features

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • ipfs-core-types bumped from ^0.10.3 to ^0.11.0
      • ipfs-core-utils bumped from ^0.14.3 to ^0.15.0

56.0.3 (2022-04-20)

Bug Fixes

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • ipfs-core-types bumped from ^0.10.2 to ^0.10.3
      • ipfs-core-utils bumped from ^0.14.2 to ^0.14.3

56.0.2 (2022-03-01)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • ipfs-core-types bumped from ^0.10.1 to ^0.10.2
      • ipfs-core-utils bumped from ^0.14.1 to ^0.14.2

56.0.1 (2022-02-06)

Bug Fixes

  • dag: replace custom dag walk with multiformats/traversal (#3950) (596b1f4)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • ipfs-core-types bumped from ^0.10.0 to ^0.10.1
      • ipfs-core-utils bumped from ^0.14.0 to ^0.14.1

56.0.0 (2022-01-27)

⚠ BREAKING CHANGES

  • peerstore methods are now all async, the repo is migrated to v12
  • node 15+ is required

Features

Bug Fixes

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • ipfs-core-types bumped from ^0.9.0 to ^0.10.0
      • ipfs-core-utils bumped from ^0.13.0 to ^0.14.0

55.0.0 (2021-12-15)

Bug Fixes

chore

Features

BREAKING CHANGES

  • pubsub: We had to make breaking changes to pubsub commands sent over HTTP RPC to fix data corruption caused by topic names and payload bytes that included \n. More details in https://github.com/ipfs/go-ipfs/issues/7939 and https://github.com/ipfs/go-ipfs/pull/8183
  • On decode of CBOR blocks, undefined values will be coerced to null
  • ipfs.dag.put no longer accepts a format arg, it is now storeCodec and inputCodec. 'json' has become 'dag-json', 'cbor' has become 'dag-cbor' and so on
  • The DHT API has been refactored to return async iterators of query events

54.0.2 (2021-11-24)

Note: Version bump only for package ipfs-http-client

54.0.1 (2021-11-19)

Note: Version bump only for package ipfs-http-client

54.0.0 (2021-11-12)

Bug Fixes

BREAKING CHANGES

  • errors will now be thrown if multiple items are passed to ipfs.add or single items to ipfs.addAll (n.b. you can still pass a list of a single item to ipfs.addAll)

53.0.1 (2021-09-28)

Note: Version bump only for package ipfs-http-client

53.0.0 (2021-09-24)

Features

BREAKING CHANGES

  • the globSource api has changed from globSource(dir, opts) to globSource(dir, pattern, opts)
  • There are no default exports and everything is now dual published as ESM/CJS

52.0.5 (2021-09-17)

Note: Version bump only for package ipfs-http-client

52.0.4 (2021-09-17)

Note: Version bump only for package ipfs-http-client

52.0.3 (2021-09-02)

Bug Fixes

52.0.2 (2021-08-25)

Note: Version bump only for package ipfs-http-client

52.0.1 (2021-08-17)

Bug Fixes

52.0.0 (2021-08-11)

Bug Fixes

Features

BREAKING CHANGES

  • rateIn/rateOut are returned as numbers
  • the output type of ipfs.get has changed and the recursive option has been removed from ipfs.ls since it was not supported everywhere

51.0.1 (2021-07-30)

Note: Version bump only for package ipfs-http-client

51.0.0 (2021-07-27)

Bug Fixes

Features

BREAKING CHANGES

  • ipld-formats no longer supported, use multiformat BlockCodecs instead

Co-authored-by: Rod Vagg rod@vagg.org Co-authored-by: achingbrain alex@achingbrain.net

50.1.2 (2021-06-18)

Note: Version bump only for package ipfs-http-client

50.1.1 (2021-06-05)

Bug Fixes

  • add onError to pubsub.subscribe types (#3706) (d910aea), closes #3468
  • stalling subscription on (node) http-client when daemon is stopped (#3468) (0266abf), closes #3465

50.1.0 (2021-05-26)

Features

  • allow passing the id of a network peer to ipfs.id (#3386) (00fd709)

50.0.0 (2021-05-10)

Bug Fixes

chore

BREAKING CHANGES

  • Minimum supported node version is 14
  • all core api methods now have types, some method signatures have changed, named exports are now used by the http, grpc and ipfs client modules

49.0.4 (2021-03-10)

Note: Version bump only for package ipfs-http-client

49.0.3 (2021-03-09)

Bug Fixes

49.0.2 (2021-02-08)

Note: Version bump only for package ipfs-http-client

49.0.1 (2021-02-02)

Note: Version bump only for package ipfs-http-client

49.0.0 (2021-02-01)

chore

Features

  • support remote pinning services in ipfs-http-client (#3293) (ba240fd)

BREAKING CHANGES

  • ipfs-repo upgrade requires repo migration to v10

48.2.2 (2021-01-22)

Note: Version bump only for package ipfs-http-client

48.2.1 (2021-01-20)

Bug Fixes

48.2.0 (2021-01-15)

Features

48.1.3 (2020-12-16)

Bug Fixes

48.1.2 (2020-11-25)

Note: Version bump only for package ipfs-http-client

48.1.1 (2020-11-16)

Bug Fixes

48.1.0 (2020-11-09)

Bug Fixes

Features

48.0.0 (2020-10-28)

Bug Fixes

Features

BREAKING CHANGES

  • types returned by ipfs.files.ls are now strings, in line with the docs but different to previous behaviour

Co-authored-by: Geoffrey Cohler g.cohler@computer.org

47.0.1 (2020-09-09)

Note: Version bump only for package ipfs-http-client

46.1.1 (2020-09-04)

Note: Version bump only for package ipfs-http-client

46.1.0 (2020-09-03)

Bug Fixes

Features

46.0.1 (2020-08-24)

Bug Fixes

  • validate ipns records with inline public keys (#3224) (5cc0e08)

46.0.0 (2020-08-12)

Bug Fixes

  • support keychain without pass (#3212) (7e0e85c)
  • http-client: allow stream option to be overridden (#3205) (7aba835)
  • send blobs when running ipfs-http-client in the browser (#3184) (6b24463), closes #3138

Features

BREAKING CHANGES

  • remove support for key.export over the http api

45.0.0 (2020-07-16)

Bug Fixes

  • optional arguments go in the options object (#3118) (8cb8c73)
  • small whitespace change (0d4604d)
  • still load dag-pb, dag-cbor and raw when specifying custom formats (#3132) (a96e3bc), closes #3129

Features

  • add interface and http client versions to version output (#3125) (65f8b23), closes #2878
  • store blocks by multihash instead of CID (#3124) (03b17f5)

BREAKING CHANGES

    • not really

44.3.0 (2020-06-24)

Features

44.2.0 (2020-06-05)

Features

44.1.1 (2020-05-29)

Note: Version bump only for package ipfs-http-client

44.1.0 (2020-05-18)

Bug Fixes

Features

44.0.3 (2020-05-05)

Note: Version bump only for package ipfs-http-client

44.0.2 (2020-05-05)

Bug Fixes

44.0.1 (2020-04-28)

Bug Fixes

44.0.0 (2020-04-16)

Bug Fixes

BREAKING CHANGES

  • Where we used to accept all and any HTTP methods, now only POST is accepted. The API client will now only send POST requests too.

  • test: add tests to make sure we are post-only

  • chore: upgrade ipfs-utils

  • fix: return 405 instead of 404 for bad methods

  • fix: reject browsers that do not send an origin

Also fixes running interface tests over http in browsers against js-ipfs

43.0.1 (2020-04-08)

Bug Fixes

  • dht.findPeer API endpoint returns ndjson (#2965) (524ff32)

43.0.0 (2020-03-31)

Bug Fixes

chore

  • move mfs and multipart files into core (#2811) (82b9e08)
  • update dep version and ignore interop test for raw leaves (#2747) (6376cec)

Features

BREAKING CHANGES

  • When the path passed to ipfs.files.stat(path) was a hamt sharded dir, the resovled value returned by js-ipfs previously had a type property of with a value of 'hamt-sharded-directory'. To bring it in line with go-ipfs this value is now 'directory'.
  • Files that fit into one block imported with either --cid-version=1 or --raw-leaves=true previously returned a CID that resolved to a raw node (e.g. a buffer). Returned CIDs now resolve to a dag-pb node that contains a UnixFS entry. This is to allow setting metadata on small files with CIDv1.

42.0.0 (2020-02-04)

There are significant and breaking API changes in this release. Please see the migration guide.

Bug Fixes

Features

  • add results now include mode and mtime properties if they were set.

  • files.chmod has been added. See the core interface docs for info.

  • files.flush now returns the root CID for the path that was flushed (/ by default)

  • files.ls results now include mode and mtime properties if they were set. See the core interface docs for more info.

  • files.mkdir now accepts mode and mtime options to allow setting mode and mtime metadata. See the core interface docs for more info.

  • files.stat result now includes mode and mtime properties if they were set. See the core interface docs for more info.

  • files.touch has been added. See the core interface docs for info.

  • files.write now accepts mode and mtime options to allow setting mode and mtime metadata. See the core interface docs for more info.

  • object.get now accepts a timeout option. It will cause the method to throw with a TimeoutError if no data is received within the timeout window. It can be passed as a number or a string. If a number is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration.

  • pin.add now accepts a timeout option. It will cause the method to throw with a TimeoutError if no data is received within the timeout window. It can be passed as a number or a string. If a number is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration.

  • refs now accepts a timeout option. It will cause the method to throw with a TimeoutError if no data is received within the timeout window. It can be passed as a number or a string. If a number is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration.

BREAKING CHANGES

  • Callbacks are no longer supported on any API methods. Please use a utility such as callbackify on API methods that return Promises to emulate previous behaviour. See the migration guide for more info.

  • add now returns an async iterable.

  • add now accepts mode and mtime options on inputs to allow setting mode and mtime metadata for added files. See the core interface docs for more info.

  • add results now contain a cid property (a CID instance) instead of a string hash property.

  • addReadableStream, addPullStream have been removed. Please see the migration guide for more info.

  • addFromStream has been removed. Use add instead.

  • addFromFs has been removed. Please use the exported globSource utility and pass the result to add. See the glob source documentation for more details and an example.

  • addFromURL has been removed. Please use the exported urlSource utility and pass the result to add. See the URL source documentation for more details and an example.

  • bitswap.stat result has changed - wantlist and values are now an array of CID instances and peers is now a string[] of peer IDs.

  • bitswap.wantlist now returns an array of CID instances.

  • block.rm now returns an async iterable.

  • block.rm now yields objects of { cid: CID, error: Error }.

  • block.stat result now contains a cid property (whose value is a CID instance) instead of a key property.

  • dht.findProvs, dht.provide, dht.put and dht.query now all return an async iterable.

  • dht.findPeer, dht.findProvs, dht.provide, dht.put and dht.query now yield/return an object { id: string, addrs: Multiaddr[] } instead of a PeerInfo instance(s).

  • files.lsPullStream and files.lsReadableStream have been removed. Please see the migration guide for more info.

  • files.ls now returns an async iterable.

  • files.ls results now contain a cid property (whose value is a CID instance) instead of a hash property.

  • files.ls no longer takes a long option (in core) - you will receive all data by default.

  • files.readPullStream and files.readReadableStream have been removed. Please see the migration guide for more info.

  • files.read now returns an async iterable.

  • files.stat result now contains a cid property (whose value is a CID instance) instead of a hash property.

  • get now returns an async iterable. The content property value for objects yielded from the iterator is now an async iterable that yields BufferList objects.

  • id result has changed, the addresses property is now a Multiaddr[]

  • name.resolve now returns an async iterable. It yields increasingly more accurate resolved values as they are discovered until the best value is selected from the quorum of 16. The "best" resolved value is the last item yielded from the iterator. If you are interested only in this best value you could use it-last to extract it like so:

      import last from 'it-last'
      await last(ipfs.name.resolve('/ipns/QmHash'))
  • ls now returns an async iterable.

  • ls results now contain a cid property (whose value is a CID instance) instead of a hash property.

  • ls results now include mode and mtime properties if they were set. See the core interface docs for more info.

  • pin.add results now contain a cid property (a CID instance) instead of a string hash property.

  • pin.ls now returns an async iterable.

  • pin.ls results now contain a cid property (a CID instance) instead of a string hash property.

  • pin.rm results now contain a cid property (a CID instance) instead of a string hash property.

  • ping now returns an async iterable.

  • refs and refs.local now return an async iterable.

  • repo.gc now returns an async iterable.

  • stats.bw now returns an async iterable.

  • swarm.peers now returns an array of objects with a peer property that is a string, instead of a PeerId instance.

  • swarm.addrs now returns an array of objects { id: string, addrs: Multiaddr[] } instead of PeerInfo instances.

  • The protocol name for peer IDs in multiaddrs has changed from 'ipfs' to 'p2p'. There's no changes to data on the wire but this change is seen when multiaddrs are converted to strings.

42.0.0-pre.0 (2020-01-23)

41.0.1 (2020-01-23)

41.0.0 (2020-01-12)

Bug Fixes

Code Refactoring

BREAKING CHANGES

  • format option is no longer supported as everything is dag-pb all of the time.

Follows on from https://github.com/ipfs/js-ipfs-mfs/pull/69

40.2.1 (2020-01-09)

40.2.0 (2020-01-09)

Features

40.1.0 (2019-12-10)

Features

40.0.1 (2019-11-27)

Bug Fixes

40.0.0 (2019-11-22)

Code Refactoring

Features

Reverts

BREAKING CHANGES

  • The log.tail method 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.level now returns an object that has camel cased keys. i.e. Message and Error properties have changed to message and error.
  • Dropped support for go-ipfs <= 0.4.4 in swarm.peers response.
  • The signature for ipfs.mount has changed from ipfs.mount([ipfsPath], [ipnsPath]) to ipfs.mount([options]). Where options is an optional object that may contain two boolean properties ipfsPath and ipnsPath. The response object has also changed to be camel case. See https://docs.ipfs.io/reference/api/http/#api-v0-mount.
  • Default ping count of 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 pass count: 1 in options for ipfs.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 instance
    • Object, in format of either:
      • Address and path e.g. { apiAddr: '/ip4/127.0.0.1/tcp/5001': apiPath: '/api/v0' } (Note: apiAddr can 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' }
  • Errors returned from request failures are now all HTTPErrors which carry a response property. This is a Response that can be used to inspect all information relating to the HTTP response. This means that the err.status or err.statusCode property should now be accessed via err.response.status.
  • files in src/files-regular have moved to src. The src/files-mfs directory has been renamed to src/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-core docs. e.g. the allow-offline option to name.publish should be passed as allowOffline.

39.0.2 (2019-10-23)

Bug Fixes

  • use non-strict equivalence for options.preload (#1134) (432e1e8)

39.0.1 (2019-10-21)

Bug Fixes

  • expose preload argument (#1129) (c82b031)
  • increase default timeout and respect value passed to ky.extend (#1130) (25b6043)

39.0.0 (2019-10-15)

38.2.0 (2019-10-06)

Features

38.1.0 (2019-10-04)

Bug Fixes

  • get correct remote node config (5b53e22)
  • pull in preconfigured chai from interface tests (93765c1)

Features

  • add methods for listing config profiles (1c3d92a)

BREAKING CHANGES

  • Configuration profiles API has changed:

      Promise<{oldCfg, newCfg}> ipfs.config.profile(name, opts)
    
      // is now
      Promise<{old, new}> ipfs.config.profiles.apply(name, opts)
  • Possibly contentious; Adds callbackify as a dependency, see https://github.com/ipfs/js-ipfs/issues/2506 for discussion.

38.0.1 (2019-10-04)

Bug Fixes

  • pull in preconfigured chai from interface tests (6a7eb8a)

38.0.0 (2019-09-25)

37.0.3 (2019-09-25)

37.0.2 (2019-09-20)

Bug Fixes

  • only do the big file workaround in node and electron main (077c997)

37.0.1 (2019-09-17)

37.0.0 (2019-09-17)

Bug Fixes

  • big downloads in electron (9c9aac8)

36.1.0 (2019-09-17)

Bug Fixes

  • fix electron renderer tests and a couple more bugs (#1105) (a631a21)

36.0.0 (2019-09-11)

35.1.0 (2019-09-04)

Features

35.0.0 (2019-09-04)

BREAKING CHANGES

Kebab case options (e.g. wrap-with-directory) are no longer supported in ipfs.add. Use camel case instead (e.g. wrapWithDirectory).

34.0.0 (2019-08-29)

Bug Fixes

  • package: update err-code to version 2.0.0 (#1053) (3515070)

Features

33.1.1 (2019-07-26)

Bug Fixes

  • allow passing timeout option to object stat (#1055) (92b0594)

33.1.0 (2019-07-11)

Bug Fixes

Features

  • add support for js-ipfs dag api and also some tests (#957) (8f378a3)

33.0.2 (2019-07-11)

Bug Fixes

33.0.1 (2019-07-10)

Bug Fixes

33.0.0 (2019-07-10)

Bug Fixes

BREAKING CHANGES

repo.gc response objects have changed to { err, cid }, where err is an Error instance and cid is a CID instance.

32.0.1 (2019-05-21)

Bug Fixes

32.0.0 (2019-05-21)

Bug Fixes

  • handle empty array return value in dht.findProvs (#1003) (15ab7c5)

Chores

BREAKING CHANGES

  • The default string encoding for version 1 CIDs has changed to base32.

IPLD formats have been updated to the latest versions. IPLD nodes returned by ipfs.dag and ipfs.object commands have significant breaking changes. If you are using these commands in your application you are likely to encounter the following changes to dag-pb nodes (the default node type that IPFS creates):

  • DAGNode properties have been renamed as follows:
    • data => Data
    • links => Links
    • size => size (Note: no change)
  • DAGLink properties have been renamed as follows:
    • cid => Hash
    • name => Name
    • size => Tsize

See CHANGELOGs for each IPLD format for it's respective changes, you can read more about the dag-pb changes in the CHANGELOG

License: MIT Signed-off-by: Alan Shaw alan.shaw@protocol.ai

31.1.0 (2019-05-16)

Features

  • add support for File DOM API to files-regular (#986) (7b49f7e)

31.0.2 (2019-05-16)

Bug Fixes

31.0.1 (2019-05-15)

Bug Fixes

31.0.0 (2019-05-13)

Features

BREAKING CHANGES

  • ipfs.refs now returns objects with camelCase properties not PascalCase properties. i.e. { ref, err } not { Ref, Err }

30.1.4 (2019-04-29)

Bug Fixes

30.1.3 (2019-04-11)

Bug Fixes

  • fix missing buffer bundling with browserify (#966) (944a64b), closes #964

30.1.2 (2019-04-09)

Bug Fixes

  • https multiaddr support in constructor (#965) (5da0bcd)

30.1.1 (2019-03-28)

30.1.0 (2019-03-15)

Bug Fixes

  • dht.findProvs.js handle valid hash but no providers (#950) (c3cde76)

Features

Performance Improvements

30.0.0 (2019-03-13)

Bug Fixes

Code Refactoring

Features

BREAKING CHANGES

  • ipfs.util.isIPFS has moved to a static export and should be accessed via const { isIPFS } = require('ipfs-http-client').

The modules available under ipfs.types.* have also become static exports.

ipfs.util.crypto has been removed as it is not a dependency of ipfs-http-client so reduces the bundle size. If you need to use libp2p crypto primitives then please see the js-libp2p-crypto project for info on how to use it in your project.

Finally ipfs.util.getEndpointConfig is now a direct instance method, ipfs.getEndpointConfig

License: MIT Signed-off-by: Alan Shaw alan.shaw@protocol.ai

29.1.1 (2019-02-13)

Performance Improvements

29.1.0 (2019-01-29)

Bug Fixes

  • throw on invalid multiaddr to constructor (#934) (bcbf0d2)

Features

  • return protocol from getEndpointConfig (#935) (12ddaa3)

29.0.1 (2019-01-24)

Bug Fixes

29.0.0 (2019-01-15)

Code Refactoring

BREAKING CHANGES

License: MIT Signed-off-by: Alan Shaw alan.shaw@protocol.ai

28.1.2 (2019-01-14)

28.1.1 (2019-01-04)

28.1.0 (2018-12-16)

Features

28.0.3 (2018-12-15)

Bug Fixes

28.0.2 (2018-12-14)

28.0.1 (2018-12-13)

Bug Fixes

  • disable just the rule we're breaking (bed2687)
  • properly serialize CID instances (45b344c)
  • skip test that go-ipfs cannot pass (0e15761)

28.0.0 (2018-12-11)

Bug Fixes

Code Refactoring

BREAKING CHANGES

  • DHT API methods renamed and return types changed

  • ipfs.dht.findprovs renamed to ipfs.dht.findProvs and returns an array of PeerInfo

  • ipfs.dht.findpeer renamed to ipfs.dht.findPeer and returns a PeerInfo
  • ipfs.dht.query now returns an array of PeerId
  • More info

27.1.0 (2018-12-05)

Bug Fixes

Features

27.0.0 (2018-11-28)

Bug Fixes

  • also retry with misnemed format "dag-cbor" as "cbor" (#888) (348a144)
  • better input validation for add (#876) (315b7f7)
  • fix log.tail by calling add after listening for events (#882) (da35b0f)
  • handle peer-info validation errors (#887) (6e6d7a2), closes #885
  • updates ipld-dag-pb dep to version without .cid properties (#889) (ac30a82)

Code Refactoring

BREAKING CHANGES

  • the ipfs-api library has been renamed to ipfs-http-client.

Now install via npm install ipfs-http-client.

Note that in the browser build the object attached to window is now window.IpfsHttpClient.

License: MIT Signed-off-by: Alan Shaw alan.shaw@protocol.ai

  • Object API refactor.

Object API methods that write DAG nodes now return a CID instead of a DAG node. Affected methods:

  • ipfs.object.new
  • ipfs.object.patch.addLink
  • ipfs.object.patch.appendData
  • ipfs.object.patch.rmLink
  • ipfs.object.patch.setData
  • ipfs.object.put

Example:

// Before
const dagNode = await ipfs.object.new()
// After
const cid = await ipfs.object.new() // now returns a CID
const dagNode = await ipfs.object.get(cid) // fetch the DAG node that was created

IMPORTANT: DAGNode instances, which are part of the IPLD dag-pb format have been refactored.

These instances no longer have multihash, cid or serialized properties.

This effects the following API methods that return these types of objects:

  • ipfs.object.get
  • ipfs.dag.get

See https://github.com/ipld/js-ipld-dag-pb/pull/99 for more information.

License: MIT Signed-off-by: Alan Shaw alan.shaw@protocol.ai

  • Files API methods add*, cat*, get* have moved from files to the root namespace.

Specifically, the following changes have been made:

  • ipfs.files.add => ipfs.add
  • ipfs.files.addPullStream => ipfs.addPullStream
  • ipfs.files.addReadableStream => ipfs.addReadableStream
  • ipfs.files.cat => ipfs.cat
  • ipfs.files.catPullStream => ipfs.catPullStream
  • ipfs.files.catReadableStream => ipfs.catReadableStream
  • ipfs.files.get => ipfs.get
  • ipfs.files.getPullStream => ipfs.getPullStream
  • ipfs.files.getReadableStream => ipfs.getReadableStream

Additionally, addFromFs, addFromURL, addFromStream have moved from util to the root namespace:

  • ipfs.util.addFromFs => ipfs.addFromFs
  • ipfs.util.addFromURL => ipfs.addFromURL
  • ipfs.util.addFromStream => ipfs.addFromStream

License: MIT Signed-off-by: Alan Shaw alan.shaw@protocol.ai

  • Previously swarm.peers would throw an uncaught error if any peer in the response could not have its peerId or multiaddr validated.

This change catches errors that occur while validating the peer info. The returned array will contain an entry for every peer in the ipfs response. peer-info objects that couldn't be validated, now have an error property and a rawPeerInfo property. This at least means the count of peers in the response will be accurate, and there the info is available to the caller.

This means that callers now have to deal with peer-info objects that may not have a peer or addr property.

Adds nock tests to exercice the code under different error conditions. Doing so uncovered a bug in our legacy go-ipfs <= 0.4.4 peer info parsing, which is also fixed. The code was trying to decapusalate the peerId from the multiaddr, but doing so trims the peerId rather than returning it.

License: MIT Signed-off-by: Oli Evans oli@tableflip.io

26.1.2 (2018-11-03)

Features

  • go-ipfs 0.4.18 (e3e4d6c)
  • upload example works with big files (62b844f)

26.1.1 (2018-11-03)

Features

26.1.0 (2018-10-31)

Bug Fixes

  • make ping not mix errors with responses (#883) (80725f2)

26.0.3 (2018-10-31)

26.0.2 (2018-10-31)

Bug Fixes

26.0.1 (2018-10-30)

26.0.0 (2018-10-30)

Bug Fixes

  • add missing and remove unused dependencies (#879) (979d8b5)

Chores

Features

BREAKING CHANGES

  • dag-cbor nodes now represent links as CID objects

The API for dag-cbor changed. Links are no longer represented as JSON objects ({"/": "base-encoded-cid"}, but as CID objects. ipfs.dag.get() and now always return links as CID objects. ipfs.dag.put() also expects links to be represented as CID objects. The old-style JSON objects representation is still supported, but deprecated.

Prior to this change:

const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5')
// Link as JSON object representation
const putCid = await ipfs.dag.put({link: {'/': cid.toBaseEncodedString()}})
const result = await ipfs.dag.get(putCid)
console.log(result.value)

Output:

{ link:
   { '/':
      <Buffer 12 20 8a…> } }

Now:

const cid = new CID('QmXed8RihWcWFXRRmfSRG9yFjEbXNxu1bDwgCFAN8Dxcq5')
// Link as CID object
const putCid = await ipfs.dag.put({link: cid})
const result = await ipfs.dag.get(putCid)
console.log(result.value)

Output:

{ link:
   CID {
     codec: 'dag-pb',
     version: 0,
     multihash:
      <Buffer 12 20 8a…> } }

See https://github.com/ipld/ipld/issues/44 for more information on why this change was made.

  • remove types.dagCBOR and types.dagPB from public API

If you need the ipld-dag-cbor or ipld-dag-pb module in the Browser, you need to bundle them yourself.

25.0.0 (2018-10-15)

Bug Fixes

24.0.2 (2018-09-21)

Bug Fixes

24.0.1 (2018-08-21)

24.0.0 (2018-08-15)

Bug Fixes

  • add test data to IPFS before fetching it (#832) (b2a77d6)
  • BREAKING CHANGE use data-encoding arg so data is not corrupted (#806) (553c3fb)
  • dag.get return error on missing multicodec (#831) (ff7c7e5)
  • remove external urls from addFromURL tests (#834) (7cf7998), closes #803

BREAKING CHANGES

  • Requires go-ipfs 0.4.17 as it allows for specifying the data encoding format when requesting object data.

23.0.0 (2018-08-06)

Bug Fixes

Features

22.3.0 (2018-08-02)

Bug Fixes

Features

  • compatible with go-ipfs 0.4.16 (8536ee4)
  • expose mfs files.read*Stream methods (#823) (70c9df1)

22.2.4 (2018-07-17)

Bug Fixes

  • increase browserNoActivityTimeout to account for before (328e338)
  • increase timeout for .name after all (3dc4313)
  • missing debug dependency fixes #809 (#810) (0f1fe95)

22.2.3 (2018-07-10)

Bug Fixes

22.2.2 (2018-07-05)

Bug Fixes

  • ignore response body for some mfs commands (#805) (b604a64)

Features

22.2.1 (2018-06-29)

Bug Fixes

  • res.req only in Node.js, in browser use res.url instead (#798) (e8a5ab9)

22.2.0 (2018-06-29)

Features

  • logs path & querystring for requests (#796) (4e55d19)

22.1.1 (2018-06-25)

Bug Fixes

22.1.0 (2018-06-18)

Features

  • add support for custom headers to send-request (#741) (7fb2e07)
  • implement bitswap wantlist peer ID param and bitswap unwant (#761) (73a153e)

22.0.2 (2018-06-14)

Bug Fixes

  • json-loader error in upload-file-via-browser example (#784) (5e7b7c4)

22.0.1 (2018-05-30)

Bug Fixes

  • configure webpack to not use esmodules in dependencies (dc14333)
  • correctly differentiate pong responses (4ad25a3)
  • util.addFromURL with URL-escaped file (a3bd811)

22.0.0 (2018-05-20)

Bug Fixes

  • callback from unsub after stream ends (51a80f2)
  • do not fail stop node if failed start node (533760f)
  • ping: convert the ping messages to lowercase (632af40)
  • more robust ping tests (fc6d301)
  • remove .only (0e21c8a)
  • result.Peers can be null, ensure callback is called (f5f2e83)
  • update asserted error message (17c1f1c)
  • use async/setImmediate vs process.nextTick (faa51b4)

21.0.0 (2018-05-12)

Bug Fixes

  • make pubsub.unsubscribe async and alter pubsub.subscribe signature (b98f8f3)

BREAKING CHANGES

  • pubsub.unsubscribe is now async and argument order for pubsub.subscribe has changed

License: MIT Signed-off-by: Alan Shaw alan@tableflip.io

20.2.1 (2018-05-06)

20.2.0 (2018-04-30)

Bug Fixes

  • adding files by pull stream (2fa16c5)
  • handle request errors in addFromURL (7c5cea5)
  • increase timeout for name.publish and fix setup code (ceb1106)
  • ipfs add url wrap doesn't work (#750) (f6f1bf0)

Features

  • Add offset/length arguments to files.cat (17967c1)
  • get it ready for release (#751) (1885af4)

20.1.0 (2018-04-30)

Bug Fixes

  • adding files by pull stream (2fa16c5)
  • handle request errors in addFromURL (7c5cea5)
  • increase timeout for name.publish and fix setup code (ceb1106)
  • ipfs add url wrap doesn't work (#750) (f6f1bf0)

Features

  • Add offset/length arguments to files.cat (17967c1)
  • get it ready for release (#751) (1885af4)

20.0.1 (2018-04-12)

20.0.0 (2018-04-05)

Bug Fixes

  • dag: js-ipld format resolver take the raw block (2683c7e)
  • dag: path logic for DAG get was wrong (d2b203b)
  • dag: use SendOneFile for dag put (9c37213)

Features

  • dag.put (9463d3a)
  • dag: proper get implementation (7ba0343)
  • dag: rebase, use waterfall for put (ad9eab8)
  • dag: update option names to reflect go-ipfs API (9bf1c6c)
  • Provide access to bundled libraries when in browser (#732) (994bdad), closes #406
  • public-readonly-method-for-getting-host-and-port (41d32e3), closes #580
  • Wrap with dir (#730) (160860e)

19.0.0 (2018-03-28)

Bug Fixes

  • bitswap: 0.4.14 returns empty array instead of null (5e37a54)
  • ping: tests were failing and there it was missing to catch when count and n are used at the same time (2181568)

Features

  • streamable ping and optional packet number (#723) (3f3ce8a)

18.2.1 (2018-03-22)

Features

  • add ability to files.cat with a cid instance (aeeb94e)

18.2.0 (2018-03-16)

Bug Fixes

  • disable Browser test on Windows (385a6c3)
  • don't create one webpack bundle for every test file (3967e96)
  • last fixes for green (#719) (658bad2)
  • set the FileResultStreamConverter explicitly (dfad55e), closes #696
  • use a different remote server for test (1fc15a5)

Features

18.1.2 (2018-03-09)

Bug Fixes

18.1.1 (2018-02-20)

Features

  • support recursive ipfs ls (cfe95f6)

18.1.0 (2018-02-20)

Features

  • support recursive ipfs ls (cfe95f6)

18.0.0 (2018-02-14)

Bug Fixes

  • exception when dir is empty (#680) (ec04f6e)
  • support all the Buffer shims and load fixtures correctly (066988f)
  • update stats API (#684) (4f7999d)

Features

  • (breaking change) stats spec, spec repo, stream to value on files read (#679) (118456e)
  • breaking change: use stream on stats.bw (#686) (895760e)
  • ipfs.stop (5091115)

17.5.0 (2018-01-24)

Bug Fixes

Features

17.4.0 (2018-01-24)

Bug Fixes

Features

  • integrate new ipfsd-ctl (2b1820b)

17.3.0 (2018-01-12)

Features

17.2.7 (2018-01-11)

Bug Fixes

Features

17.2.6 (2017-12-28)

Features

17.2.5 (2017-12-20)

Bug Fixes

  • files.add: handle weird directory names (#646) (012b86c)

Features

17.2.4 (2017-12-06)

Bug Fixes

17.2.3 (2017-12-05)

17.2.2 (2017-12-05)

17.2.1 (2017-12-05)

Features

17.2.0 (2017-12-01)

Bug Fixes

17.1.3 (2017-11-23)

17.1.2 (2017-11-22)

Bug Fixes

17.1.1 (2017-11-22)

Bug Fixes

17.1.0 (2017-11-20)

Features

  • send files HTTP request should stream (#629) (dae62cb)

17.0.1 (2017-11-20)

Bug Fixes

17.0.0 (2017-11-17)

Features

16.0.0 (2017-11-16)

Bug Fixes

15.1.0 (2017-11-14)

Bug Fixes

  • adapting HTTP API to the interface-ipfs-core spec (#625) (8e58225)

Features

15.0.2 (2017-11-13)

15.0.1 (2017-10-22)

15.0.0 (2017-10-22)

Features

  • update pin API to match interface-ipfs-core (9102643)

14.3.7 (2017-10-18)

14.3.6 (2017-10-18)

Bug Fixes

  • pass the config protocol to http requests (#609) (38d7289)

Features

  • avoid doing multiple RPC requests for files.add, fixes #522 (#595) (0ea5f57)
  • report progress on ipfs add (e2d894c)

14.3.5 (2017-09-08)

Features

  • Support specify hash algorithm in files.add (#597) (ed68657)

14.3.4 (2017-09-07)

14.3.3 (2017-09-07)

Features

  • support options for .add / files.add (8c717b2)

14.3.2 (2017-09-04)

Bug Fixes