@@ -152,23 +152,23 @@ injectived q bank balances ACCOUNT_ADDRESS
152
152
153
153
``` sh
154
154
# 在"injective-core-staging"容器内,或如果本地运行injectived,则在合约目录中
155
- TXHASH=${
155
+ TXHASH=$(
156
156
yes $KEYRING_PASSWORD | injectived tx wasm store artifacts/counter.wasm \
157
157
--from=$( echo $ACCOUNT_ADDRESS ) \
158
158
--chain-id=" injective-888" \
159
159
--yes --fees=1000000000000000inj --gas=2000000 \
160
160
--node=https://testnet.sentry.tm.injective.network:443 \
161
161
| yj -yj | jq -r .txhash
162
- }
162
+ )
163
163
164
164
echo " txhash: $TXHASH "
165
165
166
166
# 得到Code ID
167
- CODE_ID=${
167
+ CODE_ID=$(
168
168
injectived query tx $TXHASH --node=https://testnet.sentry.tm.injective.network:443 \
169
169
| yj -yj | jq .events[] -c | jq .attibutes[] -c \
170
170
| grep code_id | jq -r .value | head -n1
171
- }
171
+ )
172
172
173
173
echo " code_id: $CODE_ID "
174
174
```
@@ -180,7 +180,7 @@ echo "code_id: $CODE_ID"
180
180
``` sh
181
181
INIT=' {"count":99}'
182
182
echo " instantiate: ${INIT} "
183
- TXHASH=${
183
+ TXHASH=$(
184
184
yes $KEYRING_PASSWORD | injectived tx wasm instantiate $CODE_ID $INIT \
185
185
--label=" CounterTestInstance" \
186
186
--from=$( echo $ACCOUNT_ADDRESS ) \
@@ -190,16 +190,16 @@ TXHASH=${
190
190
--no-admin \
191
191
--node=https://testnet.sentry.tm.injective.network:443 \
192
192
| yj -yj | jq -r .txhash
193
- }
193
+ )
194
194
195
195
echo " txhash: $TXHASH "
196
196
197
197
# 得到合约地址
198
- CONTRACT={
198
+ CONTRACT=$(
199
199
injectived query tx $TXHASH --node=https://testnet.sentry.tm.injective.network:443 \
200
200
| yj -yj | jq .events[] -c | jq .attibutes[] -c \
201
201
| grep contract_address | jq -r .value | head -n1
202
- }
202
+ )
203
203
204
204
echo " contract: $CONTRACT "
205
205
```
@@ -225,13 +225,13 @@ injectived query wasm contract-state smart $CONTRACT "$GET_COUNT_QUERY" \
225
225
``` sh
226
226
INCREMENT=' {"increment":{}}'
227
227
echo " execute: ${INCREMENT} "
228
- TXHASH=${
228
+ TXHASH=$(
229
229
yes $KEYRING_PASSWORD | injectived tx wasm execute $CONTRACT " $INCREMENT " --from=$( echo $ACCOUNT_ADDRESS ) \
230
230
--chain-id=" injective-888" \
231
231
--yes --fees=1000000000000000inj --gas=2000000 \
232
232
--node=https://testnet.sentry.tm.injective.network:443 \
233
233
--output json | jq -r .txhash
234
- }
234
+ )
235
235
```
236
236
237
237
再次获取合约计数以验证:
0 commit comments