Skip to content

Commit b6bf5de

Browse files
committed
deploy tokens and minor changes
1 parent 15de4dd commit b6bf5de

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

run.sh

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ BLOCKSCOUT_DIR=$DIR/blockscout
2222
TARGET_CIRCUIT_DIR=$CIRCUITS_DIR/testdata/Block_$NTXS"_"$BALANCELEVELS"_"$ORDERLEVELS"_"$ACCOUNTLEVELS
2323
PROVER_DIR=$DIR/prover-cluster
2424
EXCHANGE_DIR=$DIR/dingir-exchange
25-
FAUCET_DIR=$DIR/regnbue-bridge
25+
REGNBUE_DIR=$DIR/regnbue-bridge
26+
FAUCET_DIR=$DIR/faucet
2627
CONTRACTS_DIR=$DIR/contracts
2728
ORCHESTRA_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() {
8688
function 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

9296
function 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

143147
function 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+
150158
function 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

157165
function 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-
165169
function 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...
172176
function 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

179183
function 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

196200
function setup() {
197-
handle_submodule
201+
#handle_submodule
198202
prepare_circuit
199203
prepare_contracts
200204
}

0 commit comments

Comments
 (0)