File tree Expand file tree Collapse file tree 4 files changed +260
-334
lines changed Expand file tree Collapse file tree 4 files changed +260
-334
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ func DeployContract(endpoint string) error {
18
18
os .Setenv ("PRIVATE_KEY" , "0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6" )
19
19
os .Setenv ("URL" , endpoint )
20
20
21
- cmd := exec .Command ("bash" , "-c" , "./deploy.sh" )
21
+ cmd := exec .Command ("bash" , "-c" , "./deploy.sh --network dev " )
22
22
cmd .Dir = smartcontractsPath
23
23
24
24
stdout , err := cmd .StdoutPipe ()
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export PROJECT_ADDRESS=0xf07336E1c77319B4e740b666eb0C2B19D11fc14F
7
7
export PROJECT_REGISTRATION_FEE=1.0
8
8
export PROVER_REGISTRATION_FEE=1.0
9
9
export MIN_STAKE=1.0
10
- ./deploy.sh
10
+ ./deploy.sh --network mainnet | testnet | dev
11
11
```
12
12
13
13
### Deployment
Original file line number Diff line number Diff line change @@ -24,9 +24,28 @@ if [[ -z "${PRIVATE_KEY}" ]]; then
24
24
exit 1
25
25
fi
26
26
27
+ # Default network
28
+ NETWORK=" mainnet"
29
+
30
+ # Parse command line arguments
31
+ while [[ $# -gt 0 ]]; do
32
+ key=" $1 "
33
+ case $key in
34
+ --network)
35
+ NETWORK=" $2 "
36
+ shift # past argument
37
+ shift # past value
38
+ ;;
39
+ * )
40
+ echo " Missing --network option: $1 "
41
+ exit 1
42
+ ;;
43
+ esac
44
+ done
45
+
27
46
# Run the Hardhat deployment script
28
47
echo " Running Hardhat deployment..."
29
- yarn hardhat run scripts/deploy.ts --network dev
48
+ yarn hardhat run scripts/deploy.ts --network $NETWORK
30
49
31
50
# Check if the previous command was successful
32
51
if [ $? -eq 0 ]; then
You can’t perform that action at this time.
0 commit comments