-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 1.7 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
#!/usr/bin/env gmake
include common.mk
.PHONY: all contracts demo-starter fmt tidy clean test install-deps run-localnet run-localnet-debug
all: contracts demo-starter
@printf "$(CYAN)*** Everything built successfully!$(OFF)\n"
contracts:
@printf "$(CYAN)*** Building $(BLUE)contracts$(CYAN)...$(OFF)\n"
@$(MAKE) -C contracts
demo-starter:
@printf "$(CYAN)*** Building $(BLUE)$@$(CYAN)...$(OFF)\n"
@go build
fmt:
@printf "$(CYAN)*** Formatting Go code...$(OFF)\n"
@go fmt ./...
tidy:
@printf "$(CYAN)*** Tidying Go modules...$(OFF)\n"
@go mod tidy
clean:
@printf "$(CYAN)*** Cleaning up...$(OFF)\n"
@go clean
@$(MAKE) -C contracts clean
test:
@printf "$(CYAN)*** Running end-to-end tests...$(OFF)\n"
@./test-e2e.sh
install-deps:
ifeq ($(shell which abigen),)
@printf "$(CYAN)*** Installing dependency: $(BLUE)abigen$(CYAN)...$(OFF)\n"
@go install github.com/ethereum/go-ethereum/cmd/abigen@latest
else
@printf "$(CYAN)*** Dependency $(BLUE)abigen$(CYAN) is already installed.$(OFF)\n"
endif
ifeq ($(shell which solc),)
@printf "$(CYAN)*** Installing dependency: $(BLUE)solc$(CYAN)...$(OFF)\n"
@sudo snap install solc --edge
else
@printf "$(CYAN)*** Dependency $(BLUE)solc$(CYAN) is already installed.$(OFF)\n"
endif
run-localnet:
@printf "$(CYAN)*** Starting $(BLUE)sapphire-localnet$(CYAN)...$(OFF)\n"
@-docker run -it -p8545:8545 -p8546:8546 $(DOCKER_PLATFORM) ghcr.io/oasisprotocol/sapphire-localnet -test-mnemonic
run-localnet-debug:
@printf "$(CYAN)*** Starting $(BLUE)sapphire-localnet$(CYAN) in $(MAGENTA)DEBUG$(CYAN) mode...$(OFF)\n"
@-docker run -it -p8545:8545 -p8546:8546 $(DOCKER_PLATFORM) -e OASIS_NODE_LOG_LEVEL=debug -e LOG__LEVEL=debug ghcr.io/oasisprotocol/sapphire-localnet -test-mnemonic