Skip to content

Commit

Permalink
chore: refactor script for testnet node build
Browse files Browse the repository at this point in the history
  • Loading branch information
fiamma-builder committed Oct 30, 2024
1 parent 5d7cd34 commit c0e14f1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/cli/submit_proof_challenge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
: ${VK_FILE:=../../prover_examples/bitvm_challenge/vk.bitvm}
: ${NAMESPACE:="TEST"}
: ${PROOF_SYSTEM:="GROTH16_BN254_BITVM"}
: ${DATA_LOCATION:="CELESTIA"}
: ${DATA_LOCATION:="FIAMMA"}

fiammad tx zkpverify submit-proof \
--from $ACCOUNT --chain-id $CHAIN_ID \
Expand Down
10 changes: 9 additions & 1 deletion scripts/multi_node_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ for node in "$@"; do
echo "Node ID for $node: $node_id"
done

echo "Setting max validators to 21..."
jq '.app_state.staking.params.max_validators = 21' $(pwd)/testnet-nodes/$1/config/genesis.json > $(pwd)/testnet-nodes/$1/config/genesis.json.tmp
mv $(pwd)/testnet-nodes/$1/config/genesis.json.tmp $(pwd)/testnet-nodes/$1/config/genesis.json

for (( i=1; i <= "$#"; i++ )); do
echo "Creating key for ${!i} user..."
printf "$PASSWORD\n$PASSWORD\n" | docker run --rm -i -v $(pwd)/testnet-nodes/${!i}:/root/.fiamma ghcr.io/fiamma-chain/fiamma keys --keyring-backend file --keyring-dir /root/.fiamma/keys add val_${!i} > /dev/null 2> $(pwd)/testnet-nodes/${!i}/mnemonic.txt
Expand All @@ -60,7 +64,11 @@ for (( i=1; i <= "$#"; i++ )); do
committee_address=$(echo $PASSWORD | docker run --rm -i -v $(pwd)/testnet-nodes/${!i}:/root/.fiamma ghcr.io/fiamma-chain/fiamma keys --keyring-backend file --keyring-dir /root/.fiamma/keys show val_${!i} --address)
echo "Committee address: $committee_address"
jq '.app_state.bitvmstaker.committee_address = "'$committee_address'"' $(pwd)/testnet-nodes/$1/config/genesis.json > $(pwd)/testnet-nodes/$1/config/genesis.json.tmp
mv $(pwd)/testnet-nodes/$1/config/genesis.json.tmp $(pwd)/testnet-nodes/$1/config/genesis.json
mv $(pwd)/testnet-nodes/$1/config/genesis.json.tmp $(pwd)/testnet-nodes/$1/config/genesis.json

echo "Setting zkpverify da_submitter in genesis..."
jq '.app_state.zkpverify.da_submitter = "'$committee_address'"' $(pwd)/testnet-nodes/$1/config/genesis.json > $(pwd)/testnet-nodes/$1/config/genesis.json.tmp
mv $(pwd)/testnet-nodes/$1/config/genesis.json.tmp $(pwd)/testnet-nodes/$1/config/genesis.json
fi

echo "Adding val_operator_${!i} to genesis staker_addresses..."
Expand Down
3 changes: 3 additions & 0 deletions scripts/run_localnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ committee_address=$val_address
jq '.app_state.bitvmstaker.committee_address = "'$committee_address'"' ~/.fiamma/config/genesis.json > ~/.fiamma/config/genesis.json.tmp
mv ~/.fiamma/config/genesis.json.tmp ~/.fiamma/config/genesis.json

echo "Setting zkpverify da_submitter in genesis..."
jq '.app_state.zkpverify.da_submitter = "'$committee_address'"' ~/.fiamma/config/genesis.json > ~/.fiamma/config/genesis.json.tmp
mv ~/.fiamma/config/genesis.json.tmp ~/.fiamma/config/genesis.json

# Set staker addresses
val_operator=$(fiammad keys show $node --keyring-backend test -a --bech val)
Expand Down

0 comments on commit c0e14f1

Please sign in to comment.