network-tank

Install

  1. Create virtual environment
pdm install
# or manually
virtualenv -p python3 .venv
  1. Activate it and install nekoton (feature/get_blockchain_config branch)
source .venv/bin/activate
pdm add ${PATH_TO_LOCAL_NEKOTON_BUILD}
# OR
pip install ${PATH_TO_LOCAL_NEKOTON_BUILD}

Config

  1. Crete .toml config from template and fill it with your data
cp config.toml.template config.toml
  1. Generate keypairs (optional, if you want to use keys file)
# n - number of accounts to generate
python gen_keys.py -n 100 --seed "${YOUR_SEED_PHRASE}"
  1. Fund accounts with evers
python fund.py

Run

Test case 1

Create N parallel flows (N = number of accounts). Every flow sends tx by tx synchronously after former tx is confirmed. Tx is a simple value transfer to another account.

python strat-1.py

Test case 2

Every M seconds send batch of N messages asynchronously. Batches are independent and don't wait for each other, so that account could be used for sending new message before previous one is confirmed. Generates more load than strat-1. Tx is a simple value transfer to another account.

python strat-2.py

Test case 3

Version of strat-2 that uses multiple processes if 1 CPU core is not enough.

python strat-3.py