Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
interface-ipfs-core
Advanced tools
A test suite and interface you can use to implement a IPFS core interface.
⛔️ DEPRECATED: js-IPFS has been superseded by Helia
📚 Learn more about this deprecation or how to migrate
⚠️ If you continue using this repo, please note that security fixes will not be provided
A test suite and interface you can use to implement a IPFS core interface.
$ npm i interface-ipfs-core
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.
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.
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](https://cdn.rawgit.com/ipfs/interface-ipfs-core/master/img/badge.svg)](https://github.com/ipfs/js-ipfs/tree/master/packages/interface-ipfs-core)
$ npm install interface-ipfs-core
If you want to run these tests against a Kubo daemon, checkout ipfs-http-client and run test tests:
$ git clone https://github.com/ipfs/js-ipfs-http-client
$ 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()
nodes.push(node)
return node.api
},
// Dispose of nodes created by the IPFS factory and any other teardown
teardown: () => {
return Promise.all(nodes.map(n => n.stop()))
}
})
tests.block(createCommon)
tests.config(createCommon)
tests.dag(createCommon)
// ...etc. (see src/index.js)
// run all the tests for the repo subsystem
tests.repo(createCommon)
tests.repo.version(createCommon)
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'] })
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'] })
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'] })
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'
}]
})
Licensed under either of
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.
FAQs
A test suite and interface you can use to implement a IPFS core interface.
The npm package interface-ipfs-core receives a total of 155 weekly downloads. As such, interface-ipfs-core popularity was classified as not popular.
We found that interface-ipfs-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.