Skip to content

Instantly share code, notes, and snippets.

@Daniel-VDM
Last active April 3, 2022 10:13
Show Gist options
  • Save Daniel-VDM/788647bb71284aa6ac0f78b8059fd139 to your computer and use it in GitHub Desktop.
Save Daniel-VDM/788647bb71284aa6ac0f78b8059fd139 to your computer and use it in GitHub Desktop.

Running a node on Harmony Dryrun Network

Spin up AWS instance

More details on how to spin up AWS instance here

  1. select amazon linux 2 AMI
  2. select t3.small as instance type
  3. select 15 GiB of storage.
  4. ssh into your AWS instance

Setup

More details on first time setup can be found here

  1. Download Harmony CLI with:
cd ~/
curl -LO https://harmony.one/hmycli && mv hmycli hmy && chmod +x hmy
  1. Generate a bls key for a specific shard with
cd ~/
./hmy keys generate-bls-keys --shard <shard number> --count 1 -n https://api.s0.dry.hmny.io/

note the public bls key, for example: c5fb43d473b622e958b256f128c5e50b894fc8a572d8d74957dde6fa8723df302ecab3cb132d524a636f0162737e5205

  1. Import wallet via CLI with:
cd ~/
./hmy keys import-private-key <private key>

Note the ONE address

OR

Create new wallet via CLI with:

cd ~/
./hmy keys add validator 

Note the ONE address

  1. Install rclone with
curl https://rclone.org/install.sh | sudo bash
  1. Add the mainnet config to rclone config:
echo "
[mainnet]
type = s3
provider = AWS
env_auth = false
region = us-west-1
acl = public-read
server_side_encryption = AES256
storage_class = REDUCED_REDUNDANCY
" >> /home/ec2-user/.config/rclone/rclone.conf

You might have to change /home/ec2-user/.config/rclone/rclone.conf to whatever rclone config file outputs.

  1. rclone s0 shard's DB (needed regardless of shard you are validating for) with
cd ~/
rclone sync mainnet:pub.harmony.one/mainnet.min/snapshot.20200501/harmony_db_0 harmony_db_0
  1. rclone the shard you are validating for (i.e: the shard you used in step 2 of the setup)

For shard 1

cd ~/
rclone sync mainnet:pub.harmony.one/mainnet.min/snapshot.20200504/harmony_db_1 harmony_db_1

For shard 2

cd ~/
rclone sync mainnet:pub.harmony.one/mainnet.min/snapshot.20200505/harmony_db_2 harmony_db_2

For shard 3

cd ~/
rclone sync mainnet:pub.harmony.one/mainnet.min/snapshot.20200505/harmony_db_3 harmony_db_3
  1. download and setup the dryrun node.sh with
cd ~/
curl -O https://raw.githubusercontent.com/harmony-one/harmony/t3.dryrun/scripts/node.sh && chmod +x node.sh && sudo ./node.sh -s

It is okay to see grep: /etc/pam.d/common-session: No such file or directory at the end of the command above

  1. download and install tmux with
sudo yum install tmux -y

Run your node

  1. Start a tmux session with
tmux new -s node
  1. Start your harmony node with:
cd ~/
./node.sh -N dryrun -S -z -I -k <public-bls-key>.key

<public-bls-key> will be from step 2 of setup. For example: ./node.sh -N dryrun -S -z -I -k c5fb43d473b622e958b256f128c5e50b894fc8a572d8d74957dde6fa8723df302ecab3cb132d524a636f0162737e5205.key

  1. Detach from your tmux by pressing ctrl + b then press d

Create your validator

Use the following command to create your validator, replace the fields with whatever you want

cd ~/
./hmy --node="https://api.s0.dry.hmny.io" staking create-validator \
    --validator-addr <ONE ADDRESS> --amount 10001 \
    --bls-pubkeys <BLS PUBLIC KEY> \
    --name "<NAME>" --identity "<IDENTITY>" --details "<DETAILS>" \
    --security-contact "<CONTACT>" --website "<YOUR-WEBSITE.COM>" \
    --max-change-rate 0.1 --max-rate 0.1 --rate 0.1 \
    --max-total-delegation 100000000 --min-self-delegation 10000 \
    --chain-id mainnet --passphrase

By default your passphrase is an empty, so you can just press enter when prompted for it

Check node status with:

cd ~/
./hmy blockchain latest-headers

Check validator status with:

cd ~/
./hmy blockchain validator information <ONE address>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment