-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
97 lines (87 loc) · 3.04 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
# SPDX-FileCopyrightText: 2023 Baking Bad <[email protected]>
#
# SPDX-License-Identifier: MIT
.PHONY: test
#-include envs/etherlink-nairobi.env
-include envs/etherlink-paris.env
BIN_DIR:=$$PWD/bin
TARGET_DIR=$$PWD/target
CARGO_BIN_PATH:=$$HOME/.cargo/bin
PACKAGE=evm_kernel
CI_COMMIT_SHA=dev
INSTALLER_CONF_PATH=$$PWD/config/dev.yaml
install:
cargo install tezos-smart-rollup-installer --locked
cd $(CARGO_BIN_PATH) \
&& wget -c https://github.com/WebAssembly/binaryen/releases/download/version_111/binaryen-version_111-x86_64-linux.tar.gz -O - | tar -xzv binaryen-version_111/bin/wasm-opt --strip-components 2 \
&& wget -c https://github.com/WebAssembly/wabt/releases/download/1.0.31/wabt-1.0.31-ubuntu.tar.gz -O - | tar -xzv wabt-1.0.31/bin/wasm-strip wabt-1.0.31/bin/wasm2wat --strip-components 2
build-kernel:
RUSTC_BOOTSTRAP=1 cargo build --manifest-path=tezos/etherlink/kernel_evm/Cargo.toml --package $(PACKAGE) \
--target wasm32-unknown-unknown \
--target-dir $(TARGET_DIR) \
--features debug,default \
--release \
-Z sparse-registry \
-Z avoid-dev-deps
wasm-strip -o $(BIN_DIR)/$(PACKAGE).wasm $(TARGET_DIR)/wasm32-unknown-unknown/release/$(PACKAGE).wasm
build-installer:
smart-rollup-installer get-reveal-installer \
--upgrade-to $(BIN_DIR)/$(PACKAGE).wasm \
--output $(BIN_DIR)/$(PACKAGE)_installer.wasm \
--preimages-dir $(BIN_DIR)/wasm_2_0_0 \
--setup-file $(INSTALLER_CONF_PATH)
build-operator:
mkdir $(BIN_DIR) || true
$(MAKE) build-kernel PACKAGE=$(PACKAGE) CI_COMMIT_SHA=$(CI_COMMIT_SHA)
$(MAKE) build-installer PACKAGE=$(PACKAGE)
image-etherlink:
docker build -t etherlink:$(OCTEZ_TAG) --file ./build/etherlink/Dockerfile \
--build-arg OCTEZ_TAG=$(OCTEZ_TAG) \
--build-arg OCTEZ_PROTO=$(OCTEZ_PROTO) \
--build-arg PACKAGE=$(PACKAGE) \
--build-arg TEZOS_REPO=$(TEZOS_REPO) \
--build-arg TEZOS_REPO_BRANCH=$(TEZOS_REPO_BRANCH) \
--build-arg CI_COMMIT_SHA=$(CI_COMMIT_SHA) \
.
run-operator:
$(MAKE) image-etherlink \
OCTEZ_TAG=$(OCTEZ_TAG) \
OCTEZ_PROTO=$(OCTEZ_PROTO) \
PACKAGE=$(PACKAGE) \
TEZOS_REPO=$(TEZOS_REPO) \
TEZOS_REPO_BRANCH=$(TEZOS_REPO_BRANCH) \
CI_COMMIT_SHA=$(CI_COMMIT_SHA)
docker stop operator || true
docker network create etherlink-net || true
docker run --rm -it \
--name operator \
--network=etherlink-net \
--entrypoint=/bin/sh \
-v $$PWD/.tezos-client:/root/.tezos-client/ \
-v $$PWD/.tezos-smart-rollup-node:/root/.tezos-smart-rollup-node \
-p 127.0.0.1:8932:8932 \
-e NETWORK=$(NETWORK) \
etherlink:$(OCTEZ_TAG)
run-facade:
$(MAKE) image-etherlink \
OCTEZ_TAG=$(OCTEZ_TAG) \
OCTEZ_PROTO=$(OCTEZ_PROTO) \
PACKAGE=$(PACKAGE) \
TEZOS_REPO=$(TEZOS_REPO) \
TEZOS_REPO_BRANCH=$(TEZOS_REPO_BRANCH) \
CI_COMMIT_SHA=$(CI_COMMIT_SHA)
docker stop facade || true
docker network create etherlink-net || true
docker run --rm -it \
--name facade \
--network=etherlink-net \
--entrypoint=/usr/bin/octez-evm-node \
-p 127.0.0.1:8545:8545 \
etherlink:$(OCTEZ_TAG) \
run \
proxy \
with \
endpoint \
http://operator:8932 \
--rpc-addr "0.0.0.0" \
--rpc-port 8545