Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Document constructor options more formally #1294

Merged
merged 3 commits into from Apr 10, 2018

Conversation

Mr0grog
Copy link
Contributor

@Mr0grog Mr0grog commented Apr 3, 2018

This adds more descriptive and organized definitions for all the available options to the IPFS constructor as well as a full reference of events and the start() and stop() methods.

Some open questions here:

  • I documented start() and stop(), but wasn’t sure which of the other methods are considered public that we should document.

  • I used node to refer to the IPFS instance throughout example code and in references for methods (start and stop). That matches the pre-existing usage examples. However, the core API reference uses ipfs.xyz. I think we should make both the same for clarity. node sounds slightly better to me, but I do not have a strong opinion.

  • I don’t know enough to say more than what we already had about the EXPERIMENTAL.dht option. Is there anything we can say about why someone might want to turn it on or off?

  • I did not attempt to document all the config options, but I added links directly to the two default config files. Is that OK for now?

  • I noticed that the libp2p option only supports modules and, inside that, only supports transport and discovery (not connection or DHT). You also can’t turn off any of the default transports or discovery mechanisms.

    • Are there plans to change that?
    • Should we add this to src/core/config.js so it can be validated?

@Mr0grog Mr0grog force-pushed the docs/formal-constructor-docs branch 2 times, most recently from 33db356 to 9466884 Compare April 3, 2018 03:01
This adds more descriptive and organized definitions for all the available options to the `IPFS` constructor as well as a full reference of events and the `start()` and `stop()` methods.

License: MIT
Signed-off-by: Rob Brackett <rob@robbrackett.com>
@Mr0grog Mr0grog force-pushed the docs/formal-constructor-docs branch from 9466884 to 26633f3 Compare April 3, 2018 03:02
Copy link
Member

@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. Thank you so much @Mr0grog :)

It would be excellent to have a similar PR to https://github.com/ipfs/js-ipfs-api that separates set up from actually using the Core API

README.md Outdated

### [Tutorials and Examples](/examples)
**Returns a promise** that resolves when the node is completely stopped. You can also pass a callback like `(error) => {...}` or listen for the `stop` event to determine when the node has stopped.
Copy link
Member

Choose a reason for hiding this comment

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

Returns a promise if no callback is passed

License: MIT
Signed-off-by: Rob Brackett <rob@robbrackett.com>
The FAQ repo has been deprecated, so remove the contribution section's link to it. Instead, link to discuss.ipfs.io and IRC at the end of the FAQ.

License: MIT
Signed-off-by: Rob Brackett <rob@robbrackett.com>
@Mr0grog
Copy link
Contributor Author

Mr0grog commented Apr 3, 2018

How’s https://github.com/Mr0grog/js-ipfs/blob/43123833af0f1eaebd2b74ba103e12b3d138a185/README.md#nodestartcallback ?

@daviddias
Copy link
Member

LGTM, thanks @Mr0grog :)

@Mr0grog
Copy link
Contributor Author

Mr0grog commented Apr 9, 2018

OK, if this is good, do you mind approving and merging, @diasdavid?

@daviddias
Copy link
Member

@Mr0grog can we have an equivalent PR to js-ipfs-api? It would be good to have both in sync

@Mr0grog
Copy link
Contributor Author

Mr0grog commented Apr 10, 2018

Maybe someone could use this as an example to start from? It took a pretty good chunk of my day to chase through all the code paths and feel confident I was explaining each thing accurately. I need to preserve some time to actually work on my main focus over in ipfs/docs!

@daviddias
Copy link
Member

Thank you for your contribution, @Mr0grog ❤️

@daviddias daviddias merged commit c307eb9 into ipfs:master Apr 10, 2018
@Mr0grog Mr0grog deleted the docs/formal-constructor-docs branch April 10, 2018 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants