From 32cac8b0c200e8596ba09282ae9dbdcf94c37d0c Mon Sep 17 00:00:00 2001 From: David Dias Date: Sun, 20 Sep 2015 16:18:34 +0100 Subject: [PATCH] to reserve the name --- README.md | 36 ++++++++++++++++++++++++++++++++++++ package.json | 4 +++- src/index.js | 0 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/index.js diff --git a/README.md b/README.md index 52ef6726..815c97e3 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,39 @@ node-libp2p [![](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/node-libp2p.svg?style=flat-square)](https://travis-ci.org/diasdavid/node-libp2p) ![](https://img.shields.io/badge/coverage-%3F-yellow.svg?style=flat-square) [![Dependency Status](https://david-dm.org/diasdavid/node-libp2p.svg?style=flat-square)](https://david-dm.org/diasdavid/node-libp2p) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) > Node.js implementation of libp2p + +## Interface + +> **This is a work in progress, 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. + +### Setting everything up + +``` +var libp2p = require('libp2p') +``` + +### Dialing and listening + +libp2p.swarm.dialStream(peerInfo, protocol, options, function (err, stream) {}) +libp2p.swarm.handleProtocol(protocol, options, handlerFunction) + +### Using Peer Routing + +libp2p.routing.findPeers(key, function (err, peerInfos) {}) + +### Using Records + +libp2p.record.get(key, function (err, records) {}) +libp2p.record.store(key, record) + +### Stats + + + +## Notes + +Img for ref (till we get a better graph) + +![](https://cloud.githubusercontent.com/assets/1211152/9450620/a02e3a9c-4aa1-11e5-83fd-cd996a0a4b6f.png) diff --git a/package.json b/package.json index 36f4ab07..639960b6 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,9 @@ }, "homepage": "https://github.com/diasdavid/node-libp2p", "devDependencies": { + "code": "^1.5.0", + "lab": "^5.17.0", "pre-commit": "^1.1.1", - "standard": "^5.1.0" + "standard": "^5.3.1" } } diff --git a/src/index.js b/src/index.js new file mode 100644 index 00000000..e69de29b