You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/ARCHITECTURE.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@
3
3
js-libp2p is comprised of a number of components that work together to provide functionality such as dailling peers, managing connections, registering protocols, storing information about peers and much more. This document aims to provide a high level overview of the components and how they interact with each other.
4
4
5
5
-[Libp2p Architecture](#libp2p-architecture)
6
-
- [Component Diagram](#component-diagram)
7
-
- [Sequence Diagrams](#sequence-diagrams)
8
-
- [Dialing a Peer](#dialing-a-peer)
9
-
- [Opening a stream on a connection](#opening-a-stream-on-a-connection)
6
+
-[Component Diagram](#component-diagram)
7
+
-[Sequence Diagrams](#sequence-diagrams)
8
+
-[Dialing a Peer](#dialing-a-peer)
9
+
-[Opening a stream on a connection](#opening-a-stream-on-a-connection)
-[Transport specific limits](#transport-specific-limits)
@@ -101,50 +100,6 @@ libp2p stream multiplexers impose limits on the amount of streams that can be op
101
100
102
101
These settings are done on a per-muxer basis, please see the README of the relevant muxer you are using.
103
102
104
-
### Mplex
105
-
106
-
[@libp2p/mplex](https://github.com/libp2p/js-libp2p/tree/main/packages/stream-multiplexer-mplex) supports the following.
107
-
108
-
All fields are optional. The default values are defined in [@libp2p/mplex/src/mplex.ts](https://github.com/libp2p/js-libp2p/blob/main/packages/stream-multiplexer-mplex/src/mplex.ts) - please see that file for the current values.
109
-
110
-
```TypeScript
111
-
import { createLibp2p } from'libp2p'
112
-
import { mplex } from'@libp2p/mplex'
113
-
114
-
const node =awaitcreateLibp2p({
115
-
streamMuxers: [
116
-
mplex({
117
-
/**
118
-
* The total number of inbound protocol streams that can be opened on a given connection
119
-
*/
120
-
maxInboundStreams: 100,
121
-
122
-
/**
123
-
* The total number of outbound protocol streams that can be opened on a given connection
124
-
*/
125
-
maxOutboundStreams: 100,
126
-
127
-
/**
128
-
* How much incoming data in bytes to buffer while attempting to parse messages - peers sending many small messages in batches may cause this buffer to grow
129
-
*/
130
-
maxUnprocessedMessageQueueSize: 50,
131
-
132
-
/**
133
-
* How much message data in bytes to buffer after parsing - slow stream consumers may cause this buffer to grow
134
-
*/
135
-
maxStreamBufferSize: 20,
136
-
137
-
/**
138
-
* Mplex does not support backpressure so to protect ourselves, if `maxInboundStreams` is
139
-
* hit and the remote opens more than this many streams per second, close the connection
140
-
*/
141
-
disconnectThreshold: 20,
142
-
}),
143
-
],
144
-
});
145
-
146
-
```
147
-
148
103
### Yamux
149
104
150
105
[@chainsafe/libp2p-yamux](https://github.com/Chainsafe/js-libp2p-yamux) supports the following.
0 commit comments