We have finally implemented encrypted profile functionality in Clive. This introduced many changes in CLI (command line interface) and TUI (text-based user interface). Additionally, we changed the way we use Beekeeper, now instead of implementing its Python handler in the Clive, we use the new Beekeepy library.
There are no changes to how Clive is run, you can still use the scripts we have prepared, one for running TUI, and the second for CLI. You can find links at the end of the text.
Encrypted profile
We introduced the changes gradually, so I have written about some of them before, but here I would like to sum up the entire encrypted profile functionality.
Clive stores the following data about your profile on your disk:
- your working account,
- tracked accounts - accounts you observe,
- known accounts,
- added key aliases,
- selected node,
- chain id,
- transaction in the cart (list of operations, Tapos, Expiration date, Transaction ID, and signatures - if the transaction is signed).
After implementing the encrypted profile functionality, all the above information is encrypted and available only after entering the password.
Due to these changes, if you have already used Clive, you have to recreate your profile.
Encrypted profile - changes in TUI
The main change here is that you must enter a password to log in before using Clive. If you don’t have a profile, you need to create one.
You can have more than one profile.
After using Clive, you can lock the wallet by pressing Unlocked
wallet status or using a dedicated “Lock wallet” binding.
Encrypted profile - changes in CLI
The easiest way to run CLI Clive is the start_clive_cli.sh
script. It sets up Beekeeper and saves a session token.
Similarly to the TUI, before you start using the CLI Clive, you have to select a profile (if you have any) or create a new one (by executing the clive configure profile add
command).
Once you enter a password, the selected profile is unlocked. While working with the unlocked profile, you don’t need to enter a password to execute every command.
Be aware that only one profile can be unlocked at a time.
Previously, there was a default profile functionality but we removed it because it wasn’t in line with the new functionality.
In order to lock or unlock a profile, you can use commands clive lock
or clive unlock
. You can switch the profile by locking the previous one and unlocking another one.
So if you want to broadcast a transaction, you need to do two steps: unlock a profile and process a transaction.
Beekeepy
The change from Beekeeper to Beekeepy from the users' point of view is unnoticeable, but this is a huge change from the developers' perspective. Beekeepy is a library with a strong focus on an object-oriented approach to the raw beekeeper network interface, aiming to guide users with abstract interfaces. It was created based on experience and solutions in the corresponding library in TypeScript.
You can try to use it in your project - it needs just a few lines of code - like in the following example!
from beekeepy import Beekeeper
# Create new local instance (works on both sync and async)
with Beekeeper.factory() as beekeeper,
beekeeper.create_session() as session,
session.create_wallet(name="my_wallet", password="password") as wallet:
public_key = wallet.import_key(private_key=my_private_key)
wallet.sign_digest(digest=my_digest, public_key=public_key)
To make Clive more user-friendly
We changed the way the list of operations looks. Now, all operations are available on a single page, grouped by operation category: Financial and Governance.
Complete list of corrected issues
The scripts that allow you to run Clive are here: https://gtg.openhive.network/get/clive/
TL;DR
docker run -ti hiveio/clive:v1.27.5.20