Skip to content

Commit 1b54263

Browse files
committed
Updated Readme.md
1 parent 982771f commit 1b54263

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,23 +152,23 @@ injectived q bank balances ACCOUNT_ADDRESS
152152

153153
```sh
154154
# 在"injective-core-staging"容器内,或如果本地运行injectived,则在合约目录中
155-
TXHASH=${
155+
TXHASH=$(
156156
yes $KEYRING_PASSWORD | injectived tx wasm store artifacts/counter.wasm \
157157
--from=$(echo $ACCOUNT_ADDRESS) \
158158
--chain-id="injective-888" \
159159
--yes --fees=1000000000000000inj --gas=2000000 \
160160
--node=https://testnet.sentry.tm.injective.network:443 \
161161
| yj -yj | jq -r .txhash
162-
}
162+
)
163163

164164
echo "txhash: $TXHASH"
165165

166166
# 得到Code ID
167-
CODE_ID=${
167+
CODE_ID=$(
168168
injectived query tx $TXHASH --node=https://testnet.sentry.tm.injective.network:443 \
169169
| yj -yj | jq .events[] -c | jq .attibutes[] -c \
170170
| grep code_id | jq -r .value | head -n1
171-
}
171+
)
172172

173173
echo "code_id: $CODE_ID"
174174
```
@@ -180,7 +180,7 @@ echo "code_id: $CODE_ID"
180180
```sh
181181
INIT='{"count":99}'
182182
echo "instantiate: ${INIT}"
183-
TXHASH=${
183+
TXHASH=$(
184184
yes $KEYRING_PASSWORD | injectived tx wasm instantiate $CODE_ID $INIT \
185185
--label="CounterTestInstance" \
186186
--from=$(echo $ACCOUNT_ADDRESS) \
@@ -190,16 +190,16 @@ TXHASH=${
190190
--no-admin \
191191
--node=https://testnet.sentry.tm.injective.network:443 \
192192
| yj -yj | jq -r .txhash
193-
}
193+
)
194194

195195
echo "txhash: $TXHASH"
196196

197197
# 得到合约地址
198-
CONTRACT={
198+
CONTRACT=$(
199199
injectived query tx $TXHASH --node=https://testnet.sentry.tm.injective.network:443 \
200200
| yj -yj | jq .events[] -c | jq .attibutes[] -c \
201201
| grep contract_address | jq -r .value | head -n1
202-
}
202+
)
203203

204204
echo "contract: $CONTRACT"
205205
```
@@ -225,13 +225,13 @@ injectived query wasm contract-state smart $CONTRACT "$GET_COUNT_QUERY" \
225225
```sh
226226
INCREMENT='{"increment":{}}'
227227
echo "execute: ${INCREMENT}"
228-
TXHASH=${
228+
TXHASH=$(
229229
yes $KEYRING_PASSWORD | injectived tx wasm execute $CONTRACT "$INCREMENT" --from=$(echo $ACCOUNT_ADDRESS) \
230230
--chain-id="injective-888" \
231231
--yes --fees=1000000000000000inj --gas=2000000 \
232232
--node=https://testnet.sentry.tm.injective.network:443 \
233233
--output json | jq -r .txhash
234-
}
234+
)
235235
```
236236

237237
再次获取合约计数以验证:

0 commit comments

Comments
 (0)