Skip to content

Commit 3c93b7c

Browse files
committed
Standardized Readme
Thoughts?
1 parent c72ce8a commit 3c93b7c

File tree

1 file changed

+51
-16
lines changed

1 file changed

+51
-16
lines changed

README.md

+51-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,42 @@
11
js-libp2p
22
=========
33

4-
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) ![Build Status](https://travis-ci.org/diasdavid/js-libp2p.svg?style=flat-square)](https://travis-ci.org/diasdavid/js-libp2p) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/diasdavid/js-libp2p.svg?style=flat-square)](https://david-dm.org/diasdavid/js-libp2p) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
4+
![](https://raw.githubusercontent.com/diasdavid/specs/libp2p-spec/protocol/network/figs/logo.png)
5+
6+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
7+
[[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
8+
[![Build Status](https://travis-ci.org/diasdavid/js-libp2p.svg?style=flat-square)](https://travis-ci.org/diasdavid/js-libp2p)
9+
![coverage](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square)
10+
[![Dependency Status](https://david-dm.org/diasdavid/js-libp2p.svg?style=flat-square)](https://david-dm.org/diasdavid/js-libp2p)
11+
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)
512

613
> JavaScript implementation of libp2p
714
8-
![](https://raw.githubusercontent.com/diasdavid/specs/libp2p-spec/protocol/network/figs/logo.png)
15+
libp2p is a networking stack and library modularized out of The IPFS Project, and bundled separately for other tools to use.
916

10-
# Description
17+
## Table of Contents
1118

12-
libp2p is a networking stack and library modularized out of The IPFS Project, and bundled separately for other tools to use.
19+
- [Background](#background)
20+
- [Packages](#packages)
21+
- [Notes](#notes)
22+
- [Install](#install)
23+
- [Usage](#usage)
24+
- [Setting everything up](#setting-everything-up)
25+
- [Dialing and listening](#dialing-and-listening)
26+
- [Using Peer Routing](#using-peer-routing)
27+
- [Using Records](#using-records)
28+
- [Stats](#stats)
29+
- [Contribute](#contribute)
30+
- [License](#license)
31+
32+
## Background
1333

1434
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.
1535

1636
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.
1737

38+
### Packages
1839

19-
# Packages
2040
| Package | Version | Dependencies | DevDependencies |
2141
|--------|-------|------------|----------|
2242
| [`peer-book`](//github.com/libp2p/js-peer-book) | [![npm](https://img.shields.io/npm/v/peer-book.svg?maxAge=86400&style=flat-square)](//github.com/libp2p/js-peer-book/releases) | [![Dependency Status](https://david-dm.org/libp2p/js-peer-book.svg?style=flat-square)](https://david-dm.org/libp2p/js-peer-book) | [![devDependency Status](https://david-dm.org/libp2p/js-peer-book/dev-status.svg?style=flat-square)](https://david-dm.org/libp2p/js-peer-book?type=dev) |
@@ -40,19 +60,29 @@ We will be writing a set of docs, posts, tutorials, and talks to explain what p2
4060
| [`libp2p-webrtc-star`](//github.com/libp2p/js-libp2p-webrtc-star) | [![npm](https://img.shields.io/npm/v/libp2p-webrtc-star.svg?maxAge=86400&style=flat-square)](//github.com/libp2p/js-libp2p-webrtc-star/releases) | [![Dependency Status](https://david-dm.org/libp2p/js-libp2p-webrtc-star.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-webrtc-star) | [![devDependency Status](https://david-dm.org/libp2p/js-libp2p-webrtc-star/dev-status.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-webrtc-star?type=dev) |
4161
| [`multistream-select`](//github.com/diasdavid/js-multistream) | [![npm](https://img.shields.io/npm/v/multistream-select.svg?maxAge=86400&style=flat-square)](//github.com/diasdavid/js-multistream/releases) | [![Dependency Status](https://david-dm.org/diasdavid/js-multistream.svg?style=flat-square)](https://david-dm.org/diasdavid/js-multistream) | [![devDependency Status](https://david-dm.org/diasdavid/js-multistream/dev-status.svg?style=flat-square)](https://david-dm.org/diasdavid/js-multistream?type=dev) |
4262

43-
# Usage
63+
### Notes
64+
65+
Img for ref (till we get a better graph)
66+
67+
![](https://cloud.githubusercontent.com/assets/1211152/9450620/a02e3a9c-4aa1-11e5-83fd-cd996a0a4b6f.png)
68+
69+
## Install
4470

45-
## Interface
71+
```sh
72+
npm i --save libp2p
73+
```
74+
75+
## Usage
4676

47-
> **This is a work in progress, interface might change at anytime**
77+
> **This is a work in progress. The interface might change at anytime.**
4878
4979
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.
5080

5181
libp2p becomes very simple and basically acts as a glue for every module that compose this library. Since it can be highly customized, it requires some setup. What we recommend is to have a libp2p build for the system you are developing taking into account in your needs (e.g. for a browser working version of libp2p that acts as the network layer of IPFS, we have a built and minified version that browsers can require)
5282

5383
### Setting everything up
5484

55-
```
85+
```js
5686
var Libp2p = require('libp2p')
5787

5888
// 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])
6292

6393
### Dialing and listening
6494

95+
```js
6596
p2p.swarm.dial(peerInfo, options, protocol, function (err, stream) {})
6697
p2p.swarm.handleProtocol(protocol, options, handlerFunction)
98+
```
6799

68100
### Using Peer Routing
69101

102+
```js
70103
p2p.routing.findPeers(key, function (err, peerInfos) {})
104+
```
71105

72106
### Using Records
73107

108+
```js
74109
p2p.record.get(key, function (err, records) {})
75110
p2p.record.store(key, record)
111+
```
76112

77113
### Stats
78114

79-
# Contribute
115+
TODO
80116

81-
libp2p implementation in JavaScript is a work in progress. As such, there's a few things you can do right now to help out:
117+
## Contribute
118+
119+
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:
82120

83121
- 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.
84122
- **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.
85123
- **Add tests**. There can never be enough tests.
86124

125+
## License
87126

88-
## Notes
89-
90-
Img for ref (till we get a better graph)
91-
92-
![](https://cloud.githubusercontent.com/assets/1211152/9450620/a02e3a9c-4aa1-11e5-83fd-cd996a0a4b6f.png)
127+
[MIT](LICENSE) © David Dias

0 commit comments

Comments
 (0)