Skip to content

Commit

Permalink
refactor: update script/cli for testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
fiamma-builder committed Nov 10, 2024
1 parent 953b5e6 commit 0de4295
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion scripts/cli/query_bitvm_challenge_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e


: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${PROOF_FILE:=../../prover_examples/bitvm_challenge/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm_challenge/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm_challenge/vk.bitvm}
Expand Down
2 changes: 1 addition & 1 deletion scripts/cli/query_dasubmission_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${PROOF_FILE:=../../prover_examples/bitvm/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
Expand Down
2 changes: 1 addition & 1 deletion scripts/cli/query_dasubmission_quque.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e


: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}

fiammad query zkpverify get-da-submission-queue --node $NODE
2 changes: 1 addition & 1 deletion scripts/cli/query_dasubmission_result.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${PROOF_FILE:=../../prover_examples/bitvm/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
Expand Down
2 changes: 1 addition & 1 deletion scripts/cli/query_pending_proofs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e


: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}

fiammad query zkpverify pending-proof --node $NODE
2 changes: 1 addition & 1 deletion scripts/cli/query_pending_proofs_by_namespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ else
NAMESPACE=$1
fi

: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}

fiammad query zkpverify pending-proof-by-namespace $NAMESPACE --node $NODE
2 changes: 1 addition & 1 deletion scripts/cli/query_proof_data_fiamma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e


: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${PROOF_FILE:=../../prover_examples/bitvm/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
Expand Down
3 changes: 1 addition & 2 deletions scripts/cli/query_verify_result.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e


: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${PROOF_FILE:=../../prover_examples/bitvm/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
Expand All @@ -29,6 +29,5 @@ allDataHex="${NEW_NAMESPACE}${NEW_PROOF_SYSTEM}${NEW_PROOF}${NEW_PUBLIC_INPUT}${

proof_id=$(echo -n "$allDataHex" | xxd -r -p | sha256sum | awk '{print $1}')

echo $proof_id

fiammad query zkpverify get-verify-result $proof_id --node $NODE
2 changes: 1 addition & 1 deletion scripts/cli/query_verify_results_by_namespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ else
fi


: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}


fiammad query zkpverify get-verify-results-by-namespace $NAMESPACE --node $NODE
11 changes: 7 additions & 4 deletions scripts/cli/register_vk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,25 @@ else
fi

: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}

: ${GAS:=80000000}
: ${GAS:=70000}
: ${FEE:=140ufia}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
: ${VK_FILE_CHALLENGE:=../../prover_examples/bitvm_challenge/vk.bitvm}

fiammad tx bitvmstaker register-vk \
--from $ACCOUNT --chain-id $CHAIN_ID \
--from $ACCOUNT --keyring-backend test --chain-id $CHAIN_ID \
--gas $GAS \
--fees $FEE \
--node $NODE \
$VK_FILE

sleep 2

fiammad tx bitvmstaker register-vk \
--from $ACCOUNT --chain-id $CHAIN_ID \
--from $ACCOUNT --keyring-backend test --chain-id $CHAIN_ID \
--gas $GAS \
--fees $FEE \
--node $NODE \
$VK_FILE_CHALLENGE
11 changes: 8 additions & 3 deletions scripts/cli/stresser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ SEQUENCE=$(jq -r '.account.sequence' account_info.json)
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
: ${PROOF_SYSTEM:="GROTH16_BN254_BITVM"}
: ${DATA_LOCATION:="FIAMMA"}
: ${NAMESPACE:="TEST"}

rm account_info.json
echo "Account: $ACCOUNT"
Expand All @@ -50,15 +52,18 @@ do
--chain-id $CHAIN_ID \
--fees 20ufia \
--offline \
--gas 20000000 \
--gas 60000000 \
--fees 120000ufia \
--sequence $SEQUENCE \
--account-number $ACCOUNT_NUMBER \
--node $NODE_RPC \
--yes \
"Fiamma" \
$NAMESPACE \
$PROOF_SYSTEM \
$PROOF_FILE \
$PUBLIC_INPUT_FILE \
$VK_FILE
$VK_FILE \
$DATA_LOCATION

let SEQUENCE++
done
6 changes: 4 additions & 2 deletions scripts/cli/submit_community_verification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ else
fi

: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${PROOF_FILE:=../../prover_examples/bitvm/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
: ${GAS:=80000000}
: ${GAS:=60000}
: ${FEE:=120ufia}
: ${NAMESPACE:="TEST"}
: ${PROOF_SYSTEM:="GROTH16_BN254_BITVM"}
: ${DATA_LOCATION:="FIAMMA"}
Expand All @@ -41,6 +42,7 @@ fiammad tx zkpverify submit-community-verification \
--from $ACCOUNT --chain-id $CHAIN_ID \
--gas $GAS \
--node $NODE \
--fees $FEE \
--keyring-backend test \
$proof_id \
true \
6 changes: 4 additions & 2 deletions scripts/cli/submit_proof.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ else
fi

: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${GAS:=80000000}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${GAS:=60000000}
: ${FEE:=120000ufia}
: ${PROOF_FILE:=../../prover_examples/bitvm/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm/vk.bitvm}
Expand All @@ -26,6 +27,7 @@ fiammad tx zkpverify submit-proof \
--gas $GAS \
--node $NODE \
--keyring-backend test \
--fees $FEE \
$NAMESPACE \
$PROOF_SYSTEM \
$PROOF_FILE \
Expand Down
6 changes: 4 additions & 2 deletions scripts/cli/submit_proof_challenge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ else
fi

: ${CHAIN_ID:="fiamma-testnet-1"}
: ${NODE:="http://127.0.0.1:26657"}
: ${GAS:=80000000}
: ${NODE:="https://testnet-rpc.fiammachain.io"}
: ${GAS:=60000000}
: ${FEE:=120000ufia}
: ${PROOF_FILE:=../../prover_examples/bitvm_challenge/proof.bitvm}
: ${PUBLIC_INPUT_FILE:=../../prover_examples/bitvm_challenge/public_input.bitvm}
: ${VK_FILE:=../../prover_examples/bitvm_challenge/vk.bitvm}
Expand All @@ -25,6 +26,7 @@ fiammad tx zkpverify submit-proof \
--gas $GAS \
--node $NODE \
--keyring-backend test \
--fees $FEE \
$NAMESPACE \
$PROOF_SYSTEM \
$PROOF_FILE \
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CHAIN_BINARY=fiammad
: ${CHAIN_ID:="fiamma-testnet-1"}
: ${MINIMUM_GAS_PRICES="0ufia"}

: ${PEER_ADDR="127.0.0.1"}
: ${PEER_ADDR="18.182.20.173, 35.73.202.182"}

PEER_ARRAY=(${PEER_ADDR//,/ })

Expand Down
2 changes: 1 addition & 1 deletion scripts/setup_validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NODE_HOME=$HOME/.fiamma
CHAIN_BINARY=fiammad
: ${CHAIN_ID:="fiamma-testnet-1"}

: ${PEER_ADDR="127.0.0.1"}
: ${PEER_ADDR="18.182.20.173, 35.73.202.182"}

VALIDATOR_KEY=$($CHAIN_BINARY tendermint show-validator)
MONIKER=$($CHAIN_BINARY config get config moniker)
Expand Down

0 comments on commit 0de4295

Please sign in to comment.