forked from reef-defi/reef-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (75 loc) · 2.59 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
85
86
87
88
89
90
91
92
.PHONY: configure-rust
configure-rust:
rustup install 1.53.0
rustup default 1.53.0
rustup toolchain install nightly-2021-05-21
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-05-21
rustup component add clippy
.PHONY: init
init:
make configure-rust
git submodule update --init --recursive
.PHONY: release
release:
make configure-rust
rm -rf target/
cargo build --manifest-path node/Cargo.toml --features with-ethereum-compatibility --release
.PHONY: build
build:
cargo build --manifest-path node/Cargo.toml --features runtime-benchmarks,with-ethereum-compatibility --release
.PHONY: wasm
wasm:
cargo build -p reef-runtime --features with-ethereum-compatibility --release
.PHONY: genesis
genesis:
make release
./target/release/reef-node build-spec --chain testnet-new > assets/chain_spec_testnet.json
./target/release/reef-node build-spec --chain mainnet-new > assets/chain_spec_mainnet.json
./target/release/reef-node build-spec --chain testnet-new --raw > assets/chain_spec_testnet_raw.json
./target/release/reef-node build-spec --chain mainnet-new --raw > assets/chain_spec_mainnet_raw.json
.PHONY: check
check:
SKIP_WASM_BUILD=1 cargo check
.PHONY: clippy
clippy:
SKIP_WASM_BUILD=1 cargo clippy -- -D warnings -A clippy::from-over-into -A clippy::unnecessary-cast -A clippy::identity-op -A clippy::upper-case-acronyms
.PHONY: watch
watch:
SKIP_WASM_BUILD=1 cargo watch -c -x build
.PHONY: test
test:
SKIP_WASM_BUILD=1 cargo test --all
.PHONY: debug
debug:
cargo build && RUST_LOG=debug RUST_BACKTRACE=1 rust-gdb --args target/debug/reef-node --dev --tmp -lruntime=debug
.PHONY: run
run:
RUST_BACKTRACE=1 cargo run --manifest-path node/Cargo.toml --features with-ethereum-compatibility -- --dev --tmp
.PHONY: log
log:
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --manifest-path node/Cargo.toml --features with-ethereum-compatibility -- --dev --tmp
.PHONY: noeth
noeth:
RUST_BACKTRACE=1 cargo run -- --dev --tmp
.PHONY: bench
bench:
SKIP_WASM_BUILD=1 cargo test --manifest-path node/Cargo.toml --features runtime-benchmarks,with-ethereum-compatibility benchmarking
.PHONY: doc
doc:
SKIP_WASM_BUILD=1 cargo doc --open
.PHONY: cargo-update
cargo-update:
cargo update
cargo update --manifest-path node/Cargo.toml
make test
.PHONY: fork
fork:
npm i --prefix fork fork
ifeq (,$(wildcard fork/data))
mkdir fork/data
endif
cp target/release/reef-node fork/data/binary
cp target/release/wbuild/reef-runtime/reef_runtime.compact.wasm fork/data/runtime.wasm
cp assets/types.json fork/data/schema.json
cp assets/chain_spec_$(chain)_raw.json fork/data/genesis.json
cd fork && npm start && cd ..