Skip to content

Commit

Permalink
add clerkb build command
Browse files Browse the repository at this point in the history
  • Loading branch information
RetricSu committed May 28, 2021
1 parent 6feebff commit 2a15b8e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 23 deletions.
45 changes: 24 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ install:
make rebuild-gw-scripts-and-bin ; \
else make copy-gw-scripts-and-bin-from-docker ; \
fi
# if manual build clerkb for POA
if [ "$(MANUAL_BUILD_CLERKB)" = true ] ; then \
make rebuild-poa-scripts ; \
elif [ "$(DOCKER_PREBUILD_IMAGE_TAG)" > "v0.2.4" ]; then \
make copy-poa-scripts-from-docker ; \
else "prebuild image version is lower than v0.2.5, there is no poa scripts in docker. use poa scripts in config folder. do nothing." ; \
fi

init:
make install
Expand Down Expand Up @@ -212,27 +219,13 @@ prepare-money:
cd godwoken-examples && yarn clean && yarn prepare-money:normal

########### manual-build-mode #############
### gw and polyjuice all in one
### rebuild components's scripts and bin all in one
rebuild-scripts:
make prepare-prebuild-scripts
make paste-prebuild-scripts

prepare-prebuild-scripts:
cd godwoken-scripts && cd c && make && cd - && capsule build --release --debug-output
cd godwoken-polyjuice && make all-via-docker

paste-prebuild-scripts:
# godwoken-scripts
cp godwoken-scripts/c/build/meta-contract-generator config/meta-contract-generator
cp godwoken-scripts/c/build/meta-contract-validator config/meta-contract-validator
cp godwoken-scripts/c/build/sudt-generator config/sudt-generator
cp godwoken-scripts/c/build/sudt-validator config/sudt-validator
cp godwoken-scripts/build/release/* config/scripts/release/
# godwoken-polyjuice
cp godwoken-polyjuice/build/generator_log config/polyjuice-generator
cp godwoken-polyjuice/build/validator_log config/polyjuice-validator
make rebuild-polyjuice-bin
make rebuild-gw-scripts-and-bin
make rebuild-poa-scripts

#### gw and polyjucie standalone
#### rebuild components's scripts and bin standalone
rebuild-polyjuice-bin:
cd godwoken-polyjuice && make all-via-docker
cp godwoken-polyjuice/build/generator_log config/polyjuice-generator
Expand All @@ -246,6 +239,11 @@ rebuild-gw-scripts-and-bin:
cp godwoken-scripts/c/build/sudt-validator config/sudt-validator
cp godwoken-scripts/build/release/* config/scripts/release/

rebuild-poa-scripts:
cd clerkb && yarn && make all-via-docker
cp clerkb/build/debug/poa config/scripts/release/
cp clerkb/build/debug/state config/scripts/release/

########## prebuild-quick-mode #############
copy-polyjuice-bin-from-docker:
mkdir -p `pwd`/quick-mode/polyjuice
Expand Down Expand Up @@ -276,5 +274,10 @@ copy-gw-scripts-and-bin-from-docker:
cp quick-mode/godwoken/deposition-lock config/scripts/release/
cp quick-mode/godwoken/always-success config/scripts/release/



copy-poa-scripts-from-docker:
mkdir -p `pwd`/quick-mode/clerkb
docker run -it -d --name dummy $$DOCKER_PREBUILD_IMAGE_NAME:$$DOCKER_PREBUILD_IMAGE_TAG
docker cp dummy:/scripts/clerkb/. `pwd`/quick-mode/clerkb
docker rm -f dummy
# paste the prebuild scripts to config dir for use
cp quick-mode/clerkb/* config/scripts/release/
1 change: 1 addition & 0 deletions docker/.build.mode.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MANUAL_BUILD_GODWOKEN=false
MANUAL_BUILD_WEB3=false
MANUAL_BUILD_SCRIPTS=false
MANUAL_BUILD_POLYJUICE=false
MANUAL_BUILD_CLERKB=false

####[images]
DOCKER_PREBUILD_IMAGE_NAME=nervos/godwoken-prebuilds
Expand Down
4 changes: 2 additions & 2 deletions gw_util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ generateSubmodulesEnvFile(){
git submodule update --init --recursive
fi

local -a arr=("godwoken" "godwoken-web3" "godwoken-polyjuice" "godwoken-examples" "godwoken-scripts")
local -a arr=("godwoken" "godwoken-web3" "godwoken-polyjuice" "godwoken-examples" "godwoken-scripts" "clerkb")
for i in "${arr[@]}"
do
# get origin url
Expand Down Expand Up @@ -182,7 +182,7 @@ update_submodules(){
# use these env varibles to update the desired submodules
source docker/.submodule.list.env

local -a arr=("godwoken" "godwoken-web3" "godwoken-polyjuice" "godwoken-examples" "godwoken-scripts")
local -a arr=("godwoken" "godwoken-web3" "godwoken-polyjuice" "godwoken-examples" "godwoken-scripts" "clerkb")
for i in "${arr[@]}"
do
# set url for submodule
Expand Down
Empty file added v0.2.4
Empty file.

0 comments on commit 2a15b8e

Please sign in to comment.