This repository has been archived by the owner on Sep 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (46 loc) · 1.82 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
.PHONY: all clean release build run test test-panic test-st macros
# non-versioned include
VARS ?= vars.mk
-include $(VARS)
CARGO ?= $(shell which cargo)
FEATURES ?= with-serde
TARGET := ./target/debug/basis
BASIS_DB ?= /tmp/basis-db
override CARGO_BUILD_ARGS += --features "$(FEATURES)"
all: build
build:
$(CARGO) build $(CARGO_BUILD_ARGS)
release: override CARGO_BUILD_ARGS += --release
release: build
run:
$(CARGO) run $(CARGO_BUILD_ARGS) -- run -d $(BASIS_DB) -c config/block/0/node.toml --consensus-key-pass pass --service-key-pass pass
run-release: override CARGO_BUILD_ARGS += --release
run-release:
$(CARGO) run $(CARGO_BUILD_ARGS) -- run -d $(BASIS_DB) -c config/block/0/node.toml --consensus-key-pass pass --service-key-pass pass
clean-db:
rm -rf $(BASIS_DB)
run-clean: clean-db run
reconfig: all
mkdir -p config/block/
$(CARGO) run $(CARGO_BUILD_ARGS) -- generate-template config/block/template.toml --validators-count=1
$(CARGO) run $(CARGO_BUILD_ARGS) -- generate-config config/block/template.toml config/block/0/ --peer-address 127.0.0.1:6969 --consensus-key-pass pass --service-key-pass pass
$(CARGO) run $(CARGO_BUILD_ARGS) -- finalize config/block/0/sec.toml config/block/0/node.toml --public-api-address 0.0.0.0:13007 --private-api-address 0.0.0.0:13008 --public-configs config/block/0/pub.toml
test-release: override CARGO_BUILD_ARGS += --release
test-release:
$(CARGO) test $(TEST) $(CARGO_BUILD_ARGS) -- --nocapture
test:
$(CARGO) test $(TEST) $(CARGO_BUILD_ARGS) -- --nocapture
test-panic: override FEATURES += panic-on-error
test-panic:
RUST_BACKTRACE=1 \
$(CARGO) test \
$(TEST) \
$(CARGO_BUILD_ARGS) -- \
--nocapture
test-st:
$(CARGO) test $(TEST) $(CARGO_BUILD_ARGS) -- --nocapture --test-threads 1
macros:
$(CARGO) rustc $(CARGO_BUILD_ARGS) -- --pretty=expanded
clean:
rm -rf target/
cargo clean