Skip to content

Latest commit

 

History

History
121 lines (82 loc) · 2.88 KB

README.md

File metadata and controls

121 lines (82 loc) · 2.88 KB

GAME7_LOGO_RED

Chainprof Rollup Profiler

What

You can use Chainprof Rollup Profiler to evaluate which rollup suits your project better. It's a stress test for the most commonly used functions: funds transfer.

It will check how many calls an RPC can handle at once without failing.

Why

This is a public goods open source tool to help builders evaluate chain performance and assess the resilience of rollup providers' infrastructure.

It is made public to help advance the web3 ecosystem.

How

Requirements

  1. Build the project
make build

Setup chain profiling

This checklist describes how to setup chain profiling

Environment variables

  • export RPC=<rpc endpoint>
  • export NUM_ACCOUNTS=<number of accounts to create>
  • export ACCOUNTS_DIR=<directory containing generated accounts>
  • export ACCOUNTS_PASSWORD=<password to unlock accounts>

Create Accounts to be used for chain profiling

  • Create accounts for chain profiling
bin/chainprof chainprof accounts \
  --accounts-dir $ACCOUNTS_DIR \
  --num-accounts $NUM_ACCOUNTS \
  --password $ACCOUNTS_PASSWORD \
  --rpc $RPC

Transfer Native tokens to Created Accounts

Environment variables

  • export KEY=<path to keyfile of account to fund>
  • export VALUE=<value to send to accounts>

Fund Accounts

  • Send Transaction to fund accounts with Native Token
bin/chainprof account fund \
    --rpc $RPC \
    --keyfile $KEY \
    --accounts-dir $ACCOUNTS_DIR \
    --value $VALUE

Output: Transaction Hashes

Transfer Balances from Created Accounts

Environment variables

  • export RECIPIENT=<address to send funds to>

Drain Accounts

  • Send Transaction to Transfer all Native Token balance from created accounts to recipient
bin/chainprof account drain \
    --rpc $RPC \
    --send-to $RECIPIENT \
    --accounts-dir $ACCOUNTS_DIR \
    --password $ACCOUNTS_PASSWORD 

Output: Transaction Hashes

Evaluate Chain Performance

Environment variables

  • export NUM_TRANSACTIONS=<number of transactions to send>
  • export CALLDATA=<calldata to send in transactions>
  • export OUTFILE=<output file to write results to>
  • export TO=<address to send transactions to>
  • export KEY=<path to keyfile of account to send transactions from>

Evaluate

  • Send Transactions to evaluate chain performance
bin/chainprof chainprof evaluate \
    --rpc $RPC \
    --accounts-dir $ACCOUNTS_DIR \
    --password $ACCOUNTS_PASSWORD \
    --value $VALUE \
    --transactions-per-account $NUM_TRANSACTIONS \
    --calldata $CALLDATA \
    --outfile $OUTFILE \
    --to $TO

Output: Results written to file