-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
102 lines (79 loc) · 2.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
PWD = $(abspath ./)
JAVASCORE_PATH = $(PWD)/../javascore
CHAIN_CONFIG = $(PWD)/chain_config.json
TARGET_CHAINS = \
$(shell cat $(CHAIN_CONFIG) | jq -r .link.src) \
$(shell cat $(CHAIN_CONFIG) | jq -r .link.dst)
GRADLE = ./gradlew
HARDHAT = npx hardhat
TS_NODE = npx ts-node
NETWORK = --network localhost
SOLIDITY_CONTRACTS = ./solidity/contracts
.DEFAULT_GOAL := all
all:
@echo $(PWD)
.PHONY: build clean deploy
clean-java:
(cd $(JAVASCORE_PATH); $(GRADLE) clean)
clean-solidity:
$(HARDHAT) clean
$(RM) -rf \
$(SOLIDITY_CONTRACTS)/bmc \
$(SOLIDITY_CONTRACTS)/bmv* \
$(SOLIDITY_CONTRACTS)/xcall
clean: clean-java clean-solidity
copy-src:
@ echo ">>> Copy BMC/BMV/xCall solidity codes" ; \
$(TS_NODE) scripts/setup/copy_src.ts
compile: copy-src
@ echo ">>> Compile solidity codes" ; \
$(HARDHAT) compile
build-bmc-java:
@ echo ">>> Build BMC javascore" ; \
cd $(JAVASCORE_PATH) ; \
$(GRADLE) bmc:optimizedJar
build-bmv-java:
@ echo ">>> Build BMV javascore" ; \
cd $(JAVASCORE_PATH) ; \
$(GRADLE) bmv:bridge:optimizedJar \
bmv:btpblock:optimizedJar
build-xcall-java:
@ echo ">>> Build xCall javascore" ; \
cd $(JAVASCORE_PATH) ; \
$(GRADLE) xcall:optimizedJar
build-dapp-java:
@ echo ">>> Build DApp sample javascore" ; \
cd $(JAVASCORE_PATH) ; \
$(GRADLE) dapp-sample:optimizedJar
build-all: compile build-bmc-java build-bmv-java build-xcall-java build-dapp-java
deploy-bmc:
@ echo ">>> Deploy BMC contracts" ; \
JAVASCORE_PATH=$(JAVASCORE_PATH) \
$(HARDHAT) $(NETWORK) run scripts/setup/deploy_bmc.ts
deploy-bmv:
@ echo ">>> Deploy BMV contracts" ; \
JAVASCORE_PATH=$(JAVASCORE_PATH) \
$(HARDHAT) $(NETWORK) run scripts/setup/deploy_bmv.ts
deploy-xcall:
@ echo ">>> Deploy xCall contracts" ; \
JAVASCORE_PATH=$(JAVASCORE_PATH) \
$(HARDHAT) $(NETWORK) run scripts/setup/deploy_xcall.ts
deploy-dapp:
@ echo ">>> Deploy DApp contracts" ; \
JAVASCORE_PATH=$(JAVASCORE_PATH) \
$(HARDHAT) $(NETWORK) run scripts/setup/deploy_dapp.ts
deploy-all: deploy-bmc deploy-bmv deploy-xcall deploy-dapp
start-nodes:
@ echo ">>> Start nodes" ; \
cd docker; \
docker compose up -d $(TARGET_CHAINS)
stop-nodes:
@ echo ">>> Stop nodes" ; \
cd docker; \
docker compose down
setup-node:
@ echo ">>> Setup ICON node" ; \
$(TS_NODE) scripts/setup/setup_node.ts $(TARGET_CHAINS)
run-demo:
@ echo ">>> Run demo_dapp.ts " ; \
$(HARDHAT) $(NETWORK) run scripts/demo_dapp.ts