@@ -31,7 +31,7 @@ rustup show
31
31
32
32
确保在'installed targets'下显示'wasm32-unknown-unknown'。
33
33
34
- ### 1.3 接着安装[ cargo-generate] ( https://github.com/ashleygwilliams/cargo-generate ) 和cargo-run-script。
34
+ ### 1.3 接着安装[ cargo-generate] ( https://github.com/ashleygwilliams/cargo-generate ) 和cargo-run-script:
35
35
36
36
``` sh
37
37
cargo install cargo-generate --features vendored-openssl
@@ -46,7 +46,7 @@ cargo --list
46
46
47
47
确保命令列表中显示'generate'和'run-script'。
48
48
49
- ### 1.4 最后安装Injectived
49
+ ### 1.4 最后安装Injectived:
50
50
51
51
``` sh
52
52
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v1.15.0-1748457819/linux-amd64.zip
@@ -63,9 +63,9 @@ injectived version
63
63
64
64
## 2. 创建Counter项目
65
65
66
- ### 2.1 创建Counter合约
66
+ ### 2.1 创建项目
67
67
68
- 现在, 创建Counter项目,转到放置它的文件夹并运行 :
68
+ 创建Counter项目,并转到它的文件夹 :
69
69
70
70
``` sh
71
71
cargo generate --git https://github.com/CosmWasm/cw-template.git --name counter
@@ -99,7 +99,7 @@ docker run --rm -v "$(pwd)":/code \
99
99
cosmwasm/optimizer:0.16.0
100
100
```
101
101
102
- 或者,如果你在arm64机器上,你应该使用为arm64构建的docker镜像。
102
+ 或者,如果你在arm64机器上,你应该使用为arm64构建的docker镜像:
103
103
104
104
``` sh
105
105
docker run --rm -v " $( pwd) " :/code \
@@ -125,7 +125,7 @@ injectived config set client node https://k8s.testnet.tm.injective.network:443
125
125
injectived q bank balances ACCOUNT_ADDRESS
126
126
```
127
127
128
- 确保显示账户余额 。
128
+ 确保账户余额能正确显示 。
129
129
130
130
### 3.2 添加钱包账户:
131
131
@@ -142,6 +142,12 @@ injectived keys unsafe-import-eth-key ACCOUNT_NAME $PRIVATE_KEY
142
142
injectived keys list
143
143
```
144
144
145
+ 确保账户内有INJ测试币:
146
+
147
+ ``` sh
148
+ injectived q bank balances ACCOUNT_ADDRESS
149
+ ```
150
+
145
151
### 3.3 上传WSAM合约:
146
152
147
153
``` sh
@@ -159,7 +165,7 @@ yes $KEYRING_PASSWORD | injectived tx wasm store artifacts/counter.wasm \
159
165
injectived query tx $TRANSACTION_HASH --node=https://testnet.sentry.tm.injective.network:443
160
166
```
161
167
162
- 记下node id。
168
+ 记下code id。
163
169
164
170
## 4. 与合约交互:
165
171
@@ -194,7 +200,7 @@ injectived query wasm contract-state smart $CONTRACT_ADDRESS "$GET_COUNT_QUERY"
194
200
--output json
195
201
```
196
202
197
- ## 4.4 执行Increment程序:
203
+ ### 4.4 执行Increment程序:
198
204
199
205
``` sh
200
206
INCREMENT=' {"increment":{}}'
@@ -205,7 +211,7 @@ yes $KEYRING_PASSWORD | injectived tx wasm execute $CONTRACT_ADDRESS "$INCREMENT
205
211
--output json
206
212
```
207
213
208
- 验证Increment :
214
+ 再次获取合约计数以验证 :
209
215
210
216
``` sh
211
217
GET_COUNT_QUERY=' {"get_count":{}}'
0 commit comments