-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
51 lines (37 loc) · 2.03 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
GUEST_RUST_FLAGS="-C relocation-model=pie -C link-arg=--emit-relocs -C link-arg=--unique --remap-path-prefix=$(pwd)= --remap-path-prefix=$HOME=~"
run: chainspec
bunx @acala-network/chopsticks@latest --config poc/runtime/chopsticks.yml --genesis output/chainspec.json
poc-guests: poc-guest-sum-balance poc-guest-sum-balance-percent poc-guest-total-supply poc-guest-transparent-call
dummy-poc-guests: dummy-poc-guest-sum-balance dummy-poc-guest-sum-balance-percent dummy-poc-guest-total-supply dummy-poc-guest-transparent-call
poc-guest-%:
cd poc/guests; RUSTFLAGS=$(GUEST_RUST_FLAGS) cargo build -q --release --bin poc-guest-$* -p poc-guest-$*
mkdir -p output
polkatool link --run-only-if-newer -s poc/guests/target/riscv32ema-unknown-none-elf/release/poc-guest-$* -o output/poc-guest-$*.polkavm
dummy-poc-guest-%:
mkdir -p output
touch output/poc-guest-$*.polkavm
tools: polkatool chain-spec-builder
polkatool:
cargo install --path vendor/polkavm/tools/polkatool
chain-spec-builder:
cargo install --git https://github.com/paritytech/polkadot-sdk --tag polkadot-v1.12.0 staging-chain-spec-builder
fmt:
cargo fmt --all
check-wasm:
cargo check --no-default-features --target=wasm32-unknown-unknown -p xcq-api -p xcq-executor -p xcq-extension-core -p xcq-extension-fungibles -p xcq-extension -p xcq-primitives -p xcq-runtime-api -p xcq-types
SKIP_WASM_BUILD= cargo check --no-default-features --target=wasm32-unknown-unknown -p poc-runtime
check: check-wasm
SKIP_WASM_BUILD= cargo check
cd poc/guests; cargo check
clippy:
SKIP_WASM_BUILD= cargo clippy -- -D warnings
cd poc/guests; cargo clippy
test:
SKIP_WASM_BUILD= cargo test
chainspec:
cargo build -p poc-runtime --release
mkdir -p output
cp target/release/wbuild/poc-runtime/poc_runtime.compact.compressed.wasm output
chain-spec-builder -c output/chainspec.json create -n poc-runtime -i poc-runtime -r ./output/poc_runtime.compact.compressed.wasm -s default
cat output/chainspec.json | jq '.properties = {}' > output/chainspec.json.tmp
mv output/chainspec.json.tmp output/chainspec.json