Skip to content

Create an section covering the Basics of IPFS using JavaScript. #1207

@johnnymatthews

Description

@johnnymatthews

This is a continuation of the Basics of IPFS project, where we show users how to use IPFS in very basic ways (install, add, share/get, and "remove"). In this new subsection, we'll show the reader how to spin up an IPFS node in the browser using JavaScript and then, in subsequent tabs, add a file, share that file with another user, how the retrieve a file, and finally, how to "remove" a file from the JS-IPFS node. This new section can follow the same formula as used in the current IPFS Basics section.

Tasks

Here's a pretty rough overview of what we should cover in this section.

  • How to install JS-IPFS.
    • Where to get JS-IPFS from: https://github.com/ipfs/js-ipfs
    • Who it's maintained by.
    • Show the simple npm install ... procedure.
    • Also mention how a user can build from source if they want to.
      • But just point them to the instructions in the JS-IPFS repo.
  • Spin up an IPFS node
    • Build a simple webpage (without the use of any frameworks like React/Angular/etc.).
    • Show the user the code needed to spin up a node.
    • Have the JS Console output something once the node is running.
    • Explain that all the other steps will use this code.
  • Add a file.
    • Copy the code from the Spin up an IPFS node section. (not entirely based on this)
    • Add a dialog box where a user can put the file they want to upload.
    • Once the user clicks upload, the file is sent to the JS-IPFS node.
    • Output the CID on the webpage.
    • Mention that they can then share this CID with anyone, and they can use it on their IPFS node to get that file.
  • Get a CID.
    • Copy the code from the Spin up an IPFS node section. (not entirely based on this)
    • Create an input box where a user can paste a CID.
    • Have the user enter a specific CID that we put somewhere and have pinned. A simple jpeg image would work well.
    • Once the user requests that CID, try to show it in the browser.
  • Remove a file.
    • Start off by explaining that it's not possible to 100% verifiable remove a file/CID from the IPFS network.
      • There's no way to know if someone else had made a copy of the file since it's been on the network.
      • This works the same way as it does in regular HTTP networks, etc.
    • Copy the code from the Spin up an IPFS node section. (not entirely based on this)
    • List the CIDs that this node is currently hosting.
    • Add some kind of user input that the user can use to delete a file from this JS-IPFS node.
    • Once the file has been removed, relist the CIDs that this node is currently hosting.

Metadata

Metadata

Assignees

Labels

P2Medium: Good to have, but can wait until someone steps updif/mediumPrior experience is likely helpfuleffort/daysEstimated to take multiple days, but less than a week

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions