-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (34 loc) · 1.28 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
CHAIN_SIMULATOR_IMAGE_NAME=chainsimulator
CHAIN_SIMULATOR_IMAGE_TAG=latest
DOCKER_FILE=Dockerfile
IMAGE_NAME=simulator_image
docker-build:
docker build \
-t ${CHAIN_SIMULATOR_IMAGE_NAME}:${CHAIN_SIMULATOR_IMAGE_TAG} \
-f ${DOCKER_FILE} \
.
run-faucet-test:
$(MAKE) docker-build
docker run -d --name "${IMAGE_NAME}" -p 8085:8085 ${CHAIN_SIMULATOR_IMAGE_NAME}:${CHAIN_SIMULATOR_IMAGE_TAG}
sleep 2s
cd examples/faucet && /bin/bash faucet.sh
docker stop "${IMAGE_NAME}"
docker rm ${IMAGE_NAME} 2> /dev/null
run-examples:
printf '%s\n' '{ File = "enableEpochs.toml", Path = "EnableEpochs.StakeLimitsEnableEpoch", Value = 1000000 },' > temp.txt
sed -i '4r temp.txt' cmd/chainsimulator/config/nodeOverrideDefault.toml
rm temp.txt
$(MAKE) docker-build
docker run -d --name "${IMAGE_NAME}" -p 8085:8085 ${CHAIN_SIMULATOR_IMAGE_NAME}:${CHAIN_SIMULATOR_IMAGE_TAG}
cd scripts/run-examples && /bin/bash script.sh
docker stop "${IMAGE_NAME}"
docker rm ${IMAGE_NAME}
lint-install:
ifeq (,$(wildcard test -f bin/golangci-lint))
@echo "Installing golint"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s
endif
run-lint:
@echo "Running golint"
bin/golangci-lint run --max-issues-per-linter 0 --max-same-issues 0 --timeout=2m
lint: lint-install run-lint