├── ci ├── jenkins └── Dockerfile ├── test ├── .gitignore ├── fixtures │ ├── go-ipfs-repo │ │ ├── datastore │ │ │ ├── LOCK │ │ │ ├── CURRENT │ │ │ ├── 000002.ldb │ │ │ ├── 000005.ldb │ │ │ ├── 000010.ldb │ │ │ ├── MANIFEST-000014 │ │ │ ├── LOG.old │ │ │ └── LOG │ │ ├── version │ │ └── blocks │ │ │ ├── 75 │ │ │ └── CIQMB7DLJFKD267QJ2B5FJNHZPTSVA7IB6OHXSQ2XSVEEKMKK6RT75I.data │ │ │ ├── SHARDING │ │ │ ├── QV │ │ │ └── CIQOHMGEIKMPYHAUTL57JSEZN64SIJ5OIHSGJG4TJSSJLGI3PBJLQVI.data │ │ │ ├── X3 │ │ │ └── CIQFTFEEHEDF6KLBT32BFAGLXEZL4UWFNWM4LFTLMXQBCERZ6CMLX3Y.data │ │ │ ├── YD │ │ │ └── CIQENVCICS44LLYUDQ5KVN6ALXC6QRHK2X4R6EUFRMBB5OSFO2FUYDQ.data │ │ │ ├── 2F │ │ │ └── CIQEUWUVLBXVFYSYCHHSCRTXCYHGIOBXKWUMKFR3UPAFHQ5WK5362FQ.data │ │ │ ├── 5V │ │ │ └── CIQFFRR4O52TS2Z7QLDDTF32OIR4FWLKT5YLL7MLDVIT7DC3NHOK5VA.data │ │ │ ├── 5X │ │ │ └── CIQJ23BL4UHXA2KTI6NLTXZM4PW4VEFWQBJ4ACZQAS37BLGL4HUO5XY.data │ │ │ ├── 7J │ │ │ └── CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ.data │ │ │ ├── AE │ │ │ └── CIQONICFQZH7QVU6IPSIM3AK7AD554D3BWZPAGEAQYQOWMFZQDUUAEI.data │ │ │ ├── AP │ │ │ └── CIQHAKDLTL5GMIFGN5YVY4BA22FPHUIODJEXS4LCTQDWA275XAJDAPI.data │ │ │ ├── C4 │ │ │ └── CIQDDZ5EDQK5AP7LRTLZHQZUR2R3GECRFV3WPKNL7PL2SKFIL2LXC4Y.data │ │ │ ├── CY │ │ │ └── CIQDMKFEUGKSLXMEXO774EZOYCYNHPRVFD53ZSAU7237F67XDSQGCYQ.data │ │ │ ├── DU │ │ │ └── CIQLBK52T5EHVHZY5URTG5JS3JCUJDQM2DRB5RVF33DCUUOFJNGVDUI.data │ │ │ ├── DX │ │ │ └── CIQPDQJBGYDZNMOAGGYNRNMP2VDKWBWGAEDDEJDACM3SGG3VIANDDXI.data │ │ │ ├── FN │ │ │ └── CIQIXBZMUTXFC5QIGMLJNXLLHZOPGSL2PBC65D4UIVWM6TI5F5TAFNI.data │ │ │ ├── GQ │ │ │ └── CIQH7OEYWXL34RWYL7VXLWEU4FWPVGT24VJT7DUZPTNLF25N25IGGQA.data │ │ │ ├── HD │ │ │ └── CIQDDVW2EZIJF4NQH7WJNESD7XHQSXA5EGJVNTPVHD7444C2KLKXHDI.data │ │ │ ├── IL │ │ │ └── CIQJFGRQHQ45VCQLM7AJNF2GF5UHUAGGHC6LLAH6VYDEKLQMD4QLILY.data │ │ │ ├── IR │ │ │ └── CIQERMRAAFXUAUOX3V2DCW7R77FRIVHQ3V5OIPPS3XQBX34KRPNOIRQ.data │ │ │ ├── LG │ │ │ └── CIQJBQD2O6K4CGJVCCTJNUP57QHR4SKHZ74OIITBBGLOMCO3ZOLWLGA.data │ │ │ ├── M4 │ │ │ └── CIQOLBQZSZAODJGGH6RYYVBUXHTS3SM5EORZDU63LYPEFUAFE4SBM4I.data │ │ │ ├── O6 │ │ │ └── CIQOYW2THIZBRGI7IN33ROGCKOFZLXJJ2MPKYZBTV4H3N7GYHXMAO6A.data │ │ │ ├── QF │ │ │ └── CIQGPALRQ24P6NS4OWHTQ7R247ZI7KJWP3QWPQYS43LFULQC5ANLQFI.data │ │ │ ├── R3 │ │ │ └── CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data │ │ │ ├── S5 │ │ │ └── CIQHBGZNZRPWVEFNMTLP4OS5EAVHFMCX2HD7FZUC2B3WUU3D4LGKS5A.data │ │ │ ├── SW │ │ │ └── CIQHPUVCWD6JA6AFUVD6VA64TGWP67KYA3AIMBUMVWGZ5AQN2L2HSWQ.data │ │ │ ├── TW │ │ │ └── CIQFEAGMNNXXTYKYQSANT6IBNTFN7WR5RPD5F6GN6MBKUUO25DNOTWQ.data │ │ │ ├── UN │ │ │ └── CIQOMBKARLB7PAITVSNH7VEGIQJRPL6J7FT2XYVKAXT4MQPXXPUYUNY.data │ │ │ ├── UW │ │ │ └── CIQDVKITASFS55MC2TXCX5XMZLMGTYVODWPEDIW7JYEG7YXBIA7IUWY.data │ │ │ ├── VO │ │ │ └── CIQGFTQ7FSI2COUXWWLOQ45VUM2GUZCGAXLWCTOKKPGTUWPXHBNIVOY.data │ │ │ ├── XO │ │ │ └── CIQJGO2B2N75IUEM372FSMG76VV256I4PXBULZZ5ASNLK4FL4EG7XOI.data │ │ │ ├── ZF │ │ │ └── CIQLBS5HG4PRCRQ7O4EBXFD5QN6MTI5YBYMCVQJDXPKCOVR6RMLHZFQ.data │ │ │ └── _README │ └── test-data │ │ ├── hello │ │ ├── recursive-get-dir │ │ ├── datastore │ │ │ ├── LOCK │ │ │ ├── CURRENT │ │ │ ├── 000002.ldb │ │ │ ├── 000005.ldb │ │ │ ├── 000010.ldb │ │ │ ├── MANIFEST-000014 │ │ │ ├── LOG.old │ │ │ └── LOG │ │ ├── version │ │ ├── init-docs │ │ │ ├── docs │ │ │ │ └── index │ │ │ ├── contact │ │ │ ├── help │ │ │ ├── readme │ │ │ ├── tour │ │ │ │ └── 0.0-intro │ │ │ └── security-notes │ │ └── blocks │ │ │ ├── CIQOH │ │ │ └── CIQOHMGEIKMPYHAUTL57JSEZN64SIJ5OIHSGJG4TJSSJLGI3PBJLQVI.data │ │ │ ├── CIQFT │ │ │ └── CIQFTFEEHEDF6KLBT32BFAGLXEZL4UWFNWM4LFTLMXQBCERZ6CMLX3Y.data │ │ │ ├── CIQEN │ │ │ └── CIQENVCICS44LLYUDQ5KVN6ALXC6QRHK2X4R6EUFRMBB5OSFO2FUYDQ.data │ │ │ ├── CIQEU │ │ │ └── CIQEUWUVLBXVFYSYCHHSCRTXCYHGIOBXKWUMKFR3UPAFHQ5WK5362FQ.data │ │ │ ├── CIQBE │ │ │ └── CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data │ │ │ ├── CIQDD │ │ │ ├── CIQDDVW2EZIJF4NQH7WJNESD7XHQSXA5EGJVNTPVHD7444C2KLKXHDI.data │ │ │ └── CIQDDZ5EDQK5AP7LRTLZHQZUR2R3GECRFV3WPKNL7PL2SKFIL2LXC4Y.data │ │ │ ├── CIQDM │ │ │ └── CIQDMKFEUGKSLXMEXO774EZOYCYNHPRVFD53ZSAU7237F67XDSQGCYQ.data │ │ │ ├── CIQDV │ │ │ └── CIQDVKITASFS55MC2TXCX5XMZLMGTYVODWPEDIW7JYEG7YXBIA7IUWY.data │ │ │ ├── CIQER │ │ │ └── CIQERMRAAFXUAUOX3V2DCW7R77FRIVHQ3V5OIPPS3XQBX34KRPNOIRQ.data │ │ │ ├── CIQFE │ │ │ └── CIQFEAGMNNXXTYKYQSANT6IBNTFN7WR5RPD5F6GN6MBKUUO25DNOTWQ.data │ │ │ ├── CIQFF │ │ │ └── CIQFFRR4O52TS2Z7QLDDTF32OIR4FWLKT5YLL7MLDVIT7DC3NHOK5VA.data │ │ │ ├── CIQGF │ │ │ └── CIQGFTQ7FSI2COUXWWLOQ45VUM2GUZCGAXLWCTOKKPGTUWPXHBNIVOY.data │ │ │ ├── CIQGP │ │ │ └── CIQGPALRQ24P6NS4OWHTQ7R247ZI7KJWP3QWPQYS43LFULQC5ANLQFI.data │ │ │ ├── CIQH7 │ │ │ └── CIQH7OEYWXL34RWYL7VXLWEU4FWPVGT24VJT7DUZPTNLF25N25IGGQA.data │ │ │ ├── CIQHA │ │ │ └── CIQHAKDLTL5GMIFGN5YVY4BA22FPHUIODJEXS4LCTQDWA275XAJDAPI.data │ │ │ ├── CIQHB │ │ │ └── CIQHBGZNZRPWVEFNMTLP4OS5EAVHFMCX2HD7FZUC2B3WUU3D4LGKS5A.data │ │ │ ├── CIQHP │ │ │ └── CIQHPUVCWD6JA6AFUVD6VA64TGWP67KYA3AIMBUMVWGZ5AQN2L2HSWQ.data │ │ │ ├── CIQIX │ │ │ └── CIQIXBZMUTXFC5QIGMLJNXLLHZOPGSL2PBC65D4UIVWM6TI5F5TAFNI.data │ │ │ ├── CIQJ2 │ │ │ └── CIQJ23BL4UHXA2KTI6NLTXZM4PW4VEFWQBJ4ACZQAS37BLGL4HUO5XY.data │ │ │ ├── CIQJB │ │ │ └── CIQJBQD2O6K4CGJVCCTJNUP57QHR4SKHZ74OIITBBGLOMCO3ZOLWLGA.data │ │ │ ├── CIQJF │ │ │ └── CIQJFGRQHQ45VCQLM7AJNF2GF5UHUAGGHC6LLAH6VYDEKLQMD4QLILY.data │ │ │ ├── CIQJG │ │ │ └── CIQJGO2B2N75IUEM372FSMG76VV256I4PXBULZZ5ASNLK4FL4EG7XOI.data │ │ │ ├── CIQKK │ │ │ └── CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ.data │ │ │ ├── CIQLB │ │ │ ├── CIQLBK52T5EHVHZY5URTG5JS3JCUJDQM2DRB5RVF33DCUUOFJNGVDUI.data │ │ │ └── CIQLBS5HG4PRCRQ7O4EBXFD5QN6MTI5YBYMCVQJDXPKCOVR6RMLHZFQ.data │ │ │ ├── CIQMB │ │ │ └── CIQMB7DLJFKD267QJ2B5FJNHZPTSVA7IB6OHXSQ2XSVEEKMKK6RT75I.data │ │ │ ├── CIQOL │ │ │ └── CIQOLBQZSZAODJGGH6RYYVBUXHTS3SM5EORZDU63LYPEFUAFE4SBM4I.data │ │ │ ├── CIQOM │ │ │ └── CIQOMBKARLB7PAITVSNH7VEGIQJRPL6J7FT2XYVKAXT4MQPXXPUYUNY.data │ │ │ ├── CIQON │ │ │ └── CIQONICFQZH7QVU6IPSIM3AK7AD554D3BWZPAGEAQYQOWMFZQDUUAEI.data │ │ │ ├── CIQOY │ │ │ └── CIQOYW2THIZBRGI7IN33ROGCKOFZLXJJ2MPKYZBTV4H3N7GYHXMAO6A.data │ │ │ └── CIQPD │ │ │ └── CIQPDQJBGYDZNMOAGGYNRNMP2VDKWBWGAEDDEJDACM3SGG3VIANDDXI.data │ │ ├── badconfig │ │ ├── badnode.json │ │ ├── no-newline │ │ ├── eth-block │ │ └── node.json ├── gateway │ └── test-folder │ │ ├── nested-folder │ │ ├── hello.txt │ │ ├── ipfs.txt │ │ └── nested.html │ │ ├── cat-folder │ │ └── cat.jpg │ │ └── index.html ├── sharness │ ├── .gitignore │ ├── lib │ │ ├── test-lib-hashes.sh │ │ └── iptb-lib.sh │ ├── t0000-sharness.sh │ ├── t0022-init-default.sh │ ├── Makefile │ └── t0020-init.sh ├── interop │ ├── node.js │ └── browser.js ├── cli │ ├── index.js │ ├── general.js │ ├── progress-bar.js │ ├── commands.js │ ├── version.js │ ├── id.js │ ├── dag.js │ ├── bitswap.js │ └── file.js ├── utils │ ├── clean.js │ ├── interop-daemon-spawner │ │ └── util.js │ ├── create-repo-browser.js │ ├── create-repo-nodejs.js │ ├── ipfs-factory-instance │ │ ├── default-config.json │ │ └── index.js │ └── ipfs-factory-daemon │ │ └── default-config.json ├── core │ └── interface │ │ ├── block.js │ │ ├── dag.js │ │ ├── files.js │ │ ├── pubsub.js │ │ ├── config.js │ │ ├── object.js │ │ ├── swarm.js │ │ ├── generic.js │ │ ├── interface.spec.js │ │ └── dht.js ├── http-api │ ├── interface │ │ ├── block.js │ │ ├── files.js │ │ ├── swarm.js │ │ ├── config.js │ │ ├── object.js │ │ └── pubsub.js │ ├── over-ipfs-api │ │ ├── version.js │ │ └── id.js │ ├── spec │ │ ├── version.js │ │ ├── bitswap.js │ │ ├── id.js │ │ └── files.js │ └── index.js └── bootstrapers.js ├── .dockerignore ├── examples ├── run-in-electron │ ├── renderer.js │ ├── index.html │ ├── README.md │ ├── package.json │ ├── build.sh │ └── main.js ├── browser-browserify │ ├── .gitignore │ ├── img │ │ ├── 1.png │ │ └── 2.png │ ├── README.md │ ├── package.json │ ├── public │ │ └── index.html │ └── src │ │ └── index.js ├── exchange-files-in-browser │ ├── .gitignore │ ├── img │ │ ├── final.png │ │ ├── connect-1.png │ │ ├── connect-2.png │ │ ├── diagram.monopic │ │ ├── fetch-files-1.png │ │ ├── fetch-files-2.png │ │ └── diagram.txt │ ├── public │ │ └── favicon.ico │ └── package.json ├── browser-webpack │ ├── .gitignore │ ├── .babelrc │ ├── img │ │ └── 1.png │ ├── index.html │ ├── src │ │ └── components │ │ │ └── index.js │ ├── .eslintrc │ ├── server.js │ ├── README.md │ ├── package.json │ └── webpack.config.js ├── ipfs-101 │ ├── hello.txt │ ├── package.json │ └── 1.js ├── traverse-ipld-graphs │ ├── git-objects │ │ ├── 177bf18bc707d82b21cdefd0b43b38fc8c5c13fe │ │ ├── 23cc25f631cb076d5de5036c87678ea713cbaa6a │ │ ├── ee71cef5001b84b0314438f76cf0acd338a2fd21 │ │ ├── 4e425dba7745a781f0712c9a01455899e8c0c249 │ │ ├── a5095353cd62a178663dd26efc2d61f4f61bccbe │ │ ├── dc9bd15e8b81b6565d3736f9c308bd1bba60f33a │ │ ├── ee62b3d206cb23f939208898f32d8708c0e3fa3c │ │ ├── 6850c7be7136e6be00976ddbae80671b945c3e9d │ │ ├── 0f328c91df28c5c01b9e9f9f7e663191fa156593 │ │ └── e68e6f6e31857877a79fd6b3956898436bb5a76f │ ├── eth-blocks │ │ ├── block_302515 │ │ ├── block_302516 │ │ └── block_302517 │ ├── create-node.js │ ├── put.js │ ├── get.js │ ├── get-path.js │ ├── README.md │ ├── tree.js │ ├── get-path-accross-formats.js │ └── eth.js ├── explore-ethereum-blockchain │ ├── eth-stuffs │ │ ├── block_302515 │ │ ├── block_302516 │ │ ├── block_302517 │ │ ├── state_0_302516 │ │ ├── state_r_302516 │ │ ├── state_000_302516 │ │ ├── state_00_302516 │ │ ├── state_000017_302516 │ │ ├── state_00001_302516 │ │ └── state_0000_302516 │ ├── load-eth-stuffs.sh │ └── README.md ├── ipfs-cli-fun │ └── README.md ├── browser-script-tag │ └── README.md └── browser-video-streaming │ ├── index.html │ └── streaming.js ├── src ├── http │ ├── api │ │ ├── resources │ │ │ ├── repo.js │ │ │ ├── version.js │ │ │ ├── id.js │ │ │ ├── index.js │ │ │ └── bitswap.js │ │ └── routes │ │ │ ├── id.js │ │ │ ├── repo.js │ │ │ ├── version.js │ │ │ ├── file.js │ │ │ ├── index.js │ │ │ ├── bitswap.js │ │ │ ├── pubsub.js │ │ │ ├── config.js │ │ │ ├── debug.js │ │ │ ├── block.js │ │ │ ├── bootstrap.js │ │ │ ├── files.js │ │ │ └── swarm.js │ ├── gateway │ │ ├── resources │ │ │ └── index.js │ │ ├── routes │ │ │ ├── index.js │ │ │ └── gateway.js │ │ └── utils │ │ │ └── path.js │ └── error-handler.js ├── init-files │ └── init-docs │ │ ├── docs │ │ └── index │ │ ├── contact │ │ ├── help │ │ ├── readme │ │ ├── tour │ │ └── 0.0-intro │ │ └── security-notes ├── index.js ├── core │ ├── utils.js │ ├── runtime │ │ ├── repo-browser.js │ │ ├── repo-nodejs.js │ │ ├── libp2p-browser.js │ │ ├── config-browser.json │ │ ├── config-nodejs.json │ │ └── libp2p-nodejs.js │ ├── components │ │ ├── is-online.js │ │ ├── ping.js │ │ ├── repo.js │ │ ├── version.js │ │ ├── config.js │ │ ├── id.js │ │ ├── index.js │ │ ├── bitswap.js │ │ ├── stop.js │ │ ├── pre-start.js │ │ ├── init-assets.js │ │ └── start.js │ └── state.js └── cli │ └── commands │ ├── repo │ ├── gc.js │ ├── init.js │ └── version.js │ ├── bitswap │ ├── unwant.js │ ├── wantlist.js │ └── stat.js │ ├── pubsub.js │ ├── repo.js │ ├── swarm.js │ ├── block.js │ ├── dag.js │ ├── object.js │ ├── bootstrap.js │ ├── file.js │ ├── object │ ├── patch.js │ ├── data.js │ ├── new.js │ ├── links.js │ ├── stat.js │ ├── patch │ │ ├── add-link.js │ │ ├── rm-link.js │ │ ├── set-data.js │ │ └── append-data.js │ ├── get.js │ └── put.js │ ├── bitswap.js │ ├── files.js │ ├── pubsub │ ├── pub.js │ ├── peers.js │ ├── ls.js │ └── sub.js │ ├── bootstrap │ ├── list.js │ ├── add.js │ └── rm.js │ ├── block │ ├── get.js │ ├── stat.js │ └── rm.js │ ├── id.js │ ├── files │ └── cat.js │ ├── file │ └── ls.js │ ├── config │ ├── show.js │ └── replace.js │ ├── swarm │ ├── connect.js │ ├── disconnect.js │ ├── addrs.js │ ├── addrs │ │ └── local.js │ └── peers.js │ ├── version.js │ ├── commands.js │ ├── init.js │ ├── daemon.js │ ├── dag │ └── get.js │ ├── ls.js │ └── config.js ├── img ├── core.png ├── core.monopic ├── overview.png ├── overview.monopic └── overview.txt ├── init-and-daemon.sh ├── CODE_OF_CONDUCT.md ├── appveyor.yml ├── Dockerfile ├── .travis.yml ├── Makefile ├── RELEASE.md ├── .npmignore ├── CONTRIBUTING.md ├── .gitignore ├── circle.yml └── LICENSE /ci/jenkins: -------------------------------------------------------------------------------- 1 | javascript 2 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /examples/run-in-electron/renderer.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/datastore/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/version: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /examples/browser-browserify/.gitignore: -------------------------------------------------------------------------------- 1 | bundle.js -------------------------------------------------------------------------------- /src/http/api/resources/repo.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | -------------------------------------------------------------------------------- /src/init-files/init-docs/docs/index: -------------------------------------------------------------------------------- 1 | Index 2 | -------------------------------------------------------------------------------- /test/fixtures/test-data/hello: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /ci/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/ipfs/js-base:6.9.4 2 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/datastore/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/version: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /test/gateway/test-folder/nested-folder/hello.txt: -------------------------------------------------------------------------------- 1 | Hello 2 | -------------------------------------------------------------------------------- /test/gateway/test-folder/nested-folder/ipfs.txt: -------------------------------------------------------------------------------- 1 | IPFS 2 | -------------------------------------------------------------------------------- /test/fixtures/test-data/badconfig: -------------------------------------------------------------------------------- 1 | { 2 | bad config 3 | } 4 | -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/.gitignore: -------------------------------------------------------------------------------- 1 | public/js/ipfs.js 2 | -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/datastore/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000014 2 | -------------------------------------------------------------------------------- /test/fixtures/test-data/badnode.json: -------------------------------------------------------------------------------- 1 | { 2 | bad config 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/test-data/no-newline: -------------------------------------------------------------------------------- 1 | there is no newline at end of this file -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/init-docs/docs/index: -------------------------------------------------------------------------------- 1 | Index 2 | -------------------------------------------------------------------------------- /img/core.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/img/core.png -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/SHARDING: -------------------------------------------------------------------------------- 1 | /repo/flatfs/shard/v1/next-to-last/2 2 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/datastore/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000014 2 | -------------------------------------------------------------------------------- /img/core.monopic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/img/core.monopic -------------------------------------------------------------------------------- /img/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/img/overview.png -------------------------------------------------------------------------------- /examples/browser-webpack/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | npm-debug.log 3 | .DS_Store 4 | dist 5 | -------------------------------------------------------------------------------- /examples/ipfs-101/hello.txt: -------------------------------------------------------------------------------- 1 | Hello, how are you today? Welcome to the Distributed Web! 2 | -------------------------------------------------------------------------------- /img/overview.monopic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/img/overview.monopic -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/QV/CIQOHMGEIKMPYHAUTL57JSEZN64SIJ5OIHSGJG4TJSSJLGI3PBJLQVI.data: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/sharness/.gitignore: -------------------------------------------------------------------------------- 1 | !/lib/ 2 | lib/sharness/ 3 | test-results/ 4 | trash directory.*.sh/ 5 | -------------------------------------------------------------------------------- /examples/browser-webpack/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "stage-0", 4 | "react" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/177bf18bc707d82b21cdefd0b43b38fc8c5c13fe: -------------------------------------------------------------------------------- 1 | blob 14Git IPLD demo 2 | -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/X3/CIQFTFEEHEDF6KLBT32BFAGLXEZL4UWFNWM4LFTLMXQBCERZ6CMLX3Y.data: -------------------------------------------------------------------------------- 1 | 2 |  -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const IPFS = require('./core') 4 | 5 | exports = module.exports = IPFS 6 | -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/23cc25f631cb076d5de5036c87678ea713cbaa6a: -------------------------------------------------------------------------------- 1 | blob 21echo 'Hello, World!' 2 | -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/ee71cef5001b84b0314438f76cf0acd338a2fd21: -------------------------------------------------------------------------------- 1 | blob 20echo 'hello world!' 2 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQOH/CIQOHMGEIKMPYHAUTL57JSEZN64SIJ5OIHSGJG4TJSSJLGI3PBJLQVI.data: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/browser-webpack/img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/browser-webpack/img/1.png -------------------------------------------------------------------------------- /src/http/gateway/resources/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | gateway: require('./gateway') 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/test-data/eth-block: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/eth-block -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQFT/CIQFTFEEHEDF6KLBT32BFAGLXEZL4UWFNWM4LFTLMXQBCERZ6CMLX3Y.data: -------------------------------------------------------------------------------- 1 | 2 |  -------------------------------------------------------------------------------- /examples/browser-browserify/img/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/browser-browserify/img/1.png -------------------------------------------------------------------------------- /examples/browser-browserify/img/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/browser-browserify/img/2.png -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/YD/CIQENVCICS44LLYUDQ5KVN6ALXC6QRHK2X4R6EUFRMBB5OSFO2FUYDQ.data: -------------------------------------------------------------------------------- 1 | 2 |  hello world 3 |  -------------------------------------------------------------------------------- /src/http/gateway/routes/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = (server) => { 4 | require('./gateway')(server) 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQEN/CIQENVCICS44LLYUDQ5KVN6ALXC6QRHK2X4R6EUFRMBB5OSFO2FUYDQ.data: -------------------------------------------------------------------------------- 1 | 2 |  hello world 3 |  -------------------------------------------------------------------------------- /test/gateway/test-folder/cat-folder/cat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/gateway/test-folder/cat-folder/cat.jpg -------------------------------------------------------------------------------- /src/core/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.OFFLINE_ERROR = 'This command must be run in online mode. Try running \'ipfs daemon\' first.' 4 | -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/datastore/000002.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/datastore/000002.ldb -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/datastore/000005.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/datastore/000005.ldb -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/datastore/000010.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/datastore/000010.ldb -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/img/final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/exchange-files-in-browser/img/final.png -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/img/connect-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/exchange-files-in-browser/img/connect-1.png -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/img/connect-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/exchange-files-in-browser/img/connect-2.png -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/datastore/MANIFEST-000014: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/datastore/MANIFEST-000014 -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/img/diagram.monopic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/exchange-files-in-browser/img/diagram.monopic -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/exchange-files-in-browser/public/favicon.ico -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/eth-blocks/block_302515: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/traverse-ipld-graphs/eth-blocks/block_302515 -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/eth-blocks/block_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/traverse-ipld-graphs/eth-blocks/block_302516 -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/eth-blocks/block_302517: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/traverse-ipld-graphs/eth-blocks/block_302517 -------------------------------------------------------------------------------- /init-and-daemon.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh -e 2 | node src/cli/bin.js init 3 | 4 | sed -i.bak 's/127.0.0.1/0.0.0.0/g' $IPFS_PATH/config 5 | 6 | node src/cli/bin.js daemon 7 | -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/img/fetch-files-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/exchange-files-in-browser/img/fetch-files-1.png -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/img/fetch-files-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/exchange-files-in-browser/img/fetch-files-2.png -------------------------------------------------------------------------------- /test/fixtures/test-data/node.json: -------------------------------------------------------------------------------- 1 | { "Data": "another", "Links": [ { "Name": "some link", "Hash": "QmXg9Pp2ytZ14xgmQjYEiHjVjMFXzCVVEcRTWJBmLgR39V", "Size": 8 } ] } 2 | -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/block_302515: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/block_302515 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/block_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/block_302516 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/block_302517: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/block_302517 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/state_0_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/state_0_302516 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/state_r_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/state_r_302516 -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/datastore/000002.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/datastore/000002.ldb -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/datastore/000005.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/datastore/000005.ldb -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/datastore/000010.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/datastore/000010.ldb -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/state_000_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/state_000_302516 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/state_00_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/state_00_302516 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/state_000017_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/state_000017_302516 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/state_00001_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/state_00001_302516 -------------------------------------------------------------------------------- /examples/explore-ethereum-blockchain/eth-stuffs/state_0000_302516: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/explore-ethereum-blockchain/eth-stuffs/state_0000_302516 -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/datastore/MANIFEST-000014: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/datastore/MANIFEST-000014 -------------------------------------------------------------------------------- /examples/ipfs-cli-fun/README.md: -------------------------------------------------------------------------------- 1 | # Interact with IPFS directly from your Terminal 2 | 3 | ![](http://1.bp.blogspot.com/-tNvSnCW0KlQ/U-KOKGVoJkI/AAAAAAAAA3Q/aiSLMeSJFtw/s1600/WIP-sign.jpg) 4 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | The `js-ipfs` project follows the [`IPFS Community Code of Conduct`](https://github.com/ipfs/community/blob/master/code-of-conduct.md) 4 | -------------------------------------------------------------------------------- /src/cli/commands/repo/gc.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'gc', 5 | 6 | describe: '', 7 | 8 | builder: {}, 9 | 10 | handler (argv) { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/cli/commands/repo/init.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'init', 5 | 6 | describe: '', 7 | 8 | builder: {}, 9 | 10 | handler (argv) { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/interop/node.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | require('./repo') 5 | require('./exchange-files') 6 | require('./circuit-relay') 7 | require('./kad-dht') 8 | require('./pubsub') 9 | -------------------------------------------------------------------------------- /src/core/runtime/repo-browser.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const IPFSRepo = require('ipfs-repo') 4 | 5 | module.exports = (dir) => { 6 | const repoPath = dir || 'ipfs' 7 | return new IPFSRepo(repoPath) 8 | } 9 | -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/4e425dba7745a781f0712c9a01455899e8c0c249: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/traverse-ipld-graphs/git-objects/4e425dba7745a781f0712c9a01455899e8c0c249 -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/a5095353cd62a178663dd26efc2d61f4f61bccbe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/traverse-ipld-graphs/git-objects/a5095353cd62a178663dd26efc2d61f4f61bccbe -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/dc9bd15e8b81b6565d3736f9c308bd1bba60f33a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/traverse-ipld-graphs/git-objects/dc9bd15e8b81b6565d3736f9c308bd1bba60f33a -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/ee62b3d206cb23f939208898f32d8708c0e3fa3c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/examples/traverse-ipld-graphs/git-objects/ee62b3d206cb23f939208898f32d8708c0e3fa3c -------------------------------------------------------------------------------- /test/gateway/test-folder/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IPFS test index.html 6 | 7 | 8 | index.html 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/core/components/is-online.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = function isOnline (self) { 4 | return () => { 5 | return Boolean(self._bitswap && self._libp2pNode && self._libp2pNode.isStarted()) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/2F/CIQEUWUVLBXVFYSYCHHSCRTXCYHGIOBXKWUMKFR3UPAFHQ5WK5362FQ.data: -------------------------------------------------------------------------------- 1 | 2 | ys# js-ipfs-repo 3 | Implementation of the IPFS repo spec (https://github.com/ipfs/specs/tree/master/repo) in JavaScript 4 | s -------------------------------------------------------------------------------- /examples/browser-webpack/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sample App 4 | 5 | 6 |
7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/gateway/test-folder/nested-folder/nested.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IPFS test nested.html 6 | 7 | 8 | nested.html 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/browser-webpack/src/components/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const React = require('react') 4 | const ReactDOM = require('react-dom') 5 | const App = require('./app') 6 | 7 | ReactDOM.render(, document.getElementById('root')) 8 | -------------------------------------------------------------------------------- /src/init-files/init-docs/contact: -------------------------------------------------------------------------------- 1 | Come hang out in our IRC chat room if you have any questions. 2 | 3 | Contact the ipfs dev team: 4 | - Bugs: https://github.com/ipfs/go-ipfs/issues 5 | - Help: irc.freenode.org/#ipfs 6 | - Email: dev@ipfs.io 7 | -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/5V/CIQFFRR4O52TS2Z7QLDDTF32OIR4FWLKT5YLL7MLDVIT7DC3NHOK5VA.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/5V/CIQFFRR4O52TS2Z7QLDDTF32OIR4FWLKT5YLL7MLDVIT7DC3NHOK5VA.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/5X/CIQJ23BL4UHXA2KTI6NLTXZM4PW4VEFWQBJ4ACZQAS37BLGL4HUO5XY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/5X/CIQJ23BL4UHXA2KTI6NLTXZM4PW4VEFWQBJ4ACZQAS37BLGL4HUO5XY.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/75/CIQMB7DLJFKD267QJ2B5FJNHZPTSVA7IB6OHXSQ2XSVEEKMKK6RT75I.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/75/CIQMB7DLJFKD267QJ2B5FJNHZPTSVA7IB6OHXSQ2XSVEEKMKK6RT75I.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/7J/CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/7J/CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/AE/CIQONICFQZH7QVU6IPSIM3AK7AD554D3BWZPAGEAQYQOWMFZQDUUAEI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/AE/CIQONICFQZH7QVU6IPSIM3AK7AD554D3BWZPAGEAQYQOWMFZQDUUAEI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/AP/CIQHAKDLTL5GMIFGN5YVY4BA22FPHUIODJEXS4LCTQDWA275XAJDAPI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/AP/CIQHAKDLTL5GMIFGN5YVY4BA22FPHUIODJEXS4LCTQDWA275XAJDAPI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/C4/CIQDDZ5EDQK5AP7LRTLZHQZUR2R3GECRFV3WPKNL7PL2SKFIL2LXC4Y.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/C4/CIQDDZ5EDQK5AP7LRTLZHQZUR2R3GECRFV3WPKNL7PL2SKFIL2LXC4Y.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/CY/CIQDMKFEUGKSLXMEXO774EZOYCYNHPRVFD53ZSAU7237F67XDSQGCYQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/CY/CIQDMKFEUGKSLXMEXO774EZOYCYNHPRVFD53ZSAU7237F67XDSQGCYQ.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/DU/CIQLBK52T5EHVHZY5URTG5JS3JCUJDQM2DRB5RVF33DCUUOFJNGVDUI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/DU/CIQLBK52T5EHVHZY5URTG5JS3JCUJDQM2DRB5RVF33DCUUOFJNGVDUI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/DX/CIQPDQJBGYDZNMOAGGYNRNMP2VDKWBWGAEDDEJDACM3SGG3VIANDDXI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/DX/CIQPDQJBGYDZNMOAGGYNRNMP2VDKWBWGAEDDEJDACM3SGG3VIANDDXI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/FN/CIQIXBZMUTXFC5QIGMLJNXLLHZOPGSL2PBC65D4UIVWM6TI5F5TAFNI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/FN/CIQIXBZMUTXFC5QIGMLJNXLLHZOPGSL2PBC65D4UIVWM6TI5F5TAFNI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/GQ/CIQH7OEYWXL34RWYL7VXLWEU4FWPVGT24VJT7DUZPTNLF25N25IGGQA.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/GQ/CIQH7OEYWXL34RWYL7VXLWEU4FWPVGT24VJT7DUZPTNLF25N25IGGQA.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/HD/CIQDDVW2EZIJF4NQH7WJNESD7XHQSXA5EGJVNTPVHD7444C2KLKXHDI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/HD/CIQDDVW2EZIJF4NQH7WJNESD7XHQSXA5EGJVNTPVHD7444C2KLKXHDI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/IL/CIQJFGRQHQ45VCQLM7AJNF2GF5UHUAGGHC6LLAH6VYDEKLQMD4QLILY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/IL/CIQJFGRQHQ45VCQLM7AJNF2GF5UHUAGGHC6LLAH6VYDEKLQMD4QLILY.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/IR/CIQERMRAAFXUAUOX3V2DCW7R77FRIVHQ3V5OIPPS3XQBX34KRPNOIRQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/IR/CIQERMRAAFXUAUOX3V2DCW7R77FRIVHQ3V5OIPPS3XQBX34KRPNOIRQ.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/LG/CIQJBQD2O6K4CGJVCCTJNUP57QHR4SKHZ74OIITBBGLOMCO3ZOLWLGA.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/LG/CIQJBQD2O6K4CGJVCCTJNUP57QHR4SKHZ74OIITBBGLOMCO3ZOLWLGA.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/M4/CIQOLBQZSZAODJGGH6RYYVBUXHTS3SM5EORZDU63LYPEFUAFE4SBM4I.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/M4/CIQOLBQZSZAODJGGH6RYYVBUXHTS3SM5EORZDU63LYPEFUAFE4SBM4I.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/O6/CIQOYW2THIZBRGI7IN33ROGCKOFZLXJJ2MPKYZBTV4H3N7GYHXMAO6A.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/O6/CIQOYW2THIZBRGI7IN33ROGCKOFZLXJJ2MPKYZBTV4H3N7GYHXMAO6A.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/QF/CIQGPALRQ24P6NS4OWHTQ7R247ZI7KJWP3QWPQYS43LFULQC5ANLQFI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/QF/CIQGPALRQ24P6NS4OWHTQ7R247ZI7KJWP3QWPQYS43LFULQC5ANLQFI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/R3/CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/R3/CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/S5/CIQHBGZNZRPWVEFNMTLP4OS5EAVHFMCX2HD7FZUC2B3WUU3D4LGKS5A.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/S5/CIQHBGZNZRPWVEFNMTLP4OS5EAVHFMCX2HD7FZUC2B3WUU3D4LGKS5A.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/SW/CIQHPUVCWD6JA6AFUVD6VA64TGWP67KYA3AIMBUMVWGZ5AQN2L2HSWQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/SW/CIQHPUVCWD6JA6AFUVD6VA64TGWP67KYA3AIMBUMVWGZ5AQN2L2HSWQ.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/TW/CIQFEAGMNNXXTYKYQSANT6IBNTFN7WR5RPD5F6GN6MBKUUO25DNOTWQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/TW/CIQFEAGMNNXXTYKYQSANT6IBNTFN7WR5RPD5F6GN6MBKUUO25DNOTWQ.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/UN/CIQOMBKARLB7PAITVSNH7VEGIQJRPL6J7FT2XYVKAXT4MQPXXPUYUNY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/UN/CIQOMBKARLB7PAITVSNH7VEGIQJRPL6J7FT2XYVKAXT4MQPXXPUYUNY.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/UW/CIQDVKITASFS55MC2TXCX5XMZLMGTYVODWPEDIW7JYEG7YXBIA7IUWY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/UW/CIQDVKITASFS55MC2TXCX5XMZLMGTYVODWPEDIW7JYEG7YXBIA7IUWY.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/VO/CIQGFTQ7FSI2COUXWWLOQ45VUM2GUZCGAXLWCTOKKPGTUWPXHBNIVOY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/VO/CIQGFTQ7FSI2COUXWWLOQ45VUM2GUZCGAXLWCTOKKPGTUWPXHBNIVOY.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/XO/CIQJGO2B2N75IUEM372FSMG76VV256I4PXBULZZ5ASNLK4FL4EG7XOI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/XO/CIQJGO2B2N75IUEM372FSMG76VV256I4PXBULZZ5ASNLK4FL4EG7XOI.data -------------------------------------------------------------------------------- /test/fixtures/go-ipfs-repo/blocks/ZF/CIQLBS5HG4PRCRQ7O4EBXFD5QN6MTI5YBYMCVQJDXPKCOVR6RMLHZFQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/go-ipfs-repo/blocks/ZF/CIQLBS5HG4PRCRQ7O4EBXFD5QN6MTI5YBYMCVQJDXPKCOVR6RMLHZFQ.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQEU/CIQEUWUVLBXVFYSYCHHSCRTXCYHGIOBXKWUMKFR3UPAFHQ5WK5362FQ.data: -------------------------------------------------------------------------------- 1 | 2 | ys# js-ipfs-repo 3 | Implementation of the IPFS repo spec (https://github.com/ipfs/specs/tree/master/repo) in JavaScript 4 | s -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/6850c7be7136e6be00976ddbae80671b945c3e9d: -------------------------------------------------------------------------------- 1 | tag 142object e68e6f6e31857877a79fd6b3956898436bb5a76f 2 | type commit 3 | tag v1.0.0 4 | tagger John Doe 1504620173 +0200 5 | 6 | Release v1.0.0 7 | -------------------------------------------------------------------------------- /src/core/components/ping.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const promisify = require('promisify-es6') 4 | 5 | module.exports = function ping (self) { 6 | return promisify((callback) => { 7 | callback(new Error('Not implemented')) 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /examples/browser-webpack/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "standard", 3 | "rules": { 4 | "react/jsx-uses-react": 2, 5 | "react/jsx-uses-vars": 2, 6 | "react/react-in-jsx-scope": 2 7 | }, 8 | "plugins": [ 9 | "react" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/init-docs/contact: -------------------------------------------------------------------------------- 1 | Come hang out in our IRC chat room if you have any questions. 2 | 3 | Contact the ipfs dev team: 4 | - Bugs: https://github.com/ipfs/go-ipfs/issues 5 | - Help: irc.freenode.org/#ipfs 6 | - Email: dev@ipfs.io 7 | -------------------------------------------------------------------------------- /src/cli/commands/bitswap/unwant.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'unwant ', 5 | 6 | describe: 'Remove a given block from your wantlist.', 7 | 8 | handler (argv) { 9 | throw new Error('Not implemented yet') 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/cli/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const fs = require('fs') 5 | 6 | describe('cli', () => { 7 | fs.readdirSync(__dirname) 8 | .filter((file) => file !== 'index.js') 9 | .forEach((file) => require('./' + file)) 10 | }) 11 | -------------------------------------------------------------------------------- /src/cli/commands/pubsub.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'pubsub', 5 | 6 | description: 'pubsub commands', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('pubsub') 11 | }, 12 | 13 | handler (argv) {} 14 | } 15 | -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/0f328c91df28c5c01b9e9f9f7e663191fa156593: -------------------------------------------------------------------------------- 1 | commit 175tree dc9bd15e8b81b6565d3736f9c308bd1bba60f33a 2 | author John Doe 1504619620 +0200 3 | committer John Doe 1504619620 +0200 4 | 5 | Initial commit 6 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQBE/CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQBE/CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQDD/CIQDDVW2EZIJF4NQH7WJNESD7XHQSXA5EGJVNTPVHD7444C2KLKXHDI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQDD/CIQDDVW2EZIJF4NQH7WJNESD7XHQSXA5EGJVNTPVHD7444C2KLKXHDI.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQDD/CIQDDZ5EDQK5AP7LRTLZHQZUR2R3GECRFV3WPKNL7PL2SKFIL2LXC4Y.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQDD/CIQDDZ5EDQK5AP7LRTLZHQZUR2R3GECRFV3WPKNL7PL2SKFIL2LXC4Y.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQDM/CIQDMKFEUGKSLXMEXO774EZOYCYNHPRVFD53ZSAU7237F67XDSQGCYQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQDM/CIQDMKFEUGKSLXMEXO774EZOYCYNHPRVFD53ZSAU7237F67XDSQGCYQ.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQDV/CIQDVKITASFS55MC2TXCX5XMZLMGTYVODWPEDIW7JYEG7YXBIA7IUWY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQDV/CIQDVKITASFS55MC2TXCX5XMZLMGTYVODWPEDIW7JYEG7YXBIA7IUWY.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQER/CIQERMRAAFXUAUOX3V2DCW7R77FRIVHQ3V5OIPPS3XQBX34KRPNOIRQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQER/CIQERMRAAFXUAUOX3V2DCW7R77FRIVHQ3V5OIPPS3XQBX34KRPNOIRQ.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQFE/CIQFEAGMNNXXTYKYQSANT6IBNTFN7WR5RPD5F6GN6MBKUUO25DNOTWQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQFE/CIQFEAGMNNXXTYKYQSANT6IBNTFN7WR5RPD5F6GN6MBKUUO25DNOTWQ.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQFF/CIQFFRR4O52TS2Z7QLDDTF32OIR4FWLKT5YLL7MLDVIT7DC3NHOK5VA.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQFF/CIQFFRR4O52TS2Z7QLDDTF32OIR4FWLKT5YLL7MLDVIT7DC3NHOK5VA.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQGF/CIQGFTQ7FSI2COUXWWLOQ45VUM2GUZCGAXLWCTOKKPGTUWPXHBNIVOY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQGF/CIQGFTQ7FSI2COUXWWLOQ45VUM2GUZCGAXLWCTOKKPGTUWPXHBNIVOY.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQGP/CIQGPALRQ24P6NS4OWHTQ7R247ZI7KJWP3QWPQYS43LFULQC5ANLQFI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQGP/CIQGPALRQ24P6NS4OWHTQ7R247ZI7KJWP3QWPQYS43LFULQC5ANLQFI.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQH7/CIQH7OEYWXL34RWYL7VXLWEU4FWPVGT24VJT7DUZPTNLF25N25IGGQA.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQH7/CIQH7OEYWXL34RWYL7VXLWEU4FWPVGT24VJT7DUZPTNLF25N25IGGQA.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQHA/CIQHAKDLTL5GMIFGN5YVY4BA22FPHUIODJEXS4LCTQDWA275XAJDAPI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQHA/CIQHAKDLTL5GMIFGN5YVY4BA22FPHUIODJEXS4LCTQDWA275XAJDAPI.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQHB/CIQHBGZNZRPWVEFNMTLP4OS5EAVHFMCX2HD7FZUC2B3WUU3D4LGKS5A.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQHB/CIQHBGZNZRPWVEFNMTLP4OS5EAVHFMCX2HD7FZUC2B3WUU3D4LGKS5A.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQHP/CIQHPUVCWD6JA6AFUVD6VA64TGWP67KYA3AIMBUMVWGZ5AQN2L2HSWQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQHP/CIQHPUVCWD6JA6AFUVD6VA64TGWP67KYA3AIMBUMVWGZ5AQN2L2HSWQ.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQIX/CIQIXBZMUTXFC5QIGMLJNXLLHZOPGSL2PBC65D4UIVWM6TI5F5TAFNI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQIX/CIQIXBZMUTXFC5QIGMLJNXLLHZOPGSL2PBC65D4UIVWM6TI5F5TAFNI.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQJ2/CIQJ23BL4UHXA2KTI6NLTXZM4PW4VEFWQBJ4ACZQAS37BLGL4HUO5XY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQJ2/CIQJ23BL4UHXA2KTI6NLTXZM4PW4VEFWQBJ4ACZQAS37BLGL4HUO5XY.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQJB/CIQJBQD2O6K4CGJVCCTJNUP57QHR4SKHZ74OIITBBGLOMCO3ZOLWLGA.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQJB/CIQJBQD2O6K4CGJVCCTJNUP57QHR4SKHZ74OIITBBGLOMCO3ZOLWLGA.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQJF/CIQJFGRQHQ45VCQLM7AJNF2GF5UHUAGGHC6LLAH6VYDEKLQMD4QLILY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQJF/CIQJFGRQHQ45VCQLM7AJNF2GF5UHUAGGHC6LLAH6VYDEKLQMD4QLILY.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQJG/CIQJGO2B2N75IUEM372FSMG76VV256I4PXBULZZ5ASNLK4FL4EG7XOI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQJG/CIQJGO2B2N75IUEM372FSMG76VV256I4PXBULZZ5ASNLK4FL4EG7XOI.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQKK/CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQKK/CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQLB/CIQLBK52T5EHVHZY5URTG5JS3JCUJDQM2DRB5RVF33DCUUOFJNGVDUI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQLB/CIQLBK52T5EHVHZY5URTG5JS3JCUJDQM2DRB5RVF33DCUUOFJNGVDUI.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQLB/CIQLBS5HG4PRCRQ7O4EBXFD5QN6MTI5YBYMCVQJDXPKCOVR6RMLHZFQ.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQLB/CIQLBS5HG4PRCRQ7O4EBXFD5QN6MTI5YBYMCVQJDXPKCOVR6RMLHZFQ.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQMB/CIQMB7DLJFKD267QJ2B5FJNHZPTSVA7IB6OHXSQ2XSVEEKMKK6RT75I.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQMB/CIQMB7DLJFKD267QJ2B5FJNHZPTSVA7IB6OHXSQ2XSVEEKMKK6RT75I.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQOL/CIQOLBQZSZAODJGGH6RYYVBUXHTS3SM5EORZDU63LYPEFUAFE4SBM4I.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQOL/CIQOLBQZSZAODJGGH6RYYVBUXHTS3SM5EORZDU63LYPEFUAFE4SBM4I.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQOM/CIQOMBKARLB7PAITVSNH7VEGIQJRPL6J7FT2XYVKAXT4MQPXXPUYUNY.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQOM/CIQOMBKARLB7PAITVSNH7VEGIQJRPL6J7FT2XYVKAXT4MQPXXPUYUNY.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQON/CIQONICFQZH7QVU6IPSIM3AK7AD554D3BWZPAGEAQYQOWMFZQDUUAEI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQON/CIQONICFQZH7QVU6IPSIM3AK7AD554D3BWZPAGEAQYQOWMFZQDUUAEI.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQOY/CIQOYW2THIZBRGI7IN33ROGCKOFZLXJJ2MPKYZBTV4H3N7GYHXMAO6A.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQOY/CIQOYW2THIZBRGI7IN33ROGCKOFZLXJJ2MPKYZBTV4H3N7GYHXMAO6A.data -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/blocks/CIQPD/CIQPDQJBGYDZNMOAGGYNRNMP2VDKWBWGAEDDEJDACM3SGG3VIANDDXI.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/js-ipfs/master/test/fixtures/test-data/recursive-get-dir/blocks/CIQPD/CIQPDQJBGYDZNMOAGGYNRNMP2VDKWBWGAEDDEJDACM3SGG3VIANDDXI.data -------------------------------------------------------------------------------- /src/cli/commands/repo.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'repo', 5 | 6 | description: 'Manipulate the IPFS repo.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('repo') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cli/commands/swarm.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'swarm', 5 | 6 | description: 'Swarm inspection tool.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('swarm') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/interop/browser.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | describe('browser interop tests', () => { 5 | it('need to get written', function (done) { 6 | this.timeout(10 * 1000) 7 | // for teardown time 8 | setTimeout(done, 5 * 1000) 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /src/cli/commands/block.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'block', 5 | 6 | description: 'Manipulate raw IPFS blocks.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('block') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cli/commands/dag.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'dag', 5 | 6 | description: 'Interact with ipld dag objects.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('dag') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cli/commands/object.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'object', 5 | 6 | description: 'Interact with ipfs objects.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('object') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/http/api/routes/id.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const resources = require('./../resources') 4 | 5 | module.exports = (server) => { 6 | const api = server.select('API') 7 | 8 | api.route({ 9 | method: '*', 10 | path: '/api/v0/id', 11 | handler: resources.id.get 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /src/core/runtime/repo-nodejs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const os = require('os') 4 | const IPFSRepo = require('ipfs-repo') 5 | const path = require('path') 6 | 7 | module.exports = (dir) => { 8 | const repoPath = dir || path.join(os.homedir(), '.jsipfs') 9 | 10 | return new IPFSRepo(repoPath) 11 | } 12 | -------------------------------------------------------------------------------- /test/utils/clean.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const rimraf = require('rimraf') 4 | const fs = require('fs') 5 | 6 | module.exports = (dir) => { 7 | try { 8 | fs.accessSync(dir) 9 | } catch (err) { 10 | // Does not exist so all good 11 | return 12 | } 13 | 14 | rimraf.sync(dir) 15 | } 16 | -------------------------------------------------------------------------------- /src/cli/commands/bootstrap.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'bootstrap', 5 | 6 | description: 'Show or edit the list of bootstrap peers.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('bootstrap') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cli/commands/file.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'file', 5 | 6 | description: 'Interact with IPFS objects representing Unix filesystems.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('file') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/http/api/routes/repo.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const resources = require('./../resources') 4 | 5 | // TODO 6 | module.exports = (server) => { 7 | const api = server.select('API') 8 | 9 | api.route({ 10 | method: '*', 11 | path: '/api/v0/repo', 12 | handler: resources.repo 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /src/http/api/routes/version.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const resources = require('./../resources') 4 | 5 | module.exports = (server) => { 6 | const api = server.select('API') 7 | 8 | api.route({ 9 | method: '*', 10 | path: '/api/v0/version', 11 | handler: resources.version.get 12 | }) 13 | } 14 | -------------------------------------------------------------------------------- /examples/run-in-electron/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IPFS 6 | 7 | 8 |

IPFS in electron!

9 |

now check your console

10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/cli/commands/object/patch.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'patch', 5 | 6 | description: 'Create a new merkledag object based on an existing one.', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('patch') 11 | }, 12 | 13 | handler (argv) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/traverse-ipld-graphs/git-objects/e68e6f6e31857877a79fd6b3956898436bb5a76f: -------------------------------------------------------------------------------- 1 | commit 222tree 4e425dba7745a781f0712c9a01455899e8c0c249 2 | parent 0f328c91df28c5c01b9e9f9f7e663191fa156593 3 | author John Doe 1504620164 +0200 4 | committer John Doe 1504620164 +0200 5 | 6 | Improve hello 7 | -------------------------------------------------------------------------------- /test/utils/interop-daemon-spawner/util.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const os = require('os') 4 | const crypto = require('libp2p-crypto') 5 | const path = require('path') 6 | 7 | exports.tmpDir = (prefix) => { 8 | return path.join( 9 | os.tmpdir(), 10 | prefix || 'tmp', 11 | crypto.randomBytes(32).toString('hex') 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/init-files/init-docs/help: -------------------------------------------------------------------------------- 1 | Some helpful resources for finding your way around ipfs: 2 | 3 | - quick-start: a quick show of various ipfs features. 4 | - ipfs commands: a list of all commands 5 | - ipfs --help: every command describes itself 6 | - https://github.com/ipfs/go-ipfs -- the src repository 7 | - #ipfs on irc.freenode.org -- the community irc channel 8 | -------------------------------------------------------------------------------- /src/cli/commands/bitswap.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'bitswap', 5 | 6 | description: 'Interact with the bitswap agent.', 7 | 8 | builder (yargs) { 9 | return yargs.commandDir('bitswap') 10 | }, 11 | 12 | handler (argv) { 13 | console.log('Type `jsipfs bitswap --help` for more information about this command') 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/cli/commands/files.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'files', 5 | 6 | description: 'Operations over files (add, cat, get, ls, etc)', 7 | 8 | builder (yargs) { 9 | return yargs 10 | .commandDir('files') 11 | }, 12 | 13 | handler (argv) { 14 | console.log('Type `jsipfs bitswap --help` for more instructions') 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/fixtures/test-data/recursive-get-dir/init-docs/help: -------------------------------------------------------------------------------- 1 | Some helpful resources for finding your way around ipfs: 2 | 3 | - quick-start: a quick show of various ipfs features. 4 | - ipfs commands: a list of all commands 5 | - ipfs --help: every command describes itself 6 | - https://github.com/ipfs/go-ipfs -- the src repository 7 | - #ipfs on irc.freenode.org -- the community irc channel 8 | -------------------------------------------------------------------------------- /src/core/components/repo.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = function repo (self) { 4 | return { 5 | init: (bits, empty, callback) => { 6 | // 1. check if repo already exists 7 | }, 8 | 9 | version: (callback) => { 10 | self._repo.version.get(callback) 11 | }, 12 | 13 | gc: function () {}, 14 | 15 | path: () => self._repo.path 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/browser-script-tag/README.md: -------------------------------------------------------------------------------- 1 | # Use IPFS in the browser with ` 7 | ``` 8 | 9 | This exposes a global `Ipfs`; you can get a node by making a `new Ipfs()`. 10 | 11 | See `index.html` for a working example. 12 | -------------------------------------------------------------------------------- /examples/browser-video-streaming/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/cli/general.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const expect = require('chai').expect 5 | const runOnAndOff = require('../utils/on-and-off') 6 | 7 | describe('general cli options', () => runOnAndOff.off((thing) => { 8 | it('should handle --silent flag', () => { 9 | return thing.ipfs('help --silent').then((out) => { 10 | expect(out).to.be.empty() 11 | }) 12 | }) 13 | })) 14 | -------------------------------------------------------------------------------- /src/cli/commands/pubsub/pub.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'pub ', 5 | 6 | describe: 'Publish data to a topic', 7 | 8 | builder: {}, 9 | 10 | handler (argv) { 11 | const data = Buffer.from(String(argv.data)) 12 | 13 | argv.ipfs.pubsub.publish(argv.topic, data, (err) => { 14 | if (err) { 15 | throw err 16 | } 17 | }) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/cli/commands/repo/version.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const print = require('../../utils').print 4 | 5 | module.exports = { 6 | command: 'version', 7 | 8 | describe: 'Shows IPFS repo version information', 9 | 10 | builder: {}, 11 | 12 | handler (argv) { 13 | argv.ipfs.repo.version(function (err, version) { 14 | if (err) { 15 | throw err 16 | } 17 | print(version) 18 | }) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/sharness/lib/test-lib-hashes.sh: -------------------------------------------------------------------------------- 1 | # this file defines several useful hashes used across the test codebase. 2 | # thus they can be defined + changed in one place 3 | 4 | HASH_WELCOME_DOCS="QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG" 5 | HASH_GATEWAY_ASSETS="QmXB7PLRWH6bCiwrGh2MrBBjNkLv3mY3JdYXCikYZSwLED" 6 | HASH_HELP_PAGE="QmY5heUM5qgRubMDD1og9fhCPA6QdkMp3QCwd4s7gJsyE7" 7 | HASH_EMPTY_DIR="QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn" 8 | -------------------------------------------------------------------------------- /test/core/interface/block.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const test = require('interface-ipfs-core') 5 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 6 | 7 | let factory 8 | 9 | const common = { 10 | setup: function (cb) { 11 | factory = new IPFSFactory() 12 | cb(null, factory) 13 | }, 14 | teardown: function (cb) { 15 | factory.dismantle(cb) 16 | } 17 | } 18 | 19 | test.block(common) 20 | -------------------------------------------------------------------------------- /test/core/interface/dag.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 7 | 8 | let factory 9 | 10 | const common = { 11 | setup: function (cb) { 12 | factory = new IPFSFactory() 13 | cb(null, factory) 14 | }, 15 | teardown: function (cb) { 16 | factory.dismantle(cb) 17 | } 18 | } 19 | 20 | test.dag(common) 21 | -------------------------------------------------------------------------------- /test/core/interface/files.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const test = require('interface-ipfs-core') 5 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 6 | 7 | let factory 8 | 9 | const common = { 10 | setup: function (cb) { 11 | factory = new IPFSFactory() 12 | cb(null, factory) 13 | }, 14 | teardown: function (cb) { 15 | factory.dismantle(cb) 16 | } 17 | } 18 | 19 | test.files(common) 20 | -------------------------------------------------------------------------------- /test/core/interface/pubsub.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const test = require('interface-ipfs-core') 5 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 6 | 7 | let factory 8 | 9 | const common = { 10 | setup: function (cb) { 11 | factory = new IPFSFactory() 12 | cb(null, factory) 13 | }, 14 | teardown: function (cb) { 15 | factory.dismantle(cb) 16 | } 17 | } 18 | 19 | test.pubsub(common) 20 | -------------------------------------------------------------------------------- /src/cli/commands/bootstrap/list.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const print = require('../../utils').print 4 | 5 | module.exports = { 6 | command: 'list', 7 | 8 | describe: 'Show peers in the bootstrap list', 9 | 10 | builder: {}, 11 | 12 | handler (argv) { 13 | argv.ipfs.bootstrap.list((err, list) => { 14 | if (err) { 15 | throw err 16 | } 17 | 18 | list.Peers.forEach((node) => print(node)) 19 | }) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/http/gateway/routes/gateway.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const resources = require('../resources') 4 | 5 | module.exports = (server) => { 6 | const gateway = server.select('Gateway') 7 | 8 | gateway.route({ 9 | method: '*', 10 | path: '/ipfs/{cid*}', 11 | config: { 12 | pre: [ 13 | { method: resources.gateway.checkCID, assign: 'args' } 14 | ], 15 | handler: resources.gateway.handler 16 | } 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /test/core/interface/config.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 7 | 8 | let factory 9 | 10 | const common = { 11 | setup: function (cb) { 12 | factory = new IPFSFactory() 13 | cb(null, factory) 14 | }, 15 | teardown: function (cb) { 16 | factory.dismantle(cb) 17 | } 18 | } 19 | 20 | test.config(common) 21 | -------------------------------------------------------------------------------- /test/core/interface/object.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 7 | 8 | let factory 9 | 10 | const common = { 11 | setup: function (cb) { 12 | factory = new IPFSFactory() 13 | cb(null, factory) 14 | }, 15 | teardown: function (cb) { 16 | factory.dismantle(cb) 17 | } 18 | } 19 | 20 | test.object(common) 21 | -------------------------------------------------------------------------------- /test/core/interface/swarm.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 7 | 8 | let factory 9 | 10 | const common = { 11 | setup: function (cb) { 12 | factory = new IPFSFactory() 13 | cb(null, factory) 14 | }, 15 | teardown: function (cb) { 16 | factory.dismantle(cb) 17 | } 18 | } 19 | 20 | test.swarm(common) 21 | -------------------------------------------------------------------------------- /test/core/interface/generic.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 7 | 8 | let factory 9 | 10 | const common = { 11 | setup: function (cb) { 12 | factory = new IPFSFactory() 13 | cb(null, factory) 14 | }, 15 | teardown: function (cb) { 16 | factory.dismantle(cb) 17 | } 18 | } 19 | 20 | test.generic(common) 21 | -------------------------------------------------------------------------------- /test/core/interface/interface.spec.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const isNode = require('detect-node') 6 | 7 | describe('interface-ipfs-core tests', () => { 8 | require('./block') 9 | require('./config') 10 | require('./files') 11 | require('./generic') 12 | require('./object') 13 | require('./dag') 14 | if (isNode) { 15 | require('./swarm') 16 | require('./pubsub') 17 | require('./dht') 18 | } 19 | }) 20 | -------------------------------------------------------------------------------- /src/cli/commands/block/get.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const CID = require('cids') 4 | 5 | module.exports = { 6 | command: 'get ', 7 | 8 | describe: 'Get a raw IPFS block', 9 | 10 | builder: {}, 11 | 12 | handler (argv) { 13 | const cid = new CID(argv.key) 14 | 15 | argv.ipfs.block.get(cid, (err, block) => { 16 | if (err) { 17 | throw err 18 | } 19 | 20 | process.stdout.write(block.data) 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/http-api/interface/block.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const FactoryClient = require('./../../utils/ipfs-factory-daemon') 7 | 8 | let fc 9 | 10 | const common = { 11 | setup: function (callback) { 12 | fc = new FactoryClient() 13 | callback(null, fc) 14 | }, 15 | teardown: function (callback) { 16 | fc.dismantle(callback) 17 | } 18 | } 19 | 20 | test.block(common) 21 | -------------------------------------------------------------------------------- /test/http-api/interface/files.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const FactoryClient = require('./../../utils/ipfs-factory-daemon') 7 | 8 | let fc 9 | 10 | const common = { 11 | setup: function (callback) { 12 | fc = new FactoryClient() 13 | callback(null, fc) 14 | }, 15 | teardown: function (callback) { 16 | fc.dismantle(callback) 17 | } 18 | } 19 | 20 | test.files(common) 21 | -------------------------------------------------------------------------------- /test/http-api/interface/swarm.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const FactoryClient = require('./../../utils/ipfs-factory-daemon') 7 | 8 | let fc 9 | 10 | const common = { 11 | setup: function (callback) { 12 | fc = new FactoryClient() 13 | callback(null, fc) 14 | }, 15 | teardown: function (callback) { 16 | fc.dismantle(callback) 17 | } 18 | } 19 | 20 | test.swarm(common) 21 | -------------------------------------------------------------------------------- /src/cli/commands/pubsub/peers.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const print = require('../../utils').print 4 | 5 | module.exports = { 6 | command: 'peers ', 7 | 8 | describe: 'Get all peers subscribed to a topic', 9 | 10 | builder: {}, 11 | 12 | handler (argv) { 13 | argv.ipfs.pubsub.peers(argv.topic, (err, peers) => { 14 | if (err) { 15 | throw err 16 | } 17 | 18 | peers.forEach((peer) => print(peer)) 19 | }) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/http/api/routes/file.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const resources = require('./../resources') 4 | 5 | module.exports = (server) => { 6 | const api = server.select('API') 7 | 8 | api.route({ 9 | // TODO fix method 10 | method: '*', 11 | path: '/api/v0/file/ls', 12 | config: { 13 | pre: [ 14 | { method: resources.file.ls.parseArgs, assign: 'args' } 15 | ], 16 | handler: resources.file.ls.handler 17 | } 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /test/http-api/interface/config.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const FactoryClient = require('./../../utils/ipfs-factory-daemon') 7 | 8 | let fc 9 | 10 | const common = { 11 | setup: function (callback) { 12 | fc = new FactoryClient() 13 | callback(null, fc) 14 | }, 15 | teardown: function (callback) { 16 | fc.dismantle(callback) 17 | } 18 | } 19 | 20 | test.config(common) 21 | -------------------------------------------------------------------------------- /test/http-api/interface/object.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | const test = require('interface-ipfs-core') 6 | const FactoryClient = require('./../../utils/ipfs-factory-daemon') 7 | 8 | let fc 9 | 10 | const common = { 11 | setup: function (callback) { 12 | fc = new FactoryClient() 13 | callback(null, fc) 14 | }, 15 | teardown: function (callback) { 16 | fc.dismantle(callback) 17 | } 18 | } 19 | 20 | test.object(common) 21 | -------------------------------------------------------------------------------- /src/core/components/version.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const pkg = require('../../../package.json') 4 | const promisify = require('promisify-es6') 5 | 6 | module.exports = function version (self) { 7 | return promisify((opts, callback) => { 8 | if (typeof opts === 'function') { 9 | callback = opts 10 | opts = {} 11 | } 12 | 13 | callback(null, { 14 | version: pkg.version, 15 | repo: '', 16 | commit: '' 17 | }) 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /test/cli/progress-bar.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const expect = require('chai').expect 5 | const createProgressBar = require('../../src/cli/utils').createProgressBar 6 | 7 | describe('progress bar', () => { 8 | it('created with the correct properties', () => { 9 | const total = 1000 10 | 11 | const bar = createProgressBar(total) 12 | expect(bar.total).to.eql(total) 13 | expect(typeof bar.tick).to.eql('function') 14 | }) 15 | }) 16 | -------------------------------------------------------------------------------- /src/cli/commands/pubsub/ls.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const print = require('../../utils').print 4 | 5 | module.exports = { 6 | command: 'ls', 7 | 8 | describe: 'Get your list of subscriptions', 9 | 10 | builder: {}, 11 | 12 | handler (argv) { 13 | argv.ipfs.pubsub.ls((err, subscriptions) => { 14 | if (err) { 15 | throw err 16 | } 17 | 18 | subscriptions.forEach((sub) => { 19 | print(sub) 20 | }) 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/http/api/resources/version.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const boom = require('boom') 4 | 5 | exports = module.exports 6 | 7 | exports.get = (request, reply) => { 8 | const ipfs = request.server.app.ipfs 9 | 10 | ipfs.version((err, version) => { 11 | if (err) { 12 | return reply(boom.badRequest(err)) 13 | } 14 | 15 | reply({ 16 | Version: version.version, 17 | Commit: version.commit, 18 | Repo: version.repo 19 | }) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /test/core/interface/dht.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | /* 6 | const test = require('interface-ipfs-core') 7 | const IPFSFactory = require('../../utils/ipfs-factory-instance') 8 | 9 | let factory 10 | 11 | const common = { 12 | setup: function (callback) { 13 | factory = new IPFSFactory() 14 | callback(null, factory) 15 | }, 16 | teardown: function (callback) { 17 | factory.dismantle(callback) 18 | } 19 | } 20 | 21 | test.dht(common) 22 | */ 23 | -------------------------------------------------------------------------------- /src/cli/commands/object/data.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const print = require('../../utils').print 4 | 5 | module.exports = { 6 | command: 'data ', 7 | 8 | describe: 'Outputs the raw bytes in an IPFS object', 9 | 10 | builder: {}, 11 | 12 | handler (argv) { 13 | argv.ipfs.object.data(argv.key, { 14 | enc: 'base58' 15 | }, (err, data) => { 16 | if (err) { 17 | throw err 18 | } 19 | 20 | print(data.toString()) 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/cli/commands/pubsub/sub.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const print = require('../../utils').print 4 | 5 | module.exports = { 6 | command: 'sub ', 7 | 8 | describe: 'Subscribe to a topic', 9 | 10 | builder: {}, 11 | 12 | handler (argv) { 13 | const handler = (msg) => { 14 | print(msg.data.toString()) 15 | } 16 | 17 | argv.ipfs.pubsub.subscribe(argv.topic, handler, (err) => { 18 | if (err) { 19 | throw err 20 | } 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/ipfs-101/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ipfs-101", 3 | "version": "0.0.0", 4 | "description": "this package.json needs to exist because of new npm config https://github.com/ipfs/js-ipfs/issues/977#issuecomment-326741092", 5 | "main": "1.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "David Dias ", 10 | "license": "MIT", 11 | "dependencies": { 12 | "async": "^2.5.0", 13 | "ipfs": "^0.25.4" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/http/api/resources/id.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const boom = require('boom') 4 | 5 | exports = module.exports 6 | 7 | exports.get = (request, reply) => { 8 | request.server.app.ipfs.id((err, id) => { 9 | if (err) { 10 | return reply(boom.badRequest(err)) 11 | } 12 | 13 | return reply({ 14 | ID: id.id, 15 | PublicKey: id.publicKey, 16 | Addresses: id.addresses, 17 | AgentVersion: id.agentVersion, 18 | ProtocolVersion: id.protocolVersion 19 | }) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /examples/browser-webpack/server.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const webpack = require('webpack') 4 | const WebpackDevServer = require('webpack-dev-server') 5 | const config = require('./webpack.config') 6 | 7 | const wds = new WebpackDevServer(webpack(config), { 8 | publicPath: config.output.publicPath, 9 | hot: true, 10 | historyApiFallback: true 11 | }) 12 | 13 | wds.listen(3000, 'localhost', (err, result) => { 14 | if (err) { 15 | throw err 16 | } 17 | 18 | console.log('Listening at localhost:3000') 19 | }) 20 | -------------------------------------------------------------------------------- /examples/exchange-files-in-browser/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "exchange-files-browser", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "bundle": "browserify public/js/app.js > public/js/bundle.js", 6 | "serve": "http-server -c-1 -p 12345 public", 7 | "start": "npm run bundle && npm run serve" 8 | }, 9 | "license": "MIT", 10 | "devDependencies": { 11 | "browserify": "^14.4.0", 12 | "http-server": "^0.10.0" 13 | }, 14 | "dependencies": { 15 | "stream-buffers": "^3.0.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/cli/commands/id.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const print = require('../utils').print 3 | 4 | module.exports = { 5 | command: 'id', 6 | 7 | describe: 'Shows IPFS Node ID info', 8 | 9 | builder: { 10 | format: { 11 | alias: 'f', 12 | type: 'string' 13 | } 14 | }, 15 | 16 | handler (argv) { 17 | // TODO: handle argv.format 18 | argv.ipfs.id((err, id) => { 19 | if (err) { 20 | throw err 21 | } 22 | 23 | print(JSON.stringify(id, '', 2)) 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/http/api/resources/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports.version = require('./version') 4 | exports.id = require('./id') 5 | exports.bootstrap = require('./bootstrap') 6 | exports.repo = require('./repo') 7 | exports.object = require('./object') 8 | exports.config = require('./config') 9 | exports.block = require('./block') 10 | exports.swarm = require('./swarm') 11 | exports.bitswap = require('./bitswap') 12 | exports.file = require('./file') 13 | exports.files = require('./files') 14 | exports.pubsub = require('./pubsub') 15 | -------------------------------------------------------------------------------- /src/http/api/routes/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = (server) => { 4 | require('./version')(server) 5 | require('./id')(server) 6 | require('./bootstrap')(server) 7 | require('./block')(server) 8 | require('./object')(server) 9 | // require('./repo')(server) 10 | require('./config')(server) 11 | require('./swarm')(server) 12 | require('./bitswap')(server) 13 | require('./file')(server) 14 | require('./files')(server) 15 | require('./pubsub')(server) 16 | require('./debug')(server) 17 | } 18 | -------------------------------------------------------------------------------- /src/cli/commands/block/stat.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const CID = require('cids') 4 | const print = require('../../utils').print 5 | 6 | module.exports = { 7 | command: 'stat ', 8 | 9 | describe: 'Print information of a raw IPFS block', 10 | 11 | builder: {}, 12 | 13 | handler (argv) { 14 | argv.ipfs.block.stat(new CID(argv.key), (err, stats) => { 15 | if (err) { 16 | throw err 17 | } 18 | 19 | print('Key: ' + stats.key) 20 | print('Size: ' + stats.size) 21 | }) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/cli/commands/files/cat.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | command: 'cat ', 5 | 6 | describe: 'Fetch and cat an IPFS path referencing a file', 7 | 8 | builder: {}, 9 | 10 | handler (argv) { 11 | let path = argv['ipfs-path'] 12 | if (path.indexOf('/ipfs/') !== 1) { 13 | path = path.replace('/ipfs/', '') 14 | } 15 | 16 | argv.ipfs.files.cat(path, (err, file) => { 17 | if (err) { 18 | throw err 19 | } 20 | 21 | file.pipe(process.stdout) 22 | }) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/http-api/interface/pubsub.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 3 | 'use strict' 4 | 5 | // TODO needs: https://github.com/ipfs/js-ipfs-api/pull/493 6 | /* 7 | const test = require('interface-ipfs-core') 8 | const FactoryClient = require('./../../utils/ipfs-factory-daemon') 9 | 10 | let fc 11 | 12 | const common = { 13 | setup: function (callback) { 14 | fc = new FactoryClient() 15 | callback(null, fc) 16 | }, 17 | teardown: function (callback) { 18 | fc.dismantle(callback) 19 | } 20 | } 21 | 22 | test.pubsub(common) 23 | */ 24 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | environment: 4 | matrix: 5 | - nodejs_version: "6" 6 | - nodejs_version: "8" 7 | 8 | matrix: 9 | fast_finish: true 10 | 11 | install: 12 | # Install Node.js 13 | - ps: Install-Product node $env:nodejs_version 14 | 15 | # Upgrade npm 16 | - npm install -g npm 17 | 18 | # Output our current versions for debugging 19 | - node --version 20 | - npm --version 21 | 22 | # Install our package dependencies 23 | - npm install 24 | 25 | test_script: 26 | - npm run test:node 27 | 28 | build: off 29 | -------------------------------------------------------------------------------- /test/cli/commands.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const expect = require('chai').expect 5 | const runOnAndOff = require('../utils/on-and-off') 6 | 7 | const commandCount = 58 8 | 9 | describe('commands', () => runOnAndOff((thing) => { 10 | let ipfs 11 | 12 | before(function () { 13 | this.timeout(30 * 1000) 14 | ipfs = thing.ipfs 15 | }) 16 | 17 | it('list the commands', () => { 18 | return ipfs('commands').then((out) => { 19 | expect(out.split('\n')).to.have.length(commandCount + 1) 20 | }) 21 | }) 22 | })) 23 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:6 2 | 3 | RUN apt-get update 4 | RUN apt-get install --yes python2.7 git-all pkg-config libncurses5-dev libssl-dev libnss3-dev libexpat-dev libc6 5 | 6 | WORKDIR /usr/src/app 7 | 8 | COPY package.json /usr/src/app/package.json 9 | 10 | RUN npm install 11 | RUN npm install wrtc 12 | 13 | COPY . /usr/src/app 14 | 15 | ENV IPFS_WRTC_LINUX_WINDOWS=1 16 | ENV IPFS_BOOTSTRAP=1 17 | ENV IPFS_MONITORING=1 18 | ENV IPFS_PATH=/root/.jsipfs 19 | 20 | EXPOSE 4002 21 | EXPOSE 4003 22 | EXPOSE 5002 23 | EXPOSE 9090 24 | 25 | CMD ./init-and-daemon.sh 26 | -------------------------------------------------------------------------------- /examples/run-in-electron/README.md: -------------------------------------------------------------------------------- 1 | # js-ipfs in Electron 2 | 3 | > This example is heavily inspired by [electron-quick-start](https://github.com/electron/electron-quick-start). 4 | 5 | **DISCLAIMER:** This example is still a work in progress, it currently doesn't work due to the usage of native dependencies that Electron is not supporting. 6 | 7 | To try it by yourself, do: 8 | 9 | ``` 10 | > npm install 11 | > ./node_modules/.bin/electron-rebuild 12 | # or 13 | > ./build.sh 14 | # 15 | # You can also try to use `npm start` to see where electron errors 16 | ``` 17 | -------------------------------------------------------------------------------- /test/cli/version.js: -------------------------------------------------------------------------------- 1 | /* eslint-env mocha */ 2 | 'use strict' 3 | 4 | const expect = require('chai').expect 5 | const pkgversion = require('../../package.json').version 6 | const runOnAndOff = require('../utils/on-and-off') 7 | 8 | describe('version', () => runOnAndOff((thing) => { 9 | let ipfs 10 | 11 | before(() => { 12 | ipfs = thing.ipfs 13 | }) 14 | 15 | it('get the version', () => { 16 | return ipfs('version').then((out) => { 17 | expect(out).to.eql( 18 | `js-ipfs version: ${pkgversion}\n` 19 | ) 20 | }) 21 | }) 22 | })) 23 | -------------------------------------------------------------------------------- /examples/browser-webpack/README.md: -------------------------------------------------------------------------------- 1 | # Bundle js-ipfs with Webpack! 2 | 3 | > In this example, you will find a boilerplate you can use to guide yourself into bundling js-ipfs with webpack, so that you can use it in your own web app! 4 | 5 | ## Run this example 6 | 7 | Once the daemon is on, run the following commands within this folder: 8 | 9 | ```bash 10 | > npm install 11 | > npm start 12 | ``` 13 | 14 | Now open your browser at `http://localhost:3000` 15 | 16 | You should see the following: 17 | 18 | ![](https://ipfs.io/ipfs/QmZndNLRct3co7h1yVB72S4qfwAwbq7DQghCpWpVQ45jSi/1.png) 19 | -------------------------------------------------------------------------------- /examples/browser-browserify/README.md: -------------------------------------------------------------------------------- 1 | # Bundle js-ipfs with Browserify! 2 | 3 | > In this example, you will find a boilerplate you can use to guide yourself into bundling js-ipfs with browserify, so that you can use it in your own web app! 4 | 5 | ## Run this example 6 | 7 | ```bash 8 | > npm install 9 | > npm start 10 | ``` 11 | 12 | Now open your browser at `http://localhost:8888` 13 | 14 | You should see the following: 15 | 16 | ![](https://ipfs.io/ipfs/QmNtpcWCEd6LjdPNfBFDaVZdD4jpgT8ZTAwoFJXKhYMJdo/1.png) 17 | ![](https://ipfs.io/ipfs/QmNtpcWCEd6LjdPNfBFDaVZdD4jpgT8ZTAwoFJXKhYMJdo/2.png) 18 | -------------------------------------------------------------------------------- /examples/run-in-electron/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "js-ipfs-in-electron", 3 | "version": "0.0.0", 4 | "description": "A minimal Electron application with js-ipfs", 5 | "main": "main.js", 6 | "scripts": { 7 | "start": "electron .", 8 | "postinstall": "electron-rebuild" 9 | }, 10 | "keywords": [ 11 | "Electron", 12 | "IPFS", 13 | "Example" 14 | ], 15 | "author": "David Dias ", 16 | "license": "MIT", 17 | "devDependencies": { 18 | "electron": "~1.6.11", 19 | "electron-rebuild": "^1.5.11", 20 | "ipfs": "ipfs/js-ipfs" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/browser-browserify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bundle-browserify", 3 | "version": "1.0.0", 4 | "description": "Bundle js-ipfs with Browserify", 5 | "main": "index.js", 6 | "scripts": { 7 | "bundle": "browserify src/index.js > public/bundle.js", 8 | "serve": "http-server public -a 127.0.0.1 -p 8888", 9 | "start": "npm run bundle && npm run serve" 10 | }, 11 | "keywords": [], 12 | "license": "MIT", 13 | "devDependencies": { 14 | "browserify": "^14.0.0", 15 | "concat-stream": "^1.6.0", 16 | "http-server": "^0.9.0" 17 | }, 18 | "dependencies": {} 19 | } 20 | -------------------------------------------------------------------------------- /src/cli/commands/object/new.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const debug = require('debug') 4 | const log = debug('cli:object') 5 | log.error = debug('cli:object:error') 6 | const print = require('../../utils').print 7 | 8 | module.exports = { 9 | command: 'new [