This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment_notes.txt
71 lines (48 loc) · 2.53 KB
/
deployment_notes.txt
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
export CHAIN_ID="malaga-420"
export TESTNET_NAME="malaga-420"
export FEE_DENOM="umlg"
export STAKE_DENOM="uand"
export BECH32_HRP="wasm"
export WASMD_VERSION="v0.27.0"
export CONFIG_DIR=".wasmd"
export BINARY="wasmd"
export COSMJS_VERSION="v0.28.1"
export GENESIS_URL="https://raw.githubusercontent.com/CosmWasm/testnets/master/malaga-420/config/genesis.json"
export RPC="https://rpc.malaga-420.cosmwasm.com:443"
export API="https://api.malaga-420.cosmwasm.com"
export FAUCET="https://faucet.malaga-420.cosmwasm.com"
export NODE=(--node $RPC)
export TXFLAG=($NODE --chain-id $CHAIN_ID --gas-prices 0.25umlg --gas auto --gas-adjustment 1.3)
# TODO accounts stuff
# wasmd keys add hackwasm
# tokens from faucet
# JSON=$(jq -n --arg addr $(wasmd keys show -a hackwasm) '{"denom":"umlg","address":$addr}') && curl -X POST --header "Content-Type: application/json" --data "$JSON" https://faucet.malaga-420.cosmwasm.com/credit
# check credit
# wasmd query bank balances $(wasmd keys show -a hackwasm) $NODE
# build small release binary
RUSTFLAGS='-C link-arg=-s' cargo wasm
# run unit tests
RUST_BACKTRACE=1 cargo unit-test
# If you have already set up the environment variables, you can use the following command:
STORE_RES=$(wasmd tx wasm store target/wasm32-unknown-unknown/release/cw_nameservice.wasm --from hackwasm $TXFLAG -y --output json -b block)
CODE_ID=$(echo $STORE_RES | jq -r '.logs[0].events[-1].attributes[0].value')
echo $CODE_ID
# Let's see the list of contracts instantiated using the Code Id above.
wasmd query wasm list-contract-by-code $CODE_ID $NODE --output json
# instanciate the contract
INIT='{"purchase_price":{"amount":"100","denom":"umlg"},"transfer_price":{"amount":"999","denom":"umlg"}}'
INIT='{"transfer_price":{"amount":"999","denom":"umlg"}}'
wasmd tx wasm instantiate $CODE_ID "$INIT" --from hackwasm --label "name service" $TXFLAG -y --no-admin
# Check the contract details and account balance
wasmd query wasm list-contract-by-code $CODE_ID $NODE --output json
CONTRACT=$(wasmd query wasm list-contract-by-code $CODE_ID $NODE --output json | jq -r '.contracts[-1]')
echo $CONTRACT
# See the contract details
wasmd query wasm contract $CONTRACT $NODE
# Check the contract balance
wasmd query bank balances $CONTRACT $NODE
# Upon instantiation the cw_nameservice contract will store the instatiation message data in the contract's storage with the storage key "config".
# Query the entire contract state
wasmd query wasm contract-state all $CONTRACT $NODE
# obtain list of transactions for an account??
# TODO interactions with contract