Skip to content

Commit 8236369

Browse files
committed
fix: marketing: add config.json, add Makefile, instantiated on teritori-testnet
1 parent c340ad8 commit 8236369

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

cosmwasm-contracts/marketing/Makefile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
ADMIN=testnet-adm
2+
ADMIN_ADDR=$(shell teritorid keys show $(ADMIN) --keyring-backend test --output json | jq -r .address)
3+
NODE_FLAG=--node https://rpc.testnet.teritori.com:443
4+
TX_FLAGS=--from $(ADMIN) --chain-id teritori-test-7 $(NODE_FLAG) --gas auto --gas-adjustment 1.3 -y -b sync --output json --keyring-backend test -o json
5+
QUERY_FLAGS=$(NODE_FLAG) -o json
6+
CODE_ID=53
7+
CONFIG=$(shell cat config.json | jq -r '.admin_addr="$(ADMIN_ADDR)" | tojson | @sh')
8+
9+
# only informative
10+
# CONTRACT_ADDRESS=tori1xz0acmdjusqv3ntfjuue34stf7z8q3cytjf7jgyuk6ax4vrs6nzshq7d9w
11+
12+
.PHONY: artifacts/marketing.wasm
13+
artifacts/marketing.wasm:
14+
docker run --rm -v "$(PWD)":/code \
15+
--platform linux/amd64 \
16+
--mount type=volume,source=marketing_cache,target=/target \
17+
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
18+
cosmwasm/optimizer:0.16.0
19+
20+
.PHONY: deploy.testnet
21+
deploy.testnet: artifacts/marketing.wasm
22+
set -o pipefail; \
23+
TXHASH=$$(teritorid tx wasm store artifacts/marketing.wasm $(TX_FLAGS) | jq -r .txhash); \
24+
while ! teritorid query tx $$TXHASH $(QUERY_FLAGS) 2>/dev/null | jq -r '.logs[0].events[] | select(.type=="store_code").attributes[] | select(.key=="code_id").value'; do sleep 1; done
25+
26+
.PHONY: instantiate.testnet
27+
instantiate.testnet: config.json
28+
set -o pipefail; \
29+
TXHASH=$$(teritorid tx wasm instantiate $(CODE_ID) $(CONFIG) --label Marketing --admin $(ADMIN_ADDR) $(TX_FLAGS) | jq -r .txhash); \
30+
while ! teritorid query tx $$TXHASH $(QUERY_FLAGS) 2>/dev/null | jq -r '.logs[0].events[] | select(.type=="instantiate").attributes[] | select(.key=="_contract_address").value'; do sleep 1; done
31+
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"admin_adrr": "tori1yzjgaql23yxlwxxvmszssg23w3f8k6k2q75jss"
3+
}
4+

0 commit comments

Comments
 (0)