Enter the following command into your shell of choice:
curl -LO https://harmony.one/hmycli && mv hmycli hmy && chmod +x hmy
If you have permission issues, enter the commands with "sudo" at the beginning, i.e. "sudo curl -LO https://harmony.one/hmycli && sudo mv hmycli hmy && sudo chmod +x hmy"
hmy depends on some dynamic libraries, hence we recommend using the shell wrapper. Enter there commands into your terminal:
curl -O https://raw.githubusercontent.com/harmony-one/go-sdk/master/scripts/hmy.shchmod u+x hmy.sh./hmy.sh -d
Now you can use
hmy.sh as a wrapper over
hmy and you should assume that all references to
hmy in these documents refer to
hmy.sh. For example, the command
./hmy.sh -- .
Note that since
hmy is not statically linked, you cannot arbitrarily move
hmy.sh to anywhere on your filesystem like you could with a single binary.
When using Ledger with HMY CLI, the only difference here is that you have to add parameter
--ledgeron every command.
With that in mind, you can run any other command via HMY CLI using your Ledger.
Make sure HMY CLI is being run with super user permissions when interacting with Ledger.
Below, are a few practical examples on how to interact with your Ledger device.
For example, if you want to show your Ledger address you would simply run:
./hmy keys list --ledger
./hmy balances --node=https://api.s0.t.hmny.io <ONE-address> --ledger
./hmy --node="https://api.s0.t.hmny.io" staking delegate --delegator-addr <ONE_address> --validator-addr one1kf42rl6yg2avkjsu34ch2jn8yjs64ycn4n9wdj --amount 1000 --passphrase --ledger
For a complete reference of all commands available, please check the HMY CLI cookbook.