npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

murmur-client

v0.4.1

Published

To install Murmur for use in node or the browser with require('murmur-client'), run: ``` npm install murmur-client ```

Downloads

8

Readme

Murmur

Installation

To install Murmur for use in node or the browser with require('murmur-client'), run:

npm install murmur-client

To install Murmur as a command line program, run:

npm install -g murmur-client

Alternatively, you can use yarn.

Usage

Murmur can work as a command line application, and as a web3 provider in both browsers and node.js applications:

Command line application

To start a bridge between LIBP2P and DEVP2P:

$ murmur

To start a non-bridge DEVP2P client, with websocket support for connecting to whisper using web3.js, with a Web3.providers.WebsocketProvider pointing ws://localhost:8546.

$ murmur --ws --no-libp2p --no-bridge

Full list of flags can be seen with murmur -h:

  -V, --version           output the version number
  --ws                    enable the websockets RPC server
  --config [path]         use configuration file. (default: provided config)
  --wsport [port]         websockets RPC port [default: 8546]
  --devp2p-port [port]    DEVP2P port [default: 30303]
  --libp2p-port [port]    LIBP2P port [default: 0]
  --no-devp2p             disable DEVP2P
  --no-libp2p             disable LIBP2P
  --no-bridge             disable bridge between LIBP2P and DEVP2P
  --signal-servers [url]  signal server address [i.e. /ip4/127.0.0.1/tcp/9090/ws/p2p-webrtc-star,...]
  -h, --help              output usage information

In the case of --config, if this flag is not specified, it will use the default configuration included in the package: data/config.js. See this file for structure and valid values accepted.

Web3 provider (in browsers and node.js applications)

Murmur can also be used as a JS library, since it can act as a valid web3 provider:

const Murmur = require('murmur-client');
const Web3 = require('web3');

const server = new Murmur({
  protocols: ["libp2p"],
  signalServers: ["/dns4/127.0.0.1/tcp/9090/ws/p2p-webrtc-star"],
  bootnodes: []
});

server.start();

server.onReady(async () => {
  const web3 = new Web3();
  web3.setProvider(server.provider);

  // Use web3.shh functions here
});

The Murmur object accepts an option array where protocols like "libp2p" and "devp2p" can be specified. It's recommended in the case of clients to only use a single protocol at a time. (It hasn't been tested yet with multiple protocols, since that functionality is intended for bridges). When using "libp2p", the attribute "signalServers" is required, containing at least one signal server address. You can use the npm package js-libp2p-webrtc-star implementation if you do not have a signal server.

This package will be updated to allow specifying bootnodes and static nodes for "devp2p". Currently it will use those specified in the configuration included in the package: data/config.js

Contribution

Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!

If you'd like to contribute to murmur, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on #status-js channel to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.