Collection of js-ipfs examples
Explore the docs
·
Report Bug
·
Request Feature/Example
Make sure you have installed all of the following prerequisites on your development machine:
npm install -g yarn
yarn install
yarn run test
This project is broken into 2 modules, their purposes are:
/examples/*
Examples of IPFS implementations with bundlers, frameworks, tutorials among others/lib/test-util-ipfs-example
Collection of helpers to orchestrate the tests for the examplesExplore ProtoSchool's IPFS tutorials for interactive js-ipfs coding challenges, deep dives into DWeb concepts like content addressing, and more.
The JavaScript implementation of IPFS is available as two packages, ipfs-core
and ipfs
.
ipfs-core
contains the core api and is intended to be used to run an IPFS node as part of your application without the need to start external processes or manage API ports and servers.
ipfs
is built on ipfs-core
but also includes the CLI, an HTTP RPC API server and other tools to run ipfs
as a background process so is a larger install with more dependencies.
If you are writing an application that needs to access the IPFS network, use ipfs-core
. If you wish to use js-IPFS in a terminal window or run it as a server for use by multiple otherwise unrelated processes, use ipfs
.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
https://github.com/ipfs-examples/js-ipfs-examples
)git checkout -b feature/amazing-feature
)git commit -a -m 'feat: add some amazing feature'
)git push origin feature/amazing-feature
)Follow the example-template
Follow the example-template-fork-&-go
Examples must:
/examples/
foldertest-util-ipfs-example
libraryplaywright
as test frameworkclean
: used to clean all the unnecessary code (e.g.: files generated by bundlers and package managers)build
: used to build the examplestart
: used to start the exampletest
: used to test the exampleREADME must have (see example inside example-template
):
Codesandbox.com
for one-click running demonstrationimg/
folderUpdate the CI to run the tests of the new example as standalone
github/workflows/ci.yml
project
under matrix
Extend the test-util-ipfs-example
library if needed to reuse code in other examples
Create a new repository based on (https://github.com/ipfs-examples/example-fork-go-template) following the name: js-ipfs-{EXAMPLE_NAME}
with a description
Turn off issue/wikis/projects/discussions
js-ipfs
to run tests against the repoOpen a PR to the ipfs/js-ipfs project that edits the .github/workflows/test.yml
in order to make sure a js-ipfs release does not break your new example.
Search .github/workflows/test.yml
for the test-examples
section and add a block at the end of the example
matrix key similar to:
- name: my super fun new example
repo: https://github.com/ipfs-examples/js-ipfs-my-super-fun-new-example.git
deps: ipfs-core@$PWD/packages/ipfs-core/dist,ipfs-http-client@$PWD/packages/ipfs-http-client/dist
The value of the deps
key will vary depending on which modules from js-ipfs your example uses. Above we override the ipfs-core
and ipfs-http-client
modules, but your example may different deps.
Please see the existing setup in .github/workflows/test.yml
for how to ensure you are overriding the correct modules.
The IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out:
Read the Code of Conduct and JavaScript Contributing Guidelines.