TypeScript icon, indicating that this package has built-in type declarations

    0.151.1 • Public • Published


    standard-readme compliant Dependency Status

    A test suite and interface you can use to implement an IPFS core interface.

    Lead Maintainer

    Alex Potsides

    Table of Contents


    The primary goal of this module is to define and ensure that IPFS core implementations and their respective HTTP client libraries offer the same interface, so that developers can quickly change between a local and a remote node without having to change their applications.

    It offers a suite of tests that can be run in order to check if the interface is implemented as described.

    Core API

    In order to be considered "valid", an IPFS implementation must expose the Core API as described in /docs/core-api. You can also use this loose spec as documentation for consuming the core APIs.

    Modules that implement the interface

    Send in a PR if you find or write one!


    Include this badge in your readme if you make a new module that implements interface-ipfs-core API.

    [![IPFS Core API Compatible](](


    In JavaScript land:

    $ npm install interface-ipfs-core

    If you want to run these tests against a go-ipfs daemon, checkout ipfs-http-client and run test tests:

    $ git clone
    $ npm install
    $ npm test


    Install interface-ipfs-core as one of the dependencies of your project and as a test file. Then, using mocha (for Node.js) or a test runner with compatible API, do:

    import * as tests from 'interface-ipfs-core'
    const nodes = []
    // Create common setup and teardown
    const createCommon = () => ({
      // Do some setup common to all tests
      setup: async () => {
        // Use ipfsd-ctl or other to spawn an IPFS node for testing
        const node = await spawnNode()
        return node.api
      // Dispose of nodes created by the IPFS factory and any other teardown
      teardown: () => {
        return Promise.all( => n.stop()))
    // ...etc. (see src/index.js)

    Running tests

    // run all the tests for the repo subsystem

    Running tests by command


    Running only some tests

    tests.repo.gc(createCommon, { only: true }) // pass an options object to run only these tests
    // OR, at the subsystem level
    // runs only ALL the repo.gc tests
    tests.repo(createCommon, { only: ['gc'] })
    // runs only ALL the object.patch.addLink tests
    tests.object(createCommon, { only: ['patch.addLink'] })

    Running only specific tests

    tests.repo.gc(createCommon, { only: ['should do a thing'] }) // only run these named test(s)
    // OR, at the subsystem level
    tests.repo(createCommon, { only: ['should do a thing'] })

    Skipping tests

    tests.repo.gc(createCommon, { skip: true }) // pass an options object to skip these tests
    // skips ALL the repo.gc tests
    tests.repo(createCommon, { skip: ['gc'] })
    // skips ALL the object.patch.addLink tests
    tests.object(createCommon, { skip: ['patch.addLink'] })

    Skipping specific tests

    tests.repo.gc(createCommon, { skip: ['should do a thing'] }) // named test(s) to skip
    // OR, at the subsystem level
    tests.repo(createCommon, { skip: ['should do a thing'] })
    // Optionally specify a reason
    tests.repo(createCommon, {
      skip: [{
        name: 'should do a thing',
        reason: 'Thing is not implemented yet'


    Feel free to join in. All welcome. Open an issue!

    This repository falls under the IPFS Code of Conduct.

    Want to hack on IPFS?


    Copyright (c) Protocol Labs, Inc. under the MIT License. See for details.



    npm i interface-ipfs-core

    DownloadsWeekly Downloads






    Unpacked Size

    2.8 MB

    Total Files


    Last publish


    • daviddias
    • achingbrain
    • alanshaw
    • hugomrdias
    • ipfs-npm-publisher-bot