mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-16 07:30:51 +00:00
to reserve the name
This commit is contained in:
parent
b85dea176a
commit
32cac8b0c2
36
README.md
36
README.md
@ -4,3 +4,39 @@ node-libp2p
|
||||
[](http://ipn.io) [[](http://webchat.freenode.net/?channels=%23ipfs) ](https://travis-ci.org/diasdavid/node-libp2p)  [](https://david-dm.org/diasdavid/node-libp2p) [](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)
|
||||
|
||||

|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
0
src/index.js
Normal file
0
src/index.js
Normal file
Loading…
x
Reference in New Issue
Block a user