-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 1008 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 1008 Bytes
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
bin_dir=build
function=spark_server_staging
psql_connection=postgresql://postgres:postgres@127.0.0.1:45432/spark_server_dev
# env.mk can overwrite these env.
-include env.mk
.PHONY: prepare abigen test build
prepare:
@git submodule update --init --recursive
@docker-compose up -d postgres
@cd contract && yarn && yarn hardhat compile
@go mod download
@if [ ! -f config/config.test.json ]; then cp config/config.{sample,test}.json; fi;
@if [ ! -f config/config.json ]; then cp config/config.{sample,}.json; fi;
@echo 'Done. Modify config/config.{test,}.json for your environment.'
abigen:
@-mkdir abi
jq .abi contract/abi/SparkLink.json > abi/SparkLink.json
abigen --abi abi/SparkLink.json --pkg abi --type SparkLink --out abi/spark_nft.go
abigen --abi abi/ERC20.json --pkg abi --type ERC20 --out abi/erc20.go
test-prepare:
@psql ${psql_connection} -c 'CREATE DATABASE spark_server_test;'
test:
@go test -v ./...
psql:
@psql ${psql_connection}
build:
@go build -o ${bin_dir}/ ./cmd/...