-
Notifications
You must be signed in to change notification settings - Fork 471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: review getting started #520
Conversation
@@ -29,87 +25,83 @@ The first step is to install libp2p in your project: | |||
npm install libp2p | |||
``` | |||
|
|||
## Usage | |||
|
|||
Configuring libp2p should not be a single step, but a continuous task. This includes configuring libp2p to achieve all the project requirements, as well as possible optimizations. Regardless of how you configure libp2p, the top level API will always remain the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we should have at least part of this. Explicitly say that configuring js-libp2p
should be an iterative process rather than a let's configure everything before running
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this read like, "The libp2p setup is more than a one time thing, you're never done configuring libp2p". It sounds daunting.
It sounds like you meant something more like:
If you're new to libp2p, we recommend configuring your node in stages, as this can make
troubleshooting configuration issues much easier. In this guide, we'll do just that.
If you're more experienced with libp2p, you may wish to jump to the [Configuration readme](#).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that is a better way of putting this! Can you change to that in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added that in.
|
||
Configuring libp2p should not be a single step, but a continuous task. This includes configuring libp2p to achieve all the project requirements, as well as possible optimizations. Regardless of how you configure libp2p, the top level API will always remain the same. | ||
|
||
For creating a `js-libp2p` node you should use [Libp2p.create](./API.md#create). As stated in the API docs, we need to provide the [libp2p configuration](./CONFIGURATION.md) as a parameter. If you did not read the configuration document yet, it is worth you read it before continuing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this because I think we should guide people to use the API and CONFIGURATION docs, because as soon as they are experienced with js-libp2p
, they should go through those docs instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the main readme is the landing page for most users I think it makes sense to have that distinction there. My concern with recommending people go read configuration first is that can be an overwhelming amount of information. We should help users get started quickly, and then send them to docs that will build on what they've learned here, and help them customize their nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it can be overwhelming to recommend people to read configuration first.
My idea here is to point them to subsections of the other documents, instead, of all document. So I agree with you on the configuration part, but I think we should keep the pointer do ./API.md#create
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the link back to the first mention of create
.
Just some quick feedback after skimming through #514 at @vasco-santos's request. My main question is where you expect people to be coming from when they get here and what they need to have already read in order for this Getting Started guide to make sense. (I recommend adding links to prereqs if they exist.) Personally, having very little libp2p knowledge, I appreciated the little paragraphs at the start of each section but wished there were more of that context. I'm sure there are others who'd want less of it and more direct jumps into the lines of code needed to make things happen. I went to the main readme of this repo to see if it had the context I was looking for and it didn't. It did point to a ton of different websites for reference, with this disclaimer: https://docs.libp2p.io/ turned out to have just the kind of explanations I was looking for, and looks very professional to boot, so it might make sense to link from certain sections here in the js-libp2p getting started guide to the concept explainers over there for those who'd like more background. |
Thanks for your time @terichadbourne
I expect them to come from: libp2p/js-libp2p/refactor/async-await#usage. Maybe before tutorials and examples. I think that we would not have prereqs here, people would have to know JS, as well as some concepts of networking, but when they come to a lib like this, I think that it is already implicit.
@jacobheun what do you think on adding toggles with "more details" for people to click and the section introductions would be available? I agree with teri that this introduction might be important to some people, but I also think if might be noisy for people that prefer to directly look into code.
My idea is to simply remove that and reference my proposal on libp2p/js-libp2p#512#issuecomment-564929701
In this document, we reference parts of CONFIGURATION.md which have references to the docs as you suggested. I know that people need to navigate from Getting started to Configuration to docs website, but I prefer that approach rather than having those references to the docs website in both, as it would introduce a lot of noise in the documentation. Other option is to move those reference links to the Getting started, but I think they are more useful next to the Configuration part of things. Let me know your thoughts |
I think we can do lead ins to each section with a brief introduction to what we're building and why we needed. I don't think this needs to be more than a few sentences. I think we should follow those with "read more" links to docs.libp2p.io. That would enable us to focus on keeping those docs up to date, and avoid duplicating that information here if we don't need to. I think the goal should be for users have just enough information to get them started and For example, when I start adding the code for Transports, I should understand that they are the components of libp2p that do they actual communicating between nodes, and if I was so inclined, should have easily been able to read up more on transports at https://docs.libp2p.io/concepts/transport/. I think having each section end with a "call to action" for users to see more about configuring that component in the Configuration readme, and the API where it makes sense, will go a long way in creating a nice starting point for new users, and existing users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just get this merged to the other PR, so that I can iterated on the stuff we discussed
Co-Authored-By: Vasco Santos <[email protected]>
@vasco-santos sounds good, added your changes, fill free to merge if it looks good. |
* doc: initial review of getting started Co-Authored-By: Vasco Santos <[email protected]>
* doc: initial review of getting started Co-Authored-By: Vasco Santos <[email protected]>
* docs: getting started * docs: review getting started (#520) * doc: initial review of getting started Co-Authored-By: Vasco Santos <[email protected]> * chore: move multiplexing to basic setup * chore: add read more cta * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <[email protected]> * chore: just configure multiplexer * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <[email protected]> * chore: just use websockets and changed dht module introduction * chore: add reference for events in the API doc * docs: simplify getting started guide and clean up language * chore: apply suggestions from code review Co-Authored-By: Alan Shaw <[email protected]> * docs(fix): address review comments Co-authored-by: Jacob Heun <[email protected]> Co-authored-by: Alan Shaw <[email protected]>
* docs: getting started * docs: review getting started (#520) * doc: initial review of getting started Co-Authored-By: Vasco Santos <[email protected]> * chore: move multiplexing to basic setup * chore: add read more cta * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <[email protected]> * chore: just configure multiplexer * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <[email protected]> * chore: just use websockets and changed dht module introduction * chore: add reference for events in the API doc * docs: simplify getting started guide and clean up language * chore: apply suggestions from code review Co-Authored-By: Alan Shaw <[email protected]> * docs(fix): address review comments Co-authored-by: Jacob Heun <[email protected]> Co-authored-by: Alan Shaw <[email protected]>
This PR is to supplement review of #514