We have completed three topics for this release. The first feature - important for some of you - is the ability to execute Clive commands as a bash shell script. The remaining topics are continuations of previous work - we added validations for exchanges (in the CLI and when loading transactions from a file) and updated several views to improve their appearance and consistency: loading from a file (key or transaction), saving transaction to a file, adding or editing aliases.
You can run your script containing Clive commands using the --exec option. If your script includes logic that requires a password, for example to unlock or create a profile, you can provide it via a pipe passed to start_clive_cli.sh.
The script that launches Clive prepares the environment, but if you want to execute commands in unlocked mode, you still need to unlock a profile by placing a clive unlock --profile <name> command in your script.
I prepared the script my_script.sh. The script unlocks the profile alice and broadcasts the transfer to guest4test8 signing with alice_key.
#!/bin/bash
echo "Unlocking wallet for profile 'alice'..."
clive unlock --profile-name=alice
echo "Transfer to guest4test8..."
clive process transfer --to guest4test8 --amount "0.001 hive" --sign alice_key
You can run your script using the following syntax:
echo alicealice | ./start_clive_cli.sh --exec ./my_script.sh
Of course you can provide a password in a safer and more convenient way, using a file or a bash environment variable.
If you want to use an environment variable:
export PASS=alicealice
echo "${PASS}" | ./start_clive_cli.sh --exec ./my_script.sh`
If you want to use a file to provide a password:
echo alicealice > pass.txt
cat pass.txt | ./start_clive_cli.sh --exec ./my_script.sh`
After executing the above command, the transfer is broadcast.
This is the final part of the changes related to checking operation receivers. We have already implemented the known account feature and validation against the bad accounts, both available in the CLI and the TUI. In this release we have added the remaining validations related to exchanges.
The validation checks whether the receiver account is an account belonging to one of the five most popular exchanges. The following accounts are checked:
| Account name | Entity |
|---|---|
| bdhivesteem | Binance |
| deepcrypto8 | Binance |
| huobi-pro | HTX |
| user.dunamu | Upbit |
| mxchive | mexc |
There are different validations for transfers and for other financial operations.
The transfer to an exchange should be in Hive and must include a memo. These conditions are checked in both the CLI and in the TUI.
Example: Transfer in the CLI
It is not possible to send transfers to exchanges without a memo or in HBD.
Example: Transfer in the TUI
Here is an example of how it looks in the TUI. If the user enters an exchange as the receiver, it is not possible to switch currency and a memo is required. There is also a placeholder indicating that the user should check what should be entered in the memo.
If one of the exchange accounts is set as the receiver of any financial operation other than transfer (transfer to savings, transfer from savings, recurrent transfer, power up, set delegations and set withdrawal routes), an error message appears. The validation may be bypassed by using the --force flag in the CLI or by confirming the dialog in the TUI.
Example:
Trying to send savings to an exchange account in the CLI.
Example:
In the TUI, if the user wants to send savings to an exchange account, additional confirmation is required.
The same validations as described above are executed during saving a transaction to a file or during loading the transaction from a file.
Example:
Validation triggered when loading a transaction that contains a transfer to an exchange without a memo.
CLI:
TUI:
Example:
Validation triggered when loading a transaction that contains an example of financial operation (transfer from savings) to an exchange without a memo.
CLI:
TUI:
To make Clive look more consistent, we have updated several views:
Below is an example of the new dialog window for adding a new alias.
Complete list of corrected issues
The scripts that allow you to run Clive are here:
https://gtg.openhive.network/get/clive/
docker run -ti hiveio/clive:v1.27.11.3