-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
57 lines (43 loc) · 1.91 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
include Makefile.ledger
VALIDATORS_COUNT ?= 4
val = 1
exit: exit $(val)
all: lint install
install: go.sum
go install $(BUILD_FLAGS) ./cmd/randappd
go install $(BUILD_FLAGS) ./cmd/randappcli
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
GO111MODULE=on go mod verify
prepare: go.mod
@echo "--> Ensure dependencies have not been modified"
GO111MODULE=on go mod verify
GO111MODULE=on go mod vendor
lint:
golangci-lint run
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
go mod verify
test:
@echo "Start testing:"
go test ./...
build: go.sum
go build -mod=readonly $(BUILD_FLAGS) -o build/randappd ./cmd/randappd
go build -mod=readonly $(BUILD_FLAGS) -o build/randappcli ./cmd/randappcli
build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build
build-docker-randappnode:
$(MAKE) -C networks/local
# Run a 4-node testnet locally
localnet-start: build-linux localnet-stop
@if ! [ -f build/node0/randappd/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/randappd:Z tendermint/randappnode testnet --v $(VALIDATORS_COUNT) -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi
docker-compose up -d
localnet-start-without-bls-keys: build-linux localnet-stop
@if ! [ -f build/node0/randappd/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/randappd:Z tendermint/randappnode testnet --v $(VALIDATORS_COUNT) -o . --starting-ip-address 192.168.10.2 --without-bls-keys --keyring-backend=test ; fi
docker-compose up -d
localnet-start-with-dkg-in-5-blocks: build-linux localnet-stop
@if ! [ -f build/node0/randappd/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/randappd:Z tendermint/randappnode testnet --v 4 -o . --starting-ip-address 192.168.10.2 --dkg-num-blocks 5 --keyring-backend=test ; fi
docker-compose up -d
# Stop testnet
localnet-stop:
docker-compose down
.PHONY: test