Skip to content

Commit 2001bcd

Browse files
committed
Updated README.md
1 parent 1b54263 commit 2001bcd

File tree

1 file changed

+45
-25
lines changed

1 file changed

+45
-25
lines changed

README.md

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,88 @@
22

33
### 1.1 首先安装Rust:
44

5-
```sh
6-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
7-
# 将Rust加载到当前shell会话中
8-
source "$HOME/.cargo/env"
9-
```
10-
11-
验证安装:
5+
确认系统是否已安装Rust:
126

137
```sh
148
rustc --version
159
cargo --version
1610
```
1711

18-
### 1.2 其次安装`wasm32-unknown-unknown` target:
12+
如果没有,请通过下列命令安装:
1913

2014
```sh
21-
rustup target add wasm32-unknown-unknown
15+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
16+
17+
# 将Rust加载到当前shell会话中
18+
source "$HOME/.cargo/env"
2219
```
2320

24-
验证安装:
21+
### 1.2 其次安装`wasm32-unknown-unknown` target:
22+
23+
确认是否已安装wasm32-unknown-unknown:
2524

2625
```sh
2726
rustup target list --installed
2827
# 或使用
2928
rustup show
3029
```
3130

32-
确保在'installed targets'下显示'wasm32-unknown-unknown'。
31+
'installed targets'下应该显示'wasm32-unknown-unknown',如果没有,请通过下列命令安装:
32+
33+
```sh
34+
rustup target add wasm32-unknown-unknown
35+
```
36+
3337

3438
### 1.3 接着安装[cargo-generate](https://github.com/ashleygwilliams/cargo-generate)和cargo-run-script:
3539

40+
确认是否已安装'cargo generate'和'cargo run-script':
41+
42+
```sh
43+
cargo --list
44+
```
45+
46+
命令列表中应显示'generate'和'run-script',如果没有,请通过下列命令安装:
47+
3648
```sh
3749
cargo install cargo-generate --features vendored-openssl
50+
3851
cargo install cargo-run-script
3952
```
4053

41-
验证安装:
54+
### 1.4 然后安装Injectived:
55+
56+
确认是否已安装injectived:
4257

4358
```sh
44-
cargo --list
59+
injectived version
4560
```
4661

47-
确保命令列表中显示'generate'和'run-script'。
48-
49-
### 1.4 最后安装Injectived:
62+
如果没有,请通过下列命令安装:
5063

5164
```sh
5265
wget https://github.com/InjectiveLabs/injective-chain-releases/releases/download/v1.15.0-1748457819/linux-amd64.zip
66+
5367
unzip linux-amd64.zip
68+
5469
sudo mv injectived peggo /usr/bin
5570
sudo mv libwasmvm.x86_64.so /usr/lib
5671
```
5772

58-
验证安装:
73+
### 1.5 最后安装yj:
74+
75+
确认是否已安装yj:
5976

6077
```sh
61-
injectived version
78+
yj --version
79+
```
80+
81+
如果没有,请通过下列命令安装:
82+
83+
```sh
84+
sudo curl -L https://github.com/sclevine/yj/releases/latest/download/yj-linux-amd64 -o /usr/local/bin/yj
85+
86+
sudo chmod +x /usr/local/bin/yj
6287
```
6388

6489
## 2. 创建Counter项目
@@ -160,16 +185,13 @@ TXHASH=$(
160185
--node=https://testnet.sentry.tm.injective.network:443 \
161186
| yj -yj | jq -r .txhash
162187
)
163-
164188
echo "txhash: $TXHASH"
165189

166190
# 得到Code ID
167191
CODE_ID=$(
168192
injectived query tx $TXHASH --node=https://testnet.sentry.tm.injective.network:443 \
169-
| yj -yj | jq .events[] -c | jq .attibutes[] -c \
170-
| grep code_id | jq -r .value | head -n1
193+
| yj -yj | jq -r '.events[] | select(.type == "store_code") | .attributes[] | select(.key == "code_id") | .value'
171194
)
172-
173195
echo "code_id: $CODE_ID"
174196
```
175197

@@ -191,16 +213,14 @@ TXHASH=$(
191213
--node=https://testnet.sentry.tm.injective.network:443 \
192214
| yj -yj | jq -r .txhash
193215
)
194-
195216
echo "txhash: $TXHASH"
196217

197218
# 得到合约地址
198219
CONTRACT=$(
199220
injectived query tx $TXHASH --node=https://testnet.sentry.tm.injective.network:443 \
200-
| yj -yj | jq .events[] -c | jq .attibutes[] -c \
221+
| yj -yj | jq .events[] -c | jq .attributes[] -c \
201222
| grep contract_address | jq -r .value | head -n1
202223
)
203-
204224
echo "contract: $CONTRACT"
205225
```
206226

0 commit comments

Comments
 (0)