For working with all cli commands, the Harmony team has created a new tool, the Harmony CLI-tool. With this tool you will be able to do everything on your node, like:
Creating a wallet
Create your Validator
Create your delegator
And many more...
curl -LO https://harmony.one/hmycli && mv hmycli hmy && chmod +x hmy
or alternatively use this, if the above version will not work for creating a wallet below (for MacOSX users) and also note that instead of using ./hmy you have to use ./hmy.sh:
curl -O https://raw.githubusercontent.com/harmony-one/go-sdk/master/scripts/hmy.shchmod u+x hmy.sh./hmy.sh -d
Creation of a new account is done as a function of a generated
bip39 mnemonic with 256 bits of entropy. You need to provide an account alias name of your choice (keep it simple and clean) and also need provide a passphrase:
./hmy keys add example-account --use-own-passphraseEnter passphrase:Repeat the passphrase:
When creating keys this way,
hmy will ask you to provide a passphrase. The example-account is just a name you can pick, so pick something simple.
Make sure you keep track of this passphrase for future use because the passphrase is used to decrypt the keystore when signing transactions. Also make sure you save the seed phrase.
To know where you wallet file has been created, just run the following command:
./hmy keys location
The command above will return the location of your wallet file. Backup this wallet file somewhere else.
You can check the list of wallets (local accounts) with the following command:
./hmy keys listNAME ADDRESSacc3 one1wh4p0kuc7unxez2z8f82zfnhsg4ty6dupqyjt2example-account one1658znfwf40epvy7e46cqrmzyy54
NOTE: once you have created the wallet, please make sure to submit the wallet address to this form.
You will now need to generate your bls keys, to get your BLS Keys enter the command:
./hmy keys generate-bls-key
Give your passprase when asked
Confirm the passprase (please save your password)
With this done, you will get the "public-key", "private-key" and the "encrypted-private-key-path"
Before the node can run and join consensus to earn block rewards, it will need a recent copy of blockchain database. In order to download and extract the blockchain database, run the following commands (replace
BLSPUBKEY with your 96-digit hexadecimal BLS public key as displayed by the
generate-bls-key command above):
curl -sSfLO https://hmny-pnga.s3-us-west-2.amazonaws.com/db/download-pangaea-db.shsh download-pangaea-db.sh BLSPUBKEY
This command takes up to an hour to complete. After that, the following messages are displayed (the shard(s) downloaded depends on your BLS public key):
Starting download of shard 2 database...Starting download of shard 0 database...Waiting for database download to finish...Database download finished.Ensure that there are no error messages above. If any, re-run this script.
You can check wallet balances with the following command if you are running a node and are synced:
./hmy balances one1f33w8c3dupm30p4fhemy89646xw7xpxcnmy6e4
or the following command if you're not running a node or not in sync:
./hmy --node="https://api.s0.p.hmny.io" balances one1f33w8c3dupm30p4fhemy89646xw7xpxcnmy6e4