Skip to content

Commit

Permalink
update init-genesis.sh for devnet and testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Solovyov1796 authored and 0g-wh committed Sep 25, 2024
1 parent 547b005 commit 483a939
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions networks/devnet/init-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ set -e
IFS=","; declare -a IPS=($1); unset IFS

NUM_NODES=${#IPS[@]}
VLIDATOR_BALANCE=15000000a0gi
FAUCET_BALANCE=40000000a0gi
STAKING=10000000a0gi
VLIDATOR_BALANCE=15000000000000000000ua0gi
FAUCET_BALANCE=40000000000000000000ua0gi
STAKING=10000000000000000000ua0gi

# Init configs
for ((i=0; i<$NUM_NODES; i++)) do
Expand All @@ -49,7 +49,7 @@ for ((i=0; i<$NUM_NODES; i++)) do
0gchaind init "node$i" --home "$HOMEDIR" --chain-id "$CHAIN_ID" >/dev/null 2>&1

# Replace stake with neuron
sed -in-place='' 's/stake/a0gi/g' "$GENESIS"
sed -in-place='' 's/stake/ua0gi/g' "$GENESIS"

# Replace the default evm denom of aphoton with neuron
sed -in-place='' 's/aphoton/neuron/g' "$GENESIS"
Expand Down Expand Up @@ -166,6 +166,7 @@ done

# Create genesis at node0 and copy to other nodes
0gchaind collect-gentxs --home "$ROOT_DIR/node0" --gentx-dir "$ROOT_DIR/gentxs" >/dev/null 2>&1
sed -i '/persistent_peers = /c\persistent_peers = ""' "$ROOT_DIR"/node0/config/config.toml
0gchaind validate-genesis --home "$ROOT_DIR/node0"
for ((i=1; i<$NUM_NODES; i++)) do
cp "$ROOT_DIR"/node0/config/genesis.json "$ROOT_DIR"/node$i/config/genesis.json
Expand Down
8 changes: 4 additions & 4 deletions networks/testnet/init-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ set -e
IFS=","; declare -a IPS=($1); unset IFS

NUM_NODES=${#IPS[@]}
VLIDATOR_BALANCE=15000000000000000000000000neuron
FAUCET_BALANCE=40000000000000000000000000neuron
STAKING=10000000000000000000000000neuron
VLIDATOR_BALANCE=15000000000000000000ua0gi
FAUCET_BALANCE=40000000000000000000ua0gi
STAKING=10000000000000000000ua0gi

# Init configs
for ((i=0; i<$NUM_NODES; i++)) do
Expand All @@ -49,7 +49,7 @@ for ((i=0; i<$NUM_NODES; i++)) do
0gchaind init "node$i" --home "$HOMEDIR" --chain-id "$CHAIN_ID" >/dev/null 2>&1

# Replace stake with neuron
sed -in-place='' 's/stake/neuron/g' "$GENESIS"
sed -in-place='' 's/stake/ua0gi/g' "$GENESIS"

# Replace the default evm denom of aphoton with neuron
sed -in-place='' 's/aphoton/neuron/g' "$GENESIS"
Expand Down

0 comments on commit 483a939

Please sign in to comment.