- (Optional) Open terminal and
cd
to wherever you want to install your CLI. Personally I like~/bin
.
mkdir -p ~/bin && cd ~/bin
- Get the latest Harmony CLI version
curl -O https://raw.githubusercontent.com/harmony-one/go-sdk/master/scripts/hmy.sh && chmod +x ./hmy.sh && ./hmy.sh -d
- Install the CSV parser script in the same directory
curl -O https://raw.githubusercontent.com/harmony-one/go-sdk/master/scripts/hmy-csv.py && chmod +x ./hmy-csv.py
Note that this will require python 3.6 or newer. You can check this with the following command
python3 --version
.
- Create your CSV file (with numbers, excel, sheets, etc..), make sure to follow this template.
Note that the follow column names must exist:
from
,to
,amount
,from-shard
,to-shard
,passphrase-file
(optional),passphrase-string
(optional),gas-price
(optional).
- Save/download the CSV file to your computer. If you are using MacOs and google sheets, your csv file will probably be in
~/Downloads
. Note this for later.
MAKE SURE ALL from
KEYS ARE IN THE CLI'S KEYSTORE. IMPORT KEYS FIRST IF NEEDED.
Reference docs here on how to import keystores into the CLI.
- Go do where you installed your CLI. If using my example in the install section, do
cd ~/bin
. - Run the script with the following command (for mainnet):
./hmy-csv.py ~/Downloads/some-file.csv --node https://api.s0.t.hmny.io/
Substitute
~/Downloads/some-file.csv
with the path to your CSV file on your computer.You can also substitute
https://api.s0.t.hmny.io/
for whatever endpoint you want.
- Respond to the prompts and make sure to check the parsed transactions before sending it!
- Go do where you installed your CLI. If using my example in the install section, do
cd ~/bin
. - Run the script with the following command (for mainnet):
./hmy-csv.py ~/Downloads/some-file.csv --fast --node https://api.s0.t.hmny.io/
Substitute
~/Downloads/some-file.csv
with the path to your CSV file on your computer.You can also substitute
https://api.s0.t.hmny.io/
for whatever endpoint you want.
- Respond to the prompts and make sure to check the parsed transactions before sending it!
- Note where you saved the
hmy-csv.py
file. For me its:
~/go/src/github.com/harmony-one/go-sdk/scripts/hmy-csv.py
- Run the script with the following command:
~/go/src/github.com/harmony-one/go-sdk/scripts/hmy-csv.py ~/Downloads/some-file.csv --use-default-passphrase --yes --fast --batch-size 25 --chain-id testnet -n http://3.231.157.246:9500/
Note that this just about shows every option one could need when using this script. Normally not all fields are needed.
You can view all of the possible options and what they do with:
./hmy-csv.py --help