mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-26 15:31:34 +00:00
fix readme typos and missing links
This commit is contained in:
14
README.md
14
README.md
@ -7,7 +7,7 @@ libp2p-swarm Node.js implementation
|
||||
|
||||
# Description
|
||||
|
||||
libp2p-swarm is connection abstraction that is able to leverage several transports and connection upgrades (such as congestion control, encrypt a channel, multiplex several streams in one connection, and more. It does this by bringing protocol multiplexing to the application level (instead of the traditional Port level) using multicodec and multistream.
|
||||
libp2p-swarm is a connection abstraction that is able to leverage several transports and connection upgrades, such as congestion control, channel encryption, multiplexing several streams in one connection, and more. It does this by bringing protocol multiplexing to the application level (instead of the traditional Port level) using multicodec and multistream.
|
||||
|
||||
libp2p-swarm is used by libp2p but it can be also used as a standalone module.
|
||||
|
||||
@ -21,7 +21,7 @@ libp2p-swarm is available on npm and so, like any other npm module, just:
|
||||
$ npm install libp2p-swarm --save
|
||||
```
|
||||
|
||||
And use it on your Node.js code as:
|
||||
And use it in your Node.js code as:
|
||||
|
||||
```JavaScript
|
||||
var Swarm = require('libp2p-swarm')
|
||||
@ -29,7 +29,7 @@ var Swarm = require('libp2p-swarm')
|
||||
var sw = new Swarm(peerInfoSelf)
|
||||
```
|
||||
|
||||
peerInfoSelf is a PeerInfo object that represents the peer creating this swarm instance.
|
||||
peerInfoSelf is a [PeerInfo](https://github.com/diasdavid/node-peer-info) object that represents the peer creating this swarm instance.
|
||||
|
||||
### Support a transport
|
||||
|
||||
@ -39,15 +39,15 @@ libp2p-swarm expects transports that implement [abstract-transport](https://gith
|
||||
sw.addTransport(transport, [options, dialOptions, listenOptions])
|
||||
```
|
||||
|
||||
### Add an connection upgrade
|
||||
### Add a connection upgrade
|
||||
|
||||
A connection upgrade must be able to receive and return something that implements the [abstract-connection]() interface.
|
||||
A connection upgrade must be able to receive and return something that implements the [abstract-connection](https://github.com/diasdavid/abstract-connection) interface.
|
||||
|
||||
```JavaScript
|
||||
sw.addUpgrade(connUpgrade, [options])
|
||||
```
|
||||
|
||||
Upgrading a connection to use a Stream Muxer is still considered a upgrade, but a special case since once this connection is applied, the returned obj will implement the [abstract-stream-muxer]() interface.
|
||||
Upgrading a connection to use a stream muxer is still considered an upgrade, but a special case since once this connection is applied, the returned obj will implement the [abstract-stream-muxer](https://github.com/diasdavid/abstract-stream-muxer) interface.
|
||||
|
||||
```JavaScript
|
||||
sw.addStreamMuxer(streamMuxer, [options])
|
||||
@ -60,7 +60,7 @@ sw.dial(PeerInfo, options, protocol)
|
||||
sw.dial(PeerInfo, options)
|
||||
```
|
||||
|
||||
dial uses the best transport (whatever works first, in the future we can have some criteria), and jump starts the connection until the point we have to negotiate the protocol. If a Muxer is available, then drop the muxer onto that connection. Good to warm up connections or to check for connectivity. If we have already a Muxer for that peerInfo, than do nothing.
|
||||
dial uses the best transport (whatever works first, in the future we can have some criteria), and jump starts the connection until the point we have to negotiate the protocol. If a muxer is available, then drop the muxer onto that connection. Good to warm up connections or to check for connectivity. If we have already a muxer for that peerInfo, than do nothing.
|
||||
|
||||
### Accept requests on a specific protocol
|
||||
|
||||
|
Reference in New Issue
Block a user