mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-16 07:30:51 +00:00
Standardized Readme
Thoughts?
This commit is contained in:
parent
c72ce8a7fb
commit
3c93b7cd4e
69
README.md
69
README.md
@ -1,22 +1,42 @@
|
||||
js-libp2p
|
||||
=========
|
||||
|
||||
[](http://ipn.io) [[](http://webchat.freenode.net/?channels=%23ipfs) ](https://travis-ci.org/diasdavid/js-libp2p)  [](https://david-dm.org/diasdavid/js-libp2p) [](https://github.com/feross/standard)
|
||||

|
||||
|
||||
[](http://ipn.io)
|
||||
[[](http://webchat.freenode.net/?channels=%23ipfs)
|
||||
[](https://travis-ci.org/diasdavid/js-libp2p)
|
||||

|
||||
[](https://david-dm.org/diasdavid/js-libp2p)
|
||||
[](https://github.com/feross/standard)
|
||||
|
||||
> JavaScript implementation of libp2p
|
||||
|
||||

|
||||
|
||||
# Description
|
||||
|
||||
libp2p is a networking stack and library modularized out of The IPFS Project, and bundled separately for other tools to use.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Background](#background)
|
||||
- [Packages](#packages)
|
||||
- [Notes](#notes)
|
||||
- [Install](#install)
|
||||
- [Usage](#usage)
|
||||
- [Setting everything up](#setting-everything-up)
|
||||
- [Dialing and listening](#dialing-and-listening)
|
||||
- [Using Peer Routing](#using-peer-routing)
|
||||
- [Using Records](#using-records)
|
||||
- [Stats](#stats)
|
||||
- [Contribute](#contribute)
|
||||
- [License](#license)
|
||||
|
||||
## Background
|
||||
|
||||
libp2p is the product of a long, and arduous quest of understanding -- a deep dive into the internet's network stack, and plentiful peer-to-peer protocols from the past. Building large scale peer-to-peer systems has been complex and difficult in the last 15 years, and libp2p is a way to fix that. It is a "network stack" -- a protocol suite -- that cleanly separates concerns, and enables sophisticated applications to only use the protocols they absolutely need, without giving up interoperability and upgradeability. libp2p grew out of IPFS, but it is built so that lots of people can use it, for lots of different projects.
|
||||
|
||||
We will be writing a set of docs, posts, tutorials, and talks to explain what p2p is, why it is tremendously useful, and how it can help your existing and new projects.
|
||||
|
||||
### Packages
|
||||
|
||||
# Packages
|
||||
| Package | Version | Dependencies | DevDependencies |
|
||||
|--------|-------|------------|----------|
|
||||
| [`peer-book`](//github.com/libp2p/js-peer-book) | [](//github.com/libp2p/js-peer-book/releases) | [](https://david-dm.org/libp2p/js-peer-book) | [](https://david-dm.org/libp2p/js-peer-book?type=dev) |
|
||||
@ -40,11 +60,21 @@ We will be writing a set of docs, posts, tutorials, and talks to explain what p2
|
||||
| [`libp2p-webrtc-star`](//github.com/libp2p/js-libp2p-webrtc-star) | [](//github.com/libp2p/js-libp2p-webrtc-star/releases) | [](https://david-dm.org/libp2p/js-libp2p-webrtc-star) | [](https://david-dm.org/libp2p/js-libp2p-webrtc-star?type=dev) |
|
||||
| [`multistream-select`](//github.com/diasdavid/js-multistream) | [](//github.com/diasdavid/js-multistream/releases) | [](https://david-dm.org/diasdavid/js-multistream) | [](https://david-dm.org/diasdavid/js-multistream?type=dev) |
|
||||
|
||||
# Usage
|
||||
### Notes
|
||||
|
||||
## Interface
|
||||
Img for ref (till we get a better graph)
|
||||
|
||||
> **This is a work in progress, interface might change at anytime**
|
||||

|
||||
|
||||
## Install
|
||||
|
||||
```sh
|
||||
npm i --save libp2p
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
> **This is a work in progress. The interface might change at anytime.**
|
||||
|
||||
libp2p expects a [Record Store interface](https://github.com/diasdavid/abstract-record-store), a swarm and one or more Peer Routers that implement the [Peer Routing](https://github.com/diasdavid/abstract-peer-routing), the goal is to keep simplicity and plugability while the remaining modules execute the heavy lifting.
|
||||
|
||||
@ -52,7 +82,7 @@ libp2p becomes very simple and basically acts as a glue for every module that co
|
||||
|
||||
### Setting everything up
|
||||
|
||||
```
|
||||
```js
|
||||
var Libp2p = require('libp2p')
|
||||
|
||||
// set up a Swarm, Peer Routing and Record Store instances, the last two are optional
|
||||
@ -62,31 +92,36 @@ var p2p = new Libp2p(swarm, [peerRouting, recordStore])
|
||||
|
||||
### Dialing and listening
|
||||
|
||||
```js
|
||||
p2p.swarm.dial(peerInfo, options, protocol, function (err, stream) {})
|
||||
p2p.swarm.handleProtocol(protocol, options, handlerFunction)
|
||||
```
|
||||
|
||||
### Using Peer Routing
|
||||
|
||||
```js
|
||||
p2p.routing.findPeers(key, function (err, peerInfos) {})
|
||||
```
|
||||
|
||||
### Using Records
|
||||
|
||||
```js
|
||||
p2p.record.get(key, function (err, records) {})
|
||||
p2p.record.store(key, record)
|
||||
```
|
||||
|
||||
### Stats
|
||||
|
||||
# Contribute
|
||||
TODO
|
||||
|
||||
libp2p implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out:
|
||||
## Contribute
|
||||
|
||||
THe libp2p implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out:
|
||||
|
||||
- Go through the modules below and **check out existing issues**. This would be especially useful for modules in active development. Some knowledge of IPFS/libp2p may be required, as well as the infrasture behind it - for instance, you may need to read up on p2p and more complex operations like muxing to be able to help technically.
|
||||
- **Perform code reviews**. Most of this has been developed by @diasdavid, which means that 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.
|
||||
|
||||
## License
|
||||
|
||||
## Notes
|
||||
|
||||
Img for ref (till we get a better graph)
|
||||
|
||||

|
||||
[MIT](LICENSE) © David Dias
|
||||
|
Loading…
x
Reference in New Issue
Block a user