-
Notifications
You must be signed in to change notification settings - Fork 31
/
Makefile
66 lines (51 loc) · 1.76 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
SHELL:=/usr/bin/env sh
OSFLAG := ""
UNAME := $(shell uname -m)
ifeq ($(UNAME), arm64)
OSFLAG = DOCKER_DEFAULT_PLATFORM=linux/amd64
endif
# Build bsc binary docker
.PHONY:build-bsc
build-bsc:
$(OSFLAG) docker-compose -f docker-compose.bsc.yml build
# Build & start simple validator cluster
.PHONY:build-simple
build-simple:
make build-bsc
$(OSFLAG) docker-compose -f docker-compose.simple.bootstrap.yml build
$(OSFLAG) docker-compose -f docker-compose.simple.yml build --build-arg OS_ARCH=${UNAME}
.PHONY:bootstrap-simple
bootstrap-simple:
$(OSFLAG) docker-compose -f docker-compose.simple.bootstrap.yml run bootstrap-simple
.PHONY:start-simple
start-simple:
$(OSFLAG) docker-compose -f docker-compose.simple.yml up -d bsc-rpc bsc-validator1 netstats
.PHONY:run-test-simple
run-test-simple:
docker-compose -f docker-compose.simple.yml run truffle-test
# Build & start multiple validator cluster
.PHONY:build-cluster
build-cluster:
make build-bsc
$(OSFLAG) docker-compose -f docker-compose.cluster.bootstrap.yml build
$(OSFLAG) docker-compose -f docker-compose.cluster.yml build --build-arg OS_ARCH=${UNAME}
.PHONY:bootstrap-cluster
bootstrap-cluster:
$(OSFLAG) docker-compose -f docker-compose.cluster.bootstrap.yml run bootstrap-cluster
.PHONY:start-cluster
start-cluster:
$(OSFLAG) docker-compose -f docker-compose.cluster.yml up -d cluster-bsc-rpc cluster-bsc-validator1 cluster-bsc-validator2 cluster-bsc-validator3 netstats
.PHONY:run-test-cluster
run-test-cluster:
docker-compose -f docker-compose.cluster.yml run truffle-test
# Stop & reset
.PHONY:stop-all
stop-all:
docker-compose -f docker-compose.simple.yml stop
docker-compose -f docker-compose.cluster.yml stop
docker container prune -f
.PHONY:reset
reset:
make stop-all
rm -rf storage/*
docker system prune -f