Explore the docs
·
View Demo
·
Report Bug
·
Request Feature/Example
When we add content to an IPFS node, it needs to remain online in order for others to retrieve that content.
Some environments such as web browsers are fundamentally short lived - the user may navigate away from the page, close their browser or laptop lid, for example.
Where users are creating content in these environments, we should use a remote pinning service to ensure the content is resolvable long after the original creator has gone offline.
A remote pinning service is a third party node that stores content on behalf of other nodes. It may be a commercial service or one you have set up yourself.
We are going to start four nodes.
- Publisher
This is a browser node which we will use to create some content.
- Pinning service
This will run under Node.js and it will be used to make the content available after the publisher has gone offline.
- Resolver
Another browser node that wishes to fetch the content created by the publisher.
- Bootstrapper
A Node.js node we will use to allow these peers to discover each other.
First start the bootstrapper:
$ npm run bootstrapper
bootstrapper listening on
/ip4/127.0.0.1/tcp/64484/p2p/12D3KooWNkqtx14iU9sJV76PgksX3nYW7CPdKZAQPG6ueqzAMgxD
... more addresses here
Next start the pinning service:
$ npm run pinning-service.js
pinning service listening on
http://127.0.0.1:64486
Now start the publisher:
$ npm run publisher
A web browser will open.
Wait for the status to become "Ready". When this has happened, the libp2p node running on the page has acquired a relay address from the bootstrap node and can accept incoming WebRTC connections from the pinning service node. This is necessary for the pinning service to request pinned blocks from the publisher.
Enter some text into the input box and click the "Publish" button.
Copy the CID that is shown on the screen.
You may now close the publisher window if you wish.
Finally start the resolver:
$ npm run resolver
When the web browser opens, take the CID you copied previous and enter it into the input box.
Click "Resolve", after a short delay you should see the content you entered into the input on the publisher page.
You have just published content using a remote pinning service, then resolved that content using a different node.
- Read the docs
- Look into other examples to learn how to spawn a Helia node in Node.js and in the Browser
- Visit https://dweb-primer.ipfs.io to learn about IPFS and the concepts that underpin it
- Head over to https://proto.school to take interactive tutorials that cover core IPFS APIs
- Check out https://docs.ipfs.io for tips, how-tos and more
- See https://blog.ipfs.io for news and more
- Need help? Please ask 'How do I?' questions on https://discuss.ipfs.io
For more examples, please refer to the Documentation
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.
- Fork the IPFS Project
- Create your Feature Branch (
git checkout -b feature/amazing-feature
) - Commit your Changes (
git commit -a -m 'feat: add some amazing feature'
) - Push to the Branch (
git push origin feature/amazing-feature
) - Open a Pull Request
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.
- Check out existing issues The issue list has many that are marked as 'help wanted' or 'difficulty:easy' which make great starting points for development, many of which can be tackled with no prior IPFS knowledge
- Look at the Helia Roadmap This are the high priority items being worked on right now
- Perform code reviews More eyes will help a. speed the project along b. ensure quality, and c. reduce possible future bugs
- Add tests. There can never be enough tests