Skip to content

@libp2p/mplex extended with snappy compression

License

Notifications You must be signed in to change notification settings

individe/js-libp2p-snappy-muxer

 
 

Repository files navigation

@individe/libp2p-snappy-muxer

individe.xyz endlesshorizons.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

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.1%
  • JavaScript 3.9%