From 23a463928039d4704367263853d3f5d1606d633b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joseph-Andr=C3=A9=20Turk?= Date: Wed, 9 Oct 2024 19:07:56 +0200 Subject: [PATCH] feat: splits launch-fhevm.sh in 2 scripts --- launch-fhevm.sh => launch-fhevm-sepolia.sh | 14 ++------------ precompute-addresses.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) rename launch-fhevm.sh => launch-fhevm-sepolia.sh (52%) create mode 100755 precompute-addresses.sh diff --git a/launch-fhevm.sh b/launch-fhevm-sepolia.sh similarity index 52% rename from launch-fhevm.sh rename to launch-fhevm-sepolia.sh index 1193a18c..f78bd042 100755 --- a/launch-fhevm.sh +++ b/launch-fhevm-sepolia.sh @@ -1,19 +1,9 @@ #!/bin/bash +# This script should be launched after precomputing the addresses via `precompute-addresses.sh`, and preferably after setting up the different services - KMS, Geth node, Gateway npx hardhat clean -PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2) PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2) NUM_KMS_SIGNERS=$(grep NUM_KMS_SIGNERS .env | cut -d '"' -f 2) -IS_COPROCESSOR=$(grep IS_COPROCESSOR .env | cut -d '"' -f 2) - -npx hardhat task:computeGatewayAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER" -npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" -npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" -npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" -npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true -npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" - -# [ADD DOCKER-COMPOSE COMMAND HERE] // Geth node, Gateway service, KMS service etc should be launched here, using previously precomputed addresses npx hardhat compile:specific --contract lib npx hardhat compile:specific --contract gateway @@ -24,7 +14,7 @@ npx hardhat task:deployKMSVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" - npx hardhat task:deployInputVerifier --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia npx hardhat task:deployFHEPayment --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --network sepolia -npx hardhat task:addSigners --num-signers $NUM_KMS_SIGNERS --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true --network sepolia +npx hardhat task:addSigners --num-signers "$NUM_KMS_SIGNERS" --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true --network sepolia npx hardhat task:launchFhevm --skip-get-coin true --use-address true --network sepolia diff --git a/precompute-addresses.sh b/precompute-addresses.sh new file mode 100755 index 00000000..d4754064 --- /dev/null +++ b/precompute-addresses.sh @@ -0,0 +1,12 @@ +#!/bin/bash +npx hardhat clean + +PRIVATE_KEY_GATEWAY_DEPLOYER=$(grep PRIVATE_KEY_GATEWAY_DEPLOYER .env | cut -d '"' -f 2) +PRIVATE_KEY_FHEVM_DEPLOYER=$(grep PRIVATE_KEY_FHEVM_DEPLOYER .env | cut -d '"' -f 2) + +npx hardhat task:computeGatewayAddress --private-key "$PRIVATE_KEY_GATEWAY_DEPLOYER" +npx hardhat task:computeACLAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" +npx hardhat task:computeTFHEExecutorAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" +npx hardhat task:computeKMSVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" +npx hardhat task:computeInputVerifierAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" --use-address true +npx hardhat task:computeFHEPaymentAddress --private-key "$PRIVATE_KEY_FHEVM_DEPLOYER" \ No newline at end of file