Git Product home page Git Product logo

js-libp2p-pnet's Introduction

⛔️ DEPRECATED: libp2p-pnet is now included in js-libp2p

js-libp2p-pnet

Discourse posts Dependency Status js-standard-style

Connection protection management for libp2p leveraging PSK encryption via XSalsa20.

Lead Maintainer

Jacob Heun

Table of Contents

Usage

const Protector = require('libp2p-pnet')
const protector = new Protector(swarmKeyBuffer)
const privateConnection = protector.protect(myPublicConnection, (err) => { })

Examples

Private Networks with IPFS

Private Shared Keys

Private Shared Keys are expected to be in the following format:

/key/swarm/psk/1.0.0/
/base16/
dffb7e3135399a8b1612b2aaca1c36a3a8ac2cd0cca51ceeb2ced87d308cac6d

PSK Generation

A utility method has been created to generate a key for your private network. You can use one of the methods below to generate your key.

From libp2p-pnet

If you have libp2p-pnet locally, you can run the following from the projects root.

node src/key-generator.js > swarm.key

From a module using libp2p

If you have a module locally that depends on libp2p-pnet, you can run the following from that project, assuming the node_modules are installed.

node -e "require('libp2p-pnet').generate(process.stdout)" > swarm.key

Programmatically

const writeKey = require('libp2p-pnet').generate
const swarmKey = Buffer.alloc(95)
writeKey(swarmKey)
fs.writeFileSync('swarm.key', swarmKey)

Contribute

There are some ways you can make this module better:

This repository falls under the IPFS Code of Conduct.

License

MIT

js-libp2p-pnet's People

Contributors

jacobheun avatar vasco-santos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.