|
3 | 3 | # cd to the directory of this script so that this can be run from anywhere |
4 | 4 | parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) |
5 | 5 | # At this point we are in tests/integration |
6 | | -echo "$parent_path" |
| 6 | +cd "$parent_path" |
7 | 7 |
|
8 | | -# # Deploy Groth16 SP1 verifier gateway |
9 | | -# forge script script/deploy/SP1VerifierGatewayGroth16Deployer.s.sol:SP1VerifierGatewayScript \ |
10 | | -# --rpc-url "http://localhost:8545" \ |
11 | | -# --private-key "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a" \ |
12 | | -# --broadcast |
| 8 | +# Start an empty anvil chain in the background and dump its state to a json file upon exit |
| 9 | +anvil --dump-state state/sp1-deployed-anvil-state.json & |
| 10 | + |
| 11 | +# cd to /contracts |
| 12 | +cd ../../ |
| 13 | + |
| 14 | +sleep 1 |
| 15 | + |
| 16 | +export CHAINS='TESTNET' |
| 17 | +export RPC_TESTNET='http://localhost:8545' |
| 18 | +export OWNER='0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC' |
| 19 | + |
| 20 | +# Deploy Groth16 SP1 verifier gateway |
| 21 | +forge script script/deploy/SP1VerifierGatewayGroth16Deployer.s.sol:SP1VerifierGatewayScript \ |
| 22 | + --rpc-url "http://localhost:8545" \ |
| 23 | + --private-key "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a" \ |
| 24 | + --broadcast |
13 | 25 |
|
14 | 26 | # # Deploy Groth16 SP1 verifier |
15 | | -# forge script ./script/deploy/SP1VerifierGroth16Deployer.s.sol:SP1VerifierScript \ |
16 | | -# --rpc-url "http://localhost:8545" \ |
17 | | -# --private-key "0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6" \ |
18 | | -# --broadcast \ |
19 | | -# --verify --verifier etherscan --multi |
| 27 | +forge script ./script/deploy/SP1VerifierGroth16Deployer.s.sol:SP1VerifierScript \ |
| 28 | + --rpc-url "http://localhost:8545" \ |
| 29 | + --private-key "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a" \ |
| 30 | + --broadcast |
| 31 | + |
| 32 | + |
| 33 | +# Kill the anvil process to save state |
| 34 | +pkill anvil |
| 35 | + |
| 36 | +# Anvil adds a block state, making the code to fail. We don't care about this, just the accounts and the deployed code |
| 37 | +cd "$parent_path" |
| 38 | + |
| 39 | +jq 'del(.block)' state/sp1-deployed-anvil-state.json > state/sp1-deployed-anvil-state-tmp.json |
| 40 | + |
| 41 | +cp -f state/sp1-deployed-anvil-state-tmp.json state/sp1-deployed-anvil-state.json |
| 42 | + |
| 43 | +rm state/sp1-deployed-anvil-state-tmp.json |
0 commit comments