|
| 1 | +# Development <!-- omit in toc --> |
| 2 | + |
| 3 | +> Getting started with development on IPFS |
| 4 | +
|
| 5 | +## Table of contents <!-- omit in toc --> |
| 6 | + |
| 7 | +- [Clone and install dependencies](#clone-and-install-dependencies) |
| 8 | +- [Run tests](#run-tests) |
| 9 | + - [Run interop tests](#run-interop-tests) |
| 10 | + - [Run benchmark tests](#run-benchmark-tests) |
| 11 | +- [Lint](#lint) |
| 12 | +- [Build a dist version](#build-a-dist-version) |
| 13 | + |
| 14 | +## Clone and install dependencies |
| 15 | + |
| 16 | +```sh |
| 17 | +> git clone https://github.com/ipfs/js-ipfs.git |
| 18 | +> cd js-ipfs |
| 19 | +> npm install |
| 20 | +``` |
| 21 | + |
| 22 | +## Run tests |
| 23 | + |
| 24 | +```sh |
| 25 | +# run all the unit tests |
| 26 | +> npm test |
| 27 | + |
| 28 | +# run individual tests (findprovs) |
| 29 | +> npm run test -- --grep findprovs |
| 30 | + |
| 31 | +# run just IPFS tests in Node.js |
| 32 | +> npm run test:node |
| 33 | + |
| 34 | +# run just IPFS core tests |
| 35 | +> npm run test:node:core |
| 36 | + |
| 37 | +# run just IPFS HTTP-API tests |
| 38 | +> npm run test:node:http |
| 39 | + |
| 40 | +# run just IPFS CLI tests |
| 41 | +> npm run test:cli |
| 42 | + |
| 43 | +# run just IPFS core tests in the Browser (Chrome) |
| 44 | +> npm run test:browser |
| 45 | + |
| 46 | +# run some interface tests (block API) on Node.js |
| 47 | +> npm run test:node:interface -- --grep '.block' |
| 48 | +``` |
| 49 | + |
| 50 | +### Run interop tests |
| 51 | + |
| 52 | + |
| 53 | +```sh |
| 54 | +# run the interop tests with the default go-IPFS |
| 55 | +> npm run test:interop |
| 56 | + |
| 57 | +# run the interop tests with a different go-IPFS |
| 58 | +> IPFS_EXEC_GO=/path/to/ipfs npm run test:interop |
| 59 | +``` |
| 60 | + |
| 61 | +### Run benchmark tests |
| 62 | + |
| 63 | +```sh |
| 64 | +# run all the benchmark tests |
| 65 | +> npm run benchmark |
| 66 | + |
| 67 | +# run just IPFS benchmarks in Node.js |
| 68 | +> npm run benchmark:node |
| 69 | + |
| 70 | +# run just IPFS benchmarks in Node.js for an IPFS instance |
| 71 | +> npm run benchmark:node:core |
| 72 | + |
| 73 | +# run just IPFS benchmarks in Node.js for an IPFS daemon |
| 74 | +> npm run benchmark:node:http |
| 75 | + |
| 76 | +# run just IPFS benchmarks in the browser (Chrome) |
| 77 | +> npm run benchmark:browser |
| 78 | +``` |
| 79 | + |
| 80 | +## Lint |
| 81 | + |
| 82 | +**Conforming to linting rules is a prerequisite to commit to js-ipfs.** |
| 83 | + |
| 84 | +```sh |
| 85 | +> npm run lint |
| 86 | +``` |
| 87 | + |
| 88 | +## Build a dist version |
| 89 | + |
| 90 | +```sh |
| 91 | +> npm run build |
| 92 | +``` |
0 commit comments