A transaction generator for the Harmony blockchain
Transaction Generator Python library
This is for python 3.6+ only
Check that the latest version of pyhmy (20.1.8) is installed.
The pyhmy python library is used to interact with our blockchain. You can check your version of pyhmy with:
pip freeze | grep pyhmy
If your version is not updated or pyhmy is not listed, run:
python3 -m pip install pyhmy==20.1.8
Clone this repo (https://github.com/Daniel-VDM/harmony-ops), change into the directory (.../harmony-ops/test-automation/tx-gen) and run:
Example script when running for devnet can be seen here
While in this directory (harmony-ops/test-automation/tx-gen), run:
MAKE SURE TO HAVE A LOCALNET RUNNING
Important note about funding keys
One must have keys in the keystore that have funds on ALL shards (if one wishes to funds accounts on all shards). Note that one account does NOT have to have funds on all shard, but across all accounts in the keystore, there should be funds on all shards
This is because the library only does same shard transfers when funding.
How it works
A video demoing library can be seen here
The full documentation is in progress, but please look at the
localnet_example.py for some idea of how it works.
Essentially, it follows a source / sink model for transaction generation (explained more in the
./harmony_transaction_generator/generator.py). Moreover, the annotations of the config in
should give a better idea of how to use the library.
analysis module of this library has a
verify_transaction function that looks at the transaction logs and checks
if said transactions appear on the blockchain. Refer to
./harmony_transaction_generator/analysis.py for mode details
on how it works.
The library logs everything it can, so one can read the log files to analyze it. The filepath/filename can be accessed with
filename attribute of the logger, for example
Note that all times in the logs are in UTC.
The package has NOT been thoroughly tested so please report bugs and/or PR fixes if you find any, thank you!
Troubleshooting Errors While Testing
- Backup and clear keystore at
- Update pyhmy to latest version, can be checked here.
Check version with
python3 -m pip list | grep pyhmy
current balance is not enough for requested transfer, try increasing the 'INIT_SRC_ACC_BAL_PER_SHARD' value in the config file
- More testing
- Verify reset logic for multiple runs.
- improve config verification to fail early.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size harmony_transaction_generator-20.1.27-py3-none-any.whl (14.7 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size harmony_transaction_generator-20.1.27.tar.gz (13.0 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for harmony_transaction_generator-20.1.27-py3-none-any.whl
Hashes for harmony_transaction_generator-20.1.27.tar.gz