-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
84 lines (59 loc) · 3.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright (c) 2020 XDC.Network
export GO111MODULE=on
# Go parameters
GOCMD=go
GOLINT=golint
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
BIN_DIRECTORY=bin
NOFILE=100000
.PHONY: deps build run lint run-mainnet-online run-mainnet-offline run-testnet-online \
run-testnet-offline check-comments \
build-local fmt update-tracer \
update-bootstrap-balances
default: build-local
build:
docker build -t xdc-rosetta:latest https://github.com/BlocksScan/rosetta-XDCNetwork.git
build-local:
docker build -t xdc-rosetta:latest .
build-release:
# make sure to always set version with vX.X.X
docker build -t xdc-rosetta:$(version) .;
docker save xdc-rosetta:$(version) | gzip > xdc-rosetta-$(version).tar.gz;
run-mainnet-online:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/XDC-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 xdc-rosetta:latest
run-mainnet-offline:
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 xdc-rosetta:latest
run-mainnet-remote:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -e "XDC=$(XDC)" -p 8080:8080 -p 30303:30303 xdc-rosetta:latest
run-testnet-online:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/XDC-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 xdc-rosetta:latest
run-testnet-offline:
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=TESTNET" -e "PORT=8081" -p 8081:8081 xdc-rosetta:latest
run-testnet-remote:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -e "XDC=$(XDC)" -p 8080:8080 -p 30303:30303 xdc-rosetta:latest
run-devnet-online:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/XDC-data:/data" -e "MODE=ONLINE" -e "NETWORK=DEVNET" -e "PORT=8080" -p 8080:8080 -p 30303:30303 xdc-rosetta:latest
run-devnet-offline:
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=DEVNET" -e "PORT=8081" -p 8081:8081 xdc-rosetta:latest
run-devnet-remote:
docker run -d --rm --ulimit "nofile=${NOFILE}:${NOFILE}" -e "MODE=ONLINE" -e "NETWORK=DEVNET" -e "PORT=8080" -e "XDC=$(XDC)" -p 8080:8080 -p 30303:30303 xdc-rosetta:latest
check-comments:
${GOLINT_CMD} -set_exit_status ${GO_FOLDERS} .
lint: | check-comments
golangci-lint run --timeout 2m0s -v -E ${LINT_SETTINGS},gomnd
clean:
@echo "Cleaning..."
@rm -rf ./$(BIN_DIRECTORY)
deps:
go get ./...
update-tracer:
curl https://raw.githubusercontent.com/xinfinorg/XDPoSChain/master/eth/tracers/internal/tracers/call_tracer.js -o XDPoSChain/call_tracer.js
update-bootstrap-balances:
go run main.go utils:generate-bootstrap XDPoSChain/genesis_files/mainnet.json rosetta-cli-conf/mainnet/bootstrap_balances.json
go run main.go utils:generate-bootstrap XDPoSChain/genesis_files/testnet.json rosetta-cli-conf/testnet/bootstrap_balances.json
go run main.go utils:generate-bootstrap XDPoSChain/genesis_files/devnet.json rosetta-cli-conf/devnet/bootstrap_balances.json
gofmt:
$(GOFMT) -s -w $(GO_FILES)