Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

docs: add blog posts for npm-on-ipfs #215

Closed
wants to merge 4 commits into from
Closed

docs: add blog posts for npm-on-ipfs #215

wants to merge 4 commits into from

Conversation

achingbrain
Copy link
Contributor

PR'd in from a fork because I can't push branches to this repo.

This adds two new blog posts on IPFS and npm.

  1. The registry - a description of what it is, how it works and how we put it together
  2. The client - using ipfs-npm to cut out the http/dns middleman

This is the first blog post(s) I've written so hopefully I've put all the things in the right places.

@jacobheun The section on datastore-s3 is a bit bare, is there anything else you'd add?
@andrew Could you give it a proof-read please?

@ghost ghost added the stage: skeleton label Feb 18, 2019
@andrew
Copy link
Contributor

andrew commented Feb 18, 2019

Looking good 👍

Can users set up their own hosted mirrors using the same code? If so, that would be something worth mentioning at the end of the post as well.

@@ -0,0 +1,99 @@
---
date: 2019-02-17
title: Putting npm on IPFS Part 1 - The Registry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the structure, separating this into the server/client posts definitely makes it more digestible, and the breakout "quick how to" at the top of each is good 👍


![Request sequence](/71-putting-npm-on-ipfs-part-2/ipfs-npm-sequence.png)

If this sounds familiar it may be because you've just read [part 1](/post/70-putting-npm-on-ipfs-part-1) - indeed it's the exact same code fulfilling the exact same function, just locally on your machine instead of on a server somewhere.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this bit papers over rather a lot of functionality -- stuff like persistent/proc/external node, whether the NPM update log is replicated, etc (I think? this is based on my reading of the code)

maybe something to unpack a bit more? (it's sort of addressed in the docs linked from "other configurations are available" above, but that's not abundantly clear)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've expanded the part on how it works, let me know if you'd like more added.


The http server is necessary because at the time of writing neither npm or Yarn support IPFS as a transport - hopefully one day this won't be necessary but as it stands no http traffic leaves your machine, unless you request modules that don't have CIDs in their metadata.

