@individe/libp2p-snappy-muxer
v0.1.0
Published
@libp2p/mplex extended with snappy compression
Downloads
24
Maintainers
Readme
@individe/libp2p-snappy-muxer
libp2p's mplex muxer extended with snappy compression, made to be used with Individe IPFS nodes.
Table of contents
Install
$ npm i @individe/libp2p-snappy-muxer
Usage
Snappy muxer extends Mplex. It compresses all outgoing streams towards nodes that implement /mplex/snappy/x.x.x multistream protocol and decompresses incoming streams from the nodes that implement that same protocol. Compression algorithm used is snappy.
libp2p
import { SnappyMplex } from '@individe/libp2p-snappy-muxer'
import { createLibp2p } from 'libp2p'
const node = await createLibp2p({
streamMuxers: [
new SnappyMplex()
]
})
ipfs
import { SnappyMplex } from '@individe/libp2p-snappy-muxer'
import { createLibp2p } from 'libp2p'
import * as IPFS from 'ipfs-core'
(async () => {
const libp2p = await createLibp2p({
streamMuxers: [
new SnappyMplex()
]
})
const ipfs = await IPFS.create({
libp2p: libp2p
})
})()
License
Licensed under either of
- Apache 2.0, (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)
- MIT (LICENSE-MIT / http://opensource.org/licenses/MIT)