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

pandoras-box

v1.1.2

Published

A small and simple stress testing tool for Ethereum-compatible blockchain networks

Downloads

530

Readme

Overview

pandoras-box is a command-line interface (CLI) tool for running stress tests on Ethereum-compatible blockchain networks, such as Ethereum, Polygon, Hyperledger, and others. It is designed to be an essential tool for Ethereum client developers looking to test the performance of their blockchain under high load.

Key features

  • 🚀 Batch transactions to make stress testing easier to orchestrate
  • 🛠 Multiple stress testing modes: EOA, ERC20, and ERC721
  • 💰 Distributed transaction stress testing through subaccounts
  • 💸 Automatic subaccount fund top-up
  • 📊 Detailed statistics calculation
  • 📈 Output cycle run results to a file

Usage example

To run a stress test with pandoras-box, you will need to have Node.js and npm / yarn installed on your system.

  1. Install pandoras-box using npm / yarn:
npm install -g pandoras-box
  1. Run the stress test by specifying the options for the test:
pandoras-box -url http://127.0.0.1:10002 -m "erupt oven loud noise rug proof sunset gas table era dizzy vault" -t 100 -b 5000 -o ./myOutput.json

This will run a stress test on the Ethereum-compatible blockchain network with a JSON-RPC endpoint at http://127.0.0.1:10002, using the mnemonic erupt oven loud noise rug proof sunset gas table era dizzy vault to generate the subaccounts. The test will send out 100 transactions in maximum batches of 5000, and the results will be output to a file called myOutput.json.

For any stress test run, there need to be funds on a specific address. The address that is in charge of funds distribution to subaccounts is the first address with index 0 in the specified mnemonic. Make sure this address has an appropriate amount of funds before running the stress test.

Banner

pandoras-box supports the following options:

Usage: pandoras-box [options]

A small and simple stress testing tool for Ethereum-compatible blockchain clients

Options:
  -V, --version                        output the version number
  -url, --json-rpc <json-rpc-address>  The URL of the JSON-RPC for the client
  -m, --mnemonic <mnemonic>            The mnemonic used to generate spam accounts
  -s, -sub-accounts <sub-accounts>     The number of sub-accounts that will send out transactions (default: "10")
  -t, --transactions <transactions>    The total number of transactions to be emitted (default: "2000")
  --mode <mode>                        The mode for the stress test. Possible modes: [EOA, ERC20, ERC721] (default: "EOA")
  -o, --output <output-path>           The output path for the results JSON
  -b, --batch <batch>                  The batch size of JSON-RPC transactions (default: "20")
  -h, --help                           display help for command

Installing locally

pandoras-box can be installed locally using the git repository. A recent version of Node.js and yarn is required.

  1. Clone the git repository
git clone https://github.com/madz-lab/pandoras-box.git
  1. Build the source (from the repository root)
yarn build

The yarn build command will compile the TypeScript files locally into the bin folder, and run a chmod command for enabling execution.

  1. Link the command (from the repository root)
yarn link

The yarn link command will link the index.js file to the pandoras-box command, so it can be executed from anywhere. Local code can now be modified, and built again - changes made will be reflected on future command runs.

Modes

EOA

The EOA mode is pretty straightforward - it is a simple value transfer mode between regular Ethereum accounts. This mode sends out transactions with a certain value transfer between subaccounts.

ERC20

The ERC20 mode deploys an ERC20 token to the blockchain network being tested before starting the cycle run. When the cycle run begins, the transactions that are sent out are ERC20 token transfers between subaccounts.

ERC721

The ERC721 mode deploys an ERC721 NFT contract to the blockchain network being tested before starting the cycle run. When the cycle run begins, the transactions that are sent out are ERC721 NFT mints.