-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
52 lines (43 loc) · 1.1 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
# Load in the .env file
ifneq ("$(wildcard $(.env))","")
include .env
endif
# General Config
PWD=$(shell pwd)
NOFILE=100000
# Test all packages
GO_PACKAGES=./...
TEST_SCRIPT=go test ${GO_PACKAGES}
LINT_CONFIG=.golangci.yml
GOIMPORTS_INSTALL=go install golang.org/x/tools/cmd/goimports@latest
GOIMPORTS_CMD=goimports
LINT_SETTINGS=golint,misspell,gocyclo,gocritic,whitespace,goconst,gocognit,bodyclose,unconvert,lll,unparam
GOLINES_INSTALL=go install github.com/segmentio/golines@latest
GOLINES_CMD=golines
.PHONY: clean format lint build run test
# Clean up Rosetta Server binary
clean:
rm -rf bin/op-rosetta
# Formatting with gofmt
format:
gofmt -s -w -l .
# Run the golangci-lint linter
lint:
golangci-lint run -E asciicheck,goimports,misspell ./...
# Build Rosetta Server binary
build:
env GO111MODULE=on go build -o bin/op-rosetta ./cmd
# Run Rosetta Server
run:
MODE=${MODE} \
PORT=${PORT} \
BLOCKCHAIN=${BLOCKCHAIN} \
NETWORK=${NETWORK} \
FILTER=${FILTER} \
GENESIS_BLOCK_HASH=${GENESIS_BLOCK_HASH} \
GETH=${GETH} \
CHAIN_CONFIG=${CHAIN_CONFIG} \
bin/op-rosetta
# Run tests
test:
go test -v ./...