@individe/libp2p-snappy-muxer
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@individe/libp2p-snappy-muxer

individe.xyz individe.xyz

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

Package Sidebar

Install

npm i @individe/libp2p-snappy-muxer

Weekly Downloads

4

Version

0.1.0

License

Apache-2.0 OR MIT

Unpacked Size

98 kB

Total Files

48

Last publish

Collaborators

  • ajaleksa