-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
66 lines (50 loc) · 1.65 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
VERSION := $(shell git describe --tags --always --dirty="-dev")
v:
@echo "Version: ${VERSION}"
clean:
rm -rf build/
# Build preconf-share
build-share:
go build -trimpath -ldflags "-X main.version=${VERSION}" -v -o build/node preconf-share/cmd/node/main.go
# Build preconf-operator
build-operator:
go build -trimpath -ldflags "-X main.version=${VERSION}" -v -o build/operator preconf-operator/cmd/operator/main.go
# Build rpc
build-rpc:
go build -trimpath -ldflags "-X main.version=${VERSION}" -v -o build/rpc rpc/cmd/server/main.go
# Build all components
build-all: clean build-share build-operator build-rpc
# Run preconf-share
run-share:
make build-share
cd preconf-share && docker-compose rm -f -s && docker compose up -d --force-recreate --build --wait && sleep 1
for file in preconf-share/sql/*.sql; do psql "postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable" -f $$file; done
./build/node
# Run preconf-operator
run-operator:
make build-operator
./build/operator --config preconf-operator/config.yaml
# Run anvil with prepared state
run-anvil:
anvil --load-state contracts/anvil-state.json --silent
# Run the rpc
run-rpc:
go run rpc/cmd/server/main.go -redis dev -signingKey dev -proxy http://127.0.0.1:8545
# Run all components concurrently
run-all:
make -j run-anvil run-share run-operator run-rpc &
# Run all in background and example (used by CI)
run-ci:
make run-all && sleep 200 && python test_tx.py && exit 0
test:
go test ./...
test-race:
go test -race ./...
lint:
gofmt -d -s .
gofumpt -d -extra .
go vet ./...
go list ./... | grep -F -e contracts/ -v | xargs staticcheck
# golangci-lint run
fmt:
gofumpt -l -w -extra .