forked from bifrost-io/bifrost
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
140 lines (109 loc) · 4.31 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
PARA_ID := 2001
DOCKER_TAG := latest
CHAIN := bifrost-genesis
SURI := //Alice
.PHONY: init
init:
git config core.hooksPath .githooks
./scripts/init.sh
# Build Release
.PHONY: build-bifrost-kusama-release
build-bifrost-kusama-release: copy-genesis-config-release
cargo build -p node-cli --locked --features "with-bifrost-kusama-runtime" --release
.PHONY: build-bifrost-polkadot-release
build-bifrost-polkadot-release: copy-genesis-config-release
cargo build -p node-cli --locked --features "with-bifrost-polkadot-runtime" --release
.PHONY: build-all-release
build-all-release: copy-genesis-config-release
cargo build -p node-cli --locked --features "with-all-runtime" --release
.PHONY: build-bifrost-rococo-fast-release
build-bifrost-rococo-fast-release:
cargo build -p node-cli --locked --features "with-bifrost-kusama-runtime,fast-runtime" --release
.PHONY: check-all
check-all: format
SKIP_WASM_BUILD= cargo check -p node-cli --locked --features "with-all-runtime"
.PHONY: test-all
test-all:
SKIP_WASM_BUILD= cargo test --features "with-all-runtime"
.PHONY: integration-test
integration-test:
SKIP_WASM_BUILD= cargo test -p runtime-integration-tests --features=with-bifrost-kusama-runtime
.PHONY: clean
clean:
cargo clean
.PHONY: copy-genesis-config-release
copy-genesis-config-release:
mkdir -p "target/release/res"
cp -r node/service/res/genesis_config target/release/res
.PHONY: format
format:
cargo +nightly fmt --all -- --check
.PHONY: test-benchmarking
test-benchmarking:
cargo test --features runtime-benchmarks --features with-bifrost-kusama-runtime --features --all benchmarking
.PHONY: benchmarking-staking
benchmarking-staking:
cargo run -p node-cli --locked --features "with-bifrost-kusama-runtime,runtime-benchmarks" --release \
-- benchmark --chain=bifrost-local --steps=50 \
--repeat=20 \
--pallet=parachain_staking \
--extrinsic="*" \
--execution=wasm \
--wasm-execution=compiled \
--heap-pages=4096 \
--header=./HEADER-GPL3 \
--output="./runtime/bifrost-kusama/src/weights/parachain_staking.rs"
.PHONY: generate-all-weights
generate-all-weights:
bash ./scripts/generate-weights.sh bifrost
.PHONY: build-all-release-with-bench
build-all-release-with-bench: copy-genesis-config-release
cargo build -p node-cli --locked --features "with-all-runtime,runtime-benchmarks" --release
# Run dev chain
.PHONY: run-dev-manual-seal
run-dev:
cargo run -p node-cli --locked --features "with-bifrost-kusama-runtime" -- --tmp --dev --sealing instant --rpc-cors all --unsafe-ws-external
# Build docker image
.PHONY: build-docker-image
build-docker-image:
.maintain/build-image.sh
# Build wasm
.PHONY: build-bifrost-kusama-wasm
build-bifrost-kusama-wasm:
.maintain/build-wasm.sh bifrost-kusama
.PHONY: build-bifrost-polkadot-wasm
build-bifrost-polkadot-wasm:
.maintain/build-wasm.sh bifrost-polkadot
.PHONY: build-bifrost-rococo-fast-wasm
build-bifrost-rococo-fast-wasm:
.maintain/build-wasm.sh bifrost-kusama fast
.PHONY: check-try-runtime
check-try-runtime:
SKIP_WASM_BUILD= cargo check --features try-runtime --features with-bifrost-runtime
.PHONY: try-bifrost-runtime-upgrade
try-bifrost-runtime-upgrade:
./scripts/try-runtime.sh bifrost-kusama
.PHONY: resources
resources:
./target/release/bifrost export-genesis-state --chain $(CHAIN) > ./resources/para-$(PARA_ID)-genesis
./target/release/bifrost export-genesis-wasm --chain $(CHAIN) > ./resources/para-$(PARA_ID).wasm
./target/release/bifrost build-spec --chain $(CHAIN) --disable-default-bootnode --raw > ./resources/$(CHAIN)-raw.json
.PHONY: generate-session-key
generate-session-key:
./target/release/bifrost key generate --scheme Sr25519
.PHONY: insert-session-key
insert-session-key:
./target/release/bifrost key insert --chain $(CHAIN) --keystore-path ./resources/keystore --suri "$(SURI)" --scheme Sr25519 --key-type aura
.PHONY: generate-node-key
generate-node-key:
subkey generate-node-key --file ./resources/node-key
.PHONY: view-key
view-key:
subkey inspect $(SURI) -n bifrost
.PHONY: copy-genesis-config-production
copy-genesis-config-production:
mkdir -p "target/production/res"
cp -r node/service/res/genesis_config target/production/res
.PHONY: production-release
production-release:
cargo build -p node-cli --locked --features "with-all-runtime" --profile production