It also dials the ipfs-npm-registry-mirror directly to improve the speed of content resolution - this is partly because we know that the mirror will have the content we are after but also because there is no [DHT](https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/Distributed_hash_table.html) in js-IPFS (yet - it's coming!) so discovery would have to occur via the gateway nodes.
Copy link
Contributor

@parkan parkan Feb 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't DHT available as of v0.35.0, or am I misreading the release notes?

it might be worth mentioning that in the future this is something that could be handled by rendezvous, as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parkan I don't think v0.35.0 final has been published to npm yet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite right. It may not be enabled by default until v0.36.0 either.


## 🎁 What's next?

So many things!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a perfect opportunity to tease future package manager work -- probably don't want to go into too much specifics here, but can definitely do a bit more!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1! Maybe it's time to create a public-facing package managers working group for IPFS that we can point people to for things like upcoming roadmap, categories, synthesized research, next steps, etc!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put a few things down here but only wanted to mention npm-related things as that's the focus of the blog post. If there's anything you want added please let me know.

@parkan
Copy link
Contributor

parkan commented Feb 19, 2019

overall this is good! let me know if you want me to to a quick style pass before publishing 🙂

Copy link
Contributor

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good and I like the two part approach. I recommend posting them at 2 different dates.

Right now what I see missing is "painting the picture", the posts require a lot of text and knowing how infra works to be able to imagine how the things are set up. Let's make it easy for folks to understand.

content/post/70-putting-npm-on-ipfs-part-1.md Outdated Show resolved Hide resolved
content/post/70-putting-npm-on-ipfs-part-1.md Outdated Show resolved Hide resolved
content/post/70-putting-npm-on-ipfs-part-1.md Outdated Show resolved Hide resolved
content/post/70-putting-npm-on-ipfs-part-1.md Outdated Show resolved Hide resolved
** drumroll **

## 🙌 Introducing ipfs-npm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs diagram of what this means :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reused the graphic from the npm-on-ipfs readme as I'm not sure what a diagram here would look like - what did you have in mind?

@ghost ghost assigned achingbrain Mar 5, 2019
@ghost ghost added the status/in-progress In progress label Mar 5, 2019
@achingbrain
Copy link
Contributor Author

Can users set up their own hosted mirrors using the same code? If so, that would be something worth mentioning at the end of the post as well.

@andrew done!

let me know if you want me to to a quick style pass before publishing

@parkan Please use the "Suggested change" function for any improvements you have and/or otherwise leave a comment

@parkan
Copy link
Contributor

parkan commented Mar 6, 2019

theoretical performance improvements are great, but if we make those claims we should back them up with some benchmarks. I found this little benchmark suite that someone used to compare a few installers and quickly modified it to include ipfs-npm:

https://github.com/parkan/npm-cache-benchmark

unfortunately I'm having some connection issues right now so I can't even make it through the benchmarks, can someone else run this and see how we compare? (would need to do a separate run with a clean repo to establish a baseline)

@parkan
Copy link
Contributor

parkan commented Mar 6, 2019

I spent a couple hours today trying to make things work well enough to be testable but was not successful:

ipfs-shipyard/npm-on-ipfs#89
ipfs-shipyard/npm-on-ipfs#90

my suggestion would be:

  • explain that the benefits ("more resillient ... multiple nodes ... lowers bandwidth costs, is faster and can work without an internet connection") are theoretical at this point: trying to use ipfs-npm right now with "equal or better" expectations would be a disappointment -- we should correctly set the expectations that this is a cool experiment with potential
  • add a note about how we can overcome the SPOF of the HTTP registry in the future

@achingbrain thank you for putting up with these revisions!

@parkan
Copy link
Contributor

parkan commented Mar 21, 2019

let's circle back and try to publish this next week

@momack2
Copy link
Contributor

momack2 commented Mar 29, 2019

Made a few suggested edits based on Arkadiy's feedback. I think we should aim to push this live ASAP - there's some npm kerfuffle this week and would be nice to attract interested parties to this distributed npm experiment while that interest and engagement is fresh.

Copy link
Contributor

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢🚢🚢

content/post/73-putting-npm-on-ipfs-part-1.md Outdated Show resolved Hide resolved
content/post/73-putting-npm-on-ipfs-part-1.md Outdated Show resolved Hide resolved
content/post/73-putting-npm-on-ipfs-part-1.md Outdated Show resolved Hide resolved
...
```

The CID resolves to the tarball for a module, but while the module has been added to IPFS is not stored in the MFS so we resolve it using the CID:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The CID resolves to the tarball for a module, but while the module has been added to IPFS is not stored in the MFS so we resolve it using the CID:
The CID resolves to the tarball for a module, but although the module has been added to IPFS is not stored in the MFS so we resolve it using the CID:

Explain why it's not necessary to store it in MFS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it not necessary to store it in MFS?

The CID resolves to the tarball for a module, but while the module has been added to IPFS is not stored in the MFS so we resolve it using the CID:

```console
$ jsipfs files read /ipfs/bafybeiafts7s65iodk4wsetucwhury3cpk4fge374wxhdu5vzc4zuli4xi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've just said it's not stored in MFS but have used a command we've documented as being for primary use with MFS to read it - perhaps using ipfs cat is more appropriate here?


![Replication](/73-putting-npm-on-ipfs-part-1/replication.png)

When it sees a new module published, the replicator pulls down any new tarballs, adds them to IPFS and updates the metadata with the CIDs of the new module.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and explain that this is the reason we're using MFS?


What if you could skip that part and just use IPFS?

Stay tuned for [Putting npm on IPFS Part 2 - The Client](/post/74-putting-npm-on-ipfs-part-2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait. Can we get this one merged and published 🚢🚢🚢??

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@achingbrain can has final review and finishing touches pls?

content/post/74-putting-npm-on-ipfs-part-2.md Outdated Show resolved Hide resolved
Copy link
Contributor

@momack2 momack2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 1-2 final comments to review and then this is ready to go!! Let's do it!

@daviddias
Copy link
Contributor

Can someone write a list of action items left to ship this? I can't tell if everything has been addressed or not :)

@andrew
Copy link
Contributor

andrew commented May 16, 2019

Perhaps this could be scheduled along side the launch of ipfs-desktop support for npm-on-ipfs?

@daviddias
Copy link
Contributor

@andrew I would rather not wait any longer. These posts have so much valuable information and that has been trapped in this PR forever.

@olizilla
Copy link
Contributor

@daviddias Lets not relase this just yet. The registry mirror is unreliable at the moment. There is lots of good stuff in this blog post, but I don't feel we are ready to encourage people to use it yet. Alex is getting access to the infra to fix that, I am digging into the UX issues with @jessicaschilling and @andrew and we are working on a plan.

@daviddias
Copy link
Contributor

@olizilla Ack! Thanks for giving me the update. Are there issues to track that work? Would you like to update your comment to point to those?

@olizilla
Copy link
Contributor

Here is a first draft of a release issue for npm-on-ipfs: desktop edition
ipfs-shipyard/npm-on-ipfs#106

@daviddias
Copy link
Contributor

@olizilla the npm-on-ipfs: desktop edition does look very exciting!

One of the original intents of writing these blog posts was to have a good resource to show to the public that there is indeed a way to use S3 or other storage backend and that there is indeed a way to store large amounts of data onto IPFS. Let's not forget this focus while revamping the communication to be the "Desktop version"

@momack2
Copy link
Contributor

momack2 commented Sep 18, 2019

Now that IPFS Desktop has npm-on-ipfs as an experiment, how do we feel about resurrecting these posts? I think the explanation work here is awesome and want to see it get the reach it deserves. @olizilla @achingbrain @hacdias - do you have ideas?

@hacdias
Copy link
Contributor

hacdias commented Sep 29, 2019

@momack2 overall, I think it'd be a great idea to actually post this

@jessicaschilling
Copy link
Contributor

Closing: stale PR, and migration to new https://github.com/ipfs/ipfs-blog nearly complete.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants