forked from kroma-network/kroma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (50 loc) · 1.89 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
VERSION := $(shell git describe --tags --abbrev=0 --match v* 2> /dev/null || echo 'v0.0.0')
GIT_COMMIT := $(shell git rev-parse --short=8 HEAD)
LD_FLAGS_ARGS +=-X main.Version=$(VERSION)
LD_FLAGS_ARGS +=-X main.Meta=$(GIT_COMMIT)
LD_FLAGS := -ldflags "$(LD_FLAGS_ARGS)"
build:
GO111MODULE=on go build -v $(LD_FLAGS) -o bin/kroma-node ./components/node/cmd/main.go
GO111MODULE=on go build -v $(LD_FLAGS) -o bin/kroma-stateviz ./components/node/cmd/stateviz/main.go
GO111MODULE=on go build -v $(LD_FLAGS) -o bin/kroma-batcher ./components/batcher/cmd/main.go
GO111MODULE=on go build -v $(LD_FLAGS) -o bin/kroma-validator ./components/validator/cmd/main.go
.PHONY: build
clean:
@rm -rf bin/*
.PHONY: clean
test:
go test ./bindings/...
go test ./components/...
go test ./utils/...
go test ./e2e/... -timeout 30m # requires a minimum of 30min in a CI
yarn test
.PHONY: test
lint:
@go install github.com/golangci/golangci-lint/cmd/[email protected] \
&& golangci-lint run
.PHONY: lint
bindings:
make -C ./bindings
.PHONY: bindings
contracts-snapshot:
@(cd ./packages/contracts && yarn gas-snapshot && yarn storage-snapshot)
.PHONY: gas-snapshot
devnet-up:
@bash ./ops-devnet/devnet-up.sh
.PHONY: devnet-up
devnet-down:
@(cd ./ops-devnet && GENESIS_TIMESTAMP=$(shell date +%s) docker compose stop)
.PHONY: devnet-down
devnet-clean:
rm -rf ./packages/contracts/deployments/devnetL1
rm -rf ./.devnet
cd ./ops-devnet && docker compose down
docker image ls 'ops-devnet*' --format='{{.Repository}}' | xargs -r docker rmi
docker volume ls --filter name=ops-devnet --format='{{.Name}}' | xargs -r docker volume rm
.PHONY: devnet-clean
update-geth:
@ETH_GETH=$$(go list -m -f '{{.Path}}@{{.Version}}' github.com/ethereum/go-ethereum); \
KROMA_GETH=$$(go list -m -f '{{.Path}}@{{.Version}}' github.com/kroma-network/go-ethereum@dev); \
go mod edit -replace $$ETH_GETH=$$KROMA_GETH
@go mod tidy
.PHONY: update-geth