How to send using CLI
To use your wallet with Klever Toolchain, you will need to map your wallet private key (the .pem file created in the session How to create a wallet) into the toolchain by adding:
-v $(pwd)/wallet:/opt/klever-blockchain
Or if you are using a self-hosted node, use --network=host to access the local node API. You can also use a public node by adding an environment variable into the toolchain:
-e KLEVR_NODE=https://node.testnet.klever.finance
Send tokens with the following code:
1
docker run -it --rm --user "$(id -u):$(id -g)" \
2
-v $(pwd)/wallet:/opt/klever-blockchain \
3
--network=host \
4
--entrypoint=/usr/local/bin/operator \
5
kleverapp/klever-go-testnet:latest \
6
--key-file=./walletKey.pem \
7
--node=https://node.testnet.klever.finance \
8
account send klv1h7vx629mwuv4pnecn0k9clxp9rt7rquat3kvydgu8npt20e0ntjq3jhd40 137
Copied!
On the last line, after the "send" command (send klv1h7vx629mwuv4pnecn0k9clxp9rt7rquat3kvydgu8npt20e0ntjq3jhd40 137), the code represents the following scheme: [TO] [AMOUNT].
[TO] is the address to whom the tokens are being sent.
[AMOUNT] is how much is being sent.
--kda is the Asset ID.
If no --kda is passed, as in the example above, the default KDA is KLV.
Here is another example, sending KFI:
1
docker run -it --rm --user "$(id -u):$(id -g)" \
2
-v $(pwd)/wallet:/opt/klever-blockchain \
3
--network=host \
4
--entrypoint=/usr/local/bin/operator \
5
kleverapp/klever-go-testnet:latest \
6
--key-file=./walletKey.pem \
7
--node=https://node.testnet.klever.finance \
8
account send klv1h7vx629mwuv4pnecn0k9clxp9rt7rquat3kvydgu8npt20e0ntjq3jhd40 \
9
137 --kda=KFI
Copied!
Copy link