@@ -22,7 +22,8 @@ BLOCKSCOUT_DIR=$DIR/blockscout
2222TARGET_CIRCUIT_DIR=$CIRCUITS_DIR /testdata/Block_$NTXS " _" $BALANCELEVELS " _" $ORDERLEVELS " _" $ACCOUNTLEVELS
2323PROVER_DIR=$DIR /prover-cluster
2424EXCHANGE_DIR=$DIR /dingir-exchange
25- FAUCET_DIR=$DIR /regnbue-bridge
25+ REGNBUE_DIR=$DIR /regnbue-bridge
26+ FAUCET_DIR=$DIR /faucet
2627CONTRACTS_DIR=$DIR /contracts
2728ORCHESTRA_DIR=$DIR /orchestra
2829
@@ -69,7 +70,8 @@ function prepare_contracts() {
6970 rm -f $CONTRACTS_DIR /contracts/Verifier.sol
7071 plonkit generate-verifier -v $TARGET_CIRCUIT_DIR /vk.bin -s $CONTRACTS_DIR /contracts/Verifier.sol
7172 cd $CONTRACTS_DIR /
72- git update-index --assume-unchanged $CONTRACTS_DIR /contracts/Verifier.sol
73+ # no need for this
74+ # git update-index --assume-unchanged $CONTRACTS_DIR/contracts/Verifier.sol
7375 yarn install
7476 npx hardhat compile
7577}
@@ -86,13 +88,15 @@ function config_prover_cluster() {
8688function start_docker_compose() {
8789 dir=$1
8890 name=$2
89- docker-compose --file $dir /docker/docker-compose.yaml --project-name $name up --force-recreate --detach
91+ cd $dir
92+ docker-compose --file docker/docker-compose.yaml --project-name $name up --build --force-recreate --detach
93+ cd -
9094}
9195
9296function run_docker_compose() {
9397 start_docker_compose $ORCHESTRA_DIR orchestra
94- start_docker_compose $FAUCET_DIR faucet
95- start_docker_compose $BLOCKSCOUT_DIR blockscout # ganache node & blockscout stuff
98+ start_docker_compose $REGNBUE_DIR faucet
99+ start_docker_compose $BLOCKSCOUT_DIR blockscout # geth node & blockscout stuff
96100 sleep 10
97101}
98102
@@ -141,39 +145,39 @@ function run_prove_workers() {
141145}
142146
143147function boostrap_contract() {
144- # a mainnet like 50 Gwei gas price
145- # base on 21,000 units limit from mainnet (21,000 units * 50 Gwei)
146148 cd $CONTRACTS_DIR
147149 yarn install
148150}
149151
152+ function deploy_tokens() {
153+ cd $FAUCET_DIR /layer1/contracts
154+ yarn install
155+ npx hardhat run scripts/deploy.js --network geth
156+ }
157+
150158function deploy_contracts() {
151159 cd $CONTRACTS_DIR
152160 export GENESIS_ROOT=$( cat $STATE_MNGR_DIR /rollup_state_manager.$CURRENTDATE .log | grep " genesis root" | tail -n1 | awk ' {print $9}' | sed ' s/Fr(//' | sed ' s/)//' )
153- export CONTRACT_ADDR=$( retry_cmd_until_ok npx hardhat run scripts/deploy.js --network localhost | grep " FluiDex deployed to:" | awk ' {print $4}' )
161+ export CONTRACT_ADDR=$( retry_cmd_until_ok npx hardhat run scripts/deploy.ts --network geth | grep " FluiDexDelegate deployed to:" | awk ' {print $4}' )
154162 echo " export CONTRACT_ADDR=$CONTRACT_ADDR " > $CONTRACTS_DIR /contract-deployed.env
155163}
156164
157165function restore_contracts() {
158166 source $CONTRACTS_DIR /contract-deployed.env
159167}
160168
161- function post_contracts() {
162- nohup npx hardhat run scripts/tick.js --network localhost >> $CONTRACTS_DIR /ticker.$CURRENTDATE .log 2>&1 &
163- }
164-
165169function run_faucet() {
166- cd $FAUCET_DIR
170+ cd $REGNBUE_DIR
167171 cargo build --release --bin faucet
168- nohup " $FAUCET_DIR /target/release/faucet" >> $FAUCET_DIR /faucet.$CURRENTDATE .log 2>&1 &
172+ nohup " $REGNBUE_DIR /target/release/faucet" >> $REGNBUE_DIR /faucet.$CURRENTDATE .log 2>&1 &
169173}
170174
171175# TODO: need to fix task_fetcher, gitignore, comfig template & example, contracts...
172176function run_block_submitter() {
173- cd $FAUCET_DIR
177+ cd $REGNBUE_DIR
174178 cargo build --release --bin block_submitter
175- DB=$ROLLUP_DB CONTRACTS_DIR=$CONTRACTS_DIR CONTRACT_ADDR=$CONTRACT_ADDR $ENVSUB < $FAUCET_DIR /config/block_submitter.yaml.template > $FAUCET_DIR /config/block_submitter.yaml
176- nohup " $FAUCET_DIR /target/release/block_submitter" >> $FAUCET_DIR /block_submitter.$CURRENTDATE .log 2>&1 &
179+ DB=$ROLLUP_DB CONTRACTS_DIR=$CONTRACTS_DIR CONTRACT_ADDR=$CONTRACT_ADDR $ENVSUB < $REGNBUE_DIR /config/block_submitter.yaml.template > $REGNBUE_DIR /config/block_submitter.yaml
180+ nohup " $REGNBUE_DIR /target/release/block_submitter" >> $REGNBUE_DIR /block_submitter.$CURRENTDATE .log 2>&1 &
177181}
178182
179183function run_bin() {
@@ -182,19 +186,19 @@ function run_bin() {
182186 run_prove_workers
183187 run_rollup
184188 sleep 10
189+ deploy_tokens
185190 boostrap_contract
186191 if [ $DX_CLEAN == ' TRUE' ]; then
187192 deploy_contracts
188193 else
189194 restore_contracts
190195 fi
191- post_contracts
192196 run_faucet
193197 run_block_submitter
194198}
195199
196200function setup() {
197- handle_submodule
201+ # handle_submodule
198202 prepare_circuit
199203 prepare_contracts
200204}
0 commit comments