forked from QuorumCredit/QuorumCredit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (49 loc) · 2.17 KB
/
Copy pathMakefile
File metadata and controls
60 lines (49 loc) · 2.17 KB
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
.PHONY: build test generate-sdk check-sdk deploy-testnet deploy-mainnet indexer indexer-test
# ── Config ────────────────────────────────────────────────────────────────────
CONTRACT_DIR := .
WASM_TARGET := wasm32v1-none
WASM_FILE := $(CONTRACT_DIR)/target/$(WASM_TARGET)/release/quorum_credit.wasm
# ── Targets ───────────────────────────────────────────────────────────────────
## Compile the contract (native + WASM release build)
build:
cd $(CONTRACT_DIR) && cargo build -p quorum_credit --target $(WASM_TARGET) --release
## Generate contract-parity SDK clients from the compiled WASM spec
generate-sdk: build
cargo run -p sdkgen --bin contract_spec_extractor -- \
--wasm $(WASM_FILE) \
--spec-json sdk/contract_spec.json \
--typescript sdk/typescript/src/client.ts \
--python sdk/python/quorum_credit/client.py
## Verify generated SDK clients are current
check-sdk: build
cargo run -p sdkgen --bin contract_spec_extractor -- \
--wasm $(WASM_FILE) \
--spec-json sdk/contract_spec.json \
--typescript sdk/typescript/src/client.ts \
--python sdk/python/quorum_credit/client.py \
--check
## Run the full test suite
test:
cd $(CONTRACT_DIR) && cargo test
## Deploy to Stellar testnet
deploy-testnet:
stellar contract deploy \
--wasm $(WASM_FILE) \
--network testnet \
--source $(DEPLOYER_SECRET_KEY)
## Deploy to Stellar mainnet — requires interactive confirmation
deploy-mainnet:
@echo "WARNING: You are about to deploy to MAINNET."
@read -p "Are you sure you want to deploy to MAINNET? [y/N]: " confirm && \
[ "$${confirm:-N}" = "y" ] || [ "$${confirm:-N}" = "Y" ] || \
(echo "Deployment aborted."; exit 1)
stellar contract deploy \
--wasm $(WASM_FILE) \
--network mainnet \
--source $(DEPLOYER_SECRET_KEY)
## Build the event indexer binary
indexer:
cargo build -p quorum-credit-indexer --release
## Run the event indexer tests
indexer-test:
cargo test -p quorum-credit-indexer