First you need to have a hived built somewhere, I won't cover how to do it here but you

in #toolhivetutorial3 years ago

If you are working on hive core it's a really powerful tool to create tests. What is does basically is spin up a hived node using whatever configuration you write down in your code. And it also allows you to also seamlessly use the wallet binary and execute commands from it.

But setting it up can prove to be a slight challenge so I figured I'd provide a small guide to save you the time I spend figuring things out.

First you need to have a hived built somewhere, I won't cover how to do it here but you can dig through my history or what @gtg wrote there is plenty of documentation everywhere.

Installation
git clone [email protected]:hive/test-tools.git

Once you have the repository, you may be tempted to just execute ./install.py but this script requires test tools to be in your pythonpath already which is not the case. So you could provide it as params but I went ahead and added it in my .bashrc, along with a new var HIVE_BUILD_ROOT_PATH which is the directory in which you built hive. That way ./install.sh will detect the different binaries.

export PYTHONPATH="${PYTHONPATH}:/home/howo/projects/test-tools/package"
export HIVE_BUILD_ROOT_PATH="/home/howo/projects/hive/build"
then source your .bashrc or start a new shell and execute install.py

you will get something along those lines:

You have successfully installed test-tools.

Details:
Symlink to [1] created in [2].
[1] /home/howo/projects/test-tools/package/test_tools
[2] /home/howo/.local/lib/python3.8/site-packages/test-tools

Paths are configured correctly:
hived: /home/howo/projects/hive/build/programs/hived/hived
cli_wallet: /home/howo/projects/hive/build/programs/cli_wallet/cli_wallet
get_dev_key: /home/howo/projects/hive/build/programs/util/get_dev_key
and at this point you are ready to execute scripts !

Sort:  

yes

Its awesome to know

Thank you