p2p-lobby
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

P2P Lobby (Demo)

A type safe lobby system built on IPFS.

Install

$ npm i p2p-lobby

Use in the browser

Bundle with browserify

$ npm run build:dev

or use the CDN

<!-- Development Build ~9MB -->
<script src="https://unpkg.com/p2p-lobby/umd/bundle.js"></script>
 
<!-- Production Build ~1.3MB :'( -->
<script src="https://unpkg.com/p2p-lobby/umd/bundle.min.js"></script>

Everything will be exposed under the global variable p2p.

To be fixed

  • No guarentee that all the peers are ready once the host ready's up
    • Peers may still be introducing themselves to one another.
  • When a peer that is waiting in node's room leaves
    • node.peers won't have access the peer's name
    • Since node.allPeers still has the name, but peer is no longer on node.allRooms.get(LOBBY)
    • Add a way to grab peers in current room!
  • Safe Ready Up
    • Ensure all the hashes are good when everyone ready's up and wait 2 poll interval cycles if not

Roadmap

  • Reduce bundled file size
    • Remove redundant deps
    • Build for multiple targets
    • Use as a libp2p package instead of ipfs wrapper
    • Use Proto instead of msgpack.
    • Upgrade to a smaller async emitter
    • Use UInt8Array over Buffers
  • joinPeer should require confirmation from them host
  • use a namespace instead of an instance since it should be a singleton tbh

Publishing

$ npm run release -- patch

Readme

Keywords

none

Package Sidebar

Install

npm i p2p-lobby

Weekly Downloads

20

Version

0.1.1

License

none

Unpacked Size

55 MB

Total Files

87

Last publish

Collaborators

  • mothepro