Giter Club home page Giter Club logo

chain-benchmark's Introduction

chain-benchmark

The repo contains boiler-plate code for benchmarking a chain. Provided an RPC URL to a chain that supports EVM and a TASK for which to evaluate the chain on. The module generates wallets and executes the provided tasks from all wallets concurrently and waits until all jobs are finished. After benchmarking the wallets generated during the process are saved in wallets.json and are re-used on next run.

How To use

Before running the benchmark script, kindly update benchmark.ts with appropriate:

  • PROVIDER RPC URL: The url of the block chain's rpc on which you wish to deploy.
  • FAUCET PVT KEY: The faucet responsible for providing any funds for gas or transactions to wallets.
  • TASK: A function which will be invoked asynchronously with different wallets to benchmark the network. Kindly specify one or more contract calls that you wish to benchmark the network on.
  • PRE_TASK: This function executes before the TASK and can be used to transfer any funds from faucet to any wallet or do something else.
  • POST_TASK: The function executes after the benchmarking task and can be used to see status or state of contracts/users.
# to install dependencies
yarn 

# to start benchmarking script:
yarn start -t <num_transactions> -f <funding_amount> -b <benchmark_filepath>
e.g: yarn start -t 10 -f 0.001 -b .\benchmark_det_transfer.ts

It accepts following params:
Options:
      --help           Show help                                       [boolean]
      --version        Show version number                             [boolean]
  -b, --benchmarkFile  path of the benchmark file                     [required]
  -t, --transactions   number of transactions to execute
  -f, --fundingAmount  funding amount to be sent to users

To do

  • Refractor the code base and make proper classes/interfaces/types and push it to npm.

chain-benchmark's People

Contributors

yameenmalik avatar

Watchers

 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.