Skip to content

Commit 5a2e3cb

Browse files
WGB5445tiangong3624749
authored andcommitted
Updating Move and command line related documentation
1 parent f2ca43b commit 5a2e3cb

13 files changed

+861
-701
lines changed

content/developer/cli/account_manager.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,35 @@ When the node starts, a default account is automatically created with an empty p
1414

1515
```bash
1616
starcoin% account create -p my-pass
17-
+------------+--------------------------------------------------------------------+
18-
| address | 0x8d885d806c14654832aa371c3c980153 |
19-
+------------+--------------------------------------------------------------------+
20-
| is_default | false |
21-
+------------+--------------------------------------------------------------------+
22-
| public_key | 0xf0a2cee9d7c85a40f3f217782b449fab9ba73fa11ab210f11d12305fdf57b908 |
23-
+------------+--------------------------------------------------------------------+
24-
17+
{
18+
"ok": {
19+
"address": "0x8771ab46ae92feef64749b9feaeede9b",
20+
"is_default": false,
21+
"is_readonly": false,
22+
"public_key": "0x50b42d796fd9bceafc5d146aedc1083b36d8ac3bafcebb5a9532a02d9b0f6dbb",
23+
"receipt_identifier": "stc1psac6k34wjtlw7er5nw074mk7nvv4gv6j"
24+
}
25+
}
2526
```
2627

2728
2. Show account
2829

2930
```bash
30-
starcoin% account create -p my-pass
31-
+--------------------+------------------------------------------------------------------------------------------+
32-
| address | 0x812a1a9c8f03a008f96ae412baa69be8 |
33-
+--------------------+------------------------------------------------------------------------------------------+
34-
| is_default | false |
35-
+--------------------+------------------------------------------------------------------------------------------+
36-
| is_readonly | false |
37-
+--------------------+------------------------------------------------------------------------------------------+
38-
| public_key | 0x36012395c6ddf99cc4e6d60f35ac24b59c3a930d5e2611ac39d8bdfac2bfecf4 |
39-
+--------------------+------------------------------------------------------------------------------------------+
40-
| receipt_identifier | stc1psy4p48y0qwsq37t2usft4f5maq7nrgfm |
41-
+--------------------+------------------------------------------------------------------------------------------+
31+
starcoin% account show 0x8771ab46ae92feef64749b9feaeede9b
32+
{
33+
"ok": {
34+
"account": {
35+
"address": "0x8771ab46ae92feef64749b9feaeede9b",
36+
"is_default": false,
37+
"is_readonly": false,
38+
"public_key": "0x50b42d796fd9bceafc5d146aedc1083b36d8ac3bafcebb5a9532a02d9b0f6dbb",
39+
"receipt_identifier": "stc1psac6k34wjtlw7er5nw074mk7nvv4gv6j"
40+
},
41+
"auth_key": "0x047647886667905740b3e671854954b18771ab46ae92feef64749b9feaeede9b",
42+
"balances": {},
43+
"sequence_number": null
44+
}
45+
}
4246
```
4347

4448
- address is the address of the account.
@@ -62,9 +66,9 @@ To view the default account address.
6266
```bash
6367
starcoin% account default
6468
```
65-
Set 0x812a1a9c8f03a008f96ae412baa69be8 to the default address.
69+
Set 0x8771ab46ae92feef64749b9feaeede9b to the default address.
6670
```bash
67-
starcoin% account default 0x812a1a9c8f03a008f96ae412baa69be8
71+
starcoin% account default 0x8771ab46ae92feef64749b9feaeede9b
6872
```
6973

7074
5. Export and import accounts
@@ -73,17 +77,17 @@ In order to avoid losing your assets due to disk corruption and other reasons, i
7377

7478
Execute the following command:
7579
```bash
76-
starcoin% account export 0x812a1a9c8f03a008f96ae412baa69be8 -p my-pass
80+
starcoin% account export 0x8771ab46ae92feef64749b9feaeede9b -p my-pass
7781
```
78-
to export the private key of 0x8d885d806c14654832aa371c3c980153.
82+
to export the private key of 0x8771ab46ae92feef64749b9feaeede9b.
7983

8084
Execute the following command:
8185

8286
```bash
83-
starcoin% account import -i <private-key> -p my-pass 0x812a1a9c8f03a008f96ae412baa69be8
87+
starcoin% account import -i <private-key> -p my-pass 0x8771ab46ae92feef64749b9feaeede9b
8488
```
8589

86-
This will import the 0x812a1a9c8f03a008f96ae412baa69be8 account. This command can also be used to import the account to a different node and used to do node migration.
90+
This will import the 0x8771ab46ae92feef64749b9feaeede9b account. This command can also be used to import the account to a different node and used to do node migration.
8791

8892
6. Import readonly accounts
8993

@@ -100,7 +104,7 @@ Then set the account as the default account.
100104
7. Remove account
101105

102106
```bash
103-
starcoin% account remove 0x812a1a9c8f03a008f96ae412baa69be8 -p my-pass
107+
starcoin% account remove 0x8771ab46ae92feef64749b9feaeede9b -p my-pass
104108
```
105109

106110
If it is a read-only account, you do not need to pass the -p parameter. Deleting an account only deletes the account from the node wallet and does not affect the account on the chain.

content/developer/cli/account_manager.zh.md

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,35 @@ Starcoin 节点内置了一个去中心化的钱包,用户可以通过账号
1313

1414
```bash
1515
starcoin% account create -p my-pass
16-
+--------------------+------------------------------------------------------------------------------------------+
17-
| address | 0x812a1a9c8f03a008f96ae412baa69be8 |
18-
+--------------------+------------------------------------------------------------------------------------------+
19-
| is_default | false |
20-
+--------------------+------------------------------------------------------------------------------------------+
21-
| is_readonly | false |
22-
+--------------------+------------------------------------------------------------------------------------------+
23-
| public_key | 0x36012395c6ddf99cc4e6d60f35ac24b59c3a930d5e2611ac39d8bdfac2bfecf4 |
24-
+--------------------+------------------------------------------------------------------------------------------+
25-
| receipt_identifier | stc1psy4p48y0qwsq37t2usft4f5maq7nrgfm |
26-
+--------------------+------------------------------------------------------------------------------------------+
27-
16+
{
17+
"ok": {
18+
"address": "0x8771ab46ae92feef64749b9feaeede9b",
19+
"is_default": false,
20+
"is_readonly": false,
21+
"public_key": "0x50b42d796fd9bceafc5d146aedc1083b36d8ac3bafcebb5a9532a02d9b0f6dbb",
22+
"receipt_identifier": "stc1psac6k34wjtlw7er5nw074mk7nvv4gv6j"
23+
}
24+
}
2825
```
2926

3027
2. 查看账号
3128

3229
```bash
33-
starcoin% account show 0x812a1a9c8f03a008f96ae412baa69be8
34-
+----------------------------+------------------------------------------------------------------------------------------+
35-
| account.address | 0x812a1a9c8f03a008f96ae412baa69be8 |
36-
+----------------------------+------------------------------------------------------------------------------------------+
37-
| account.is_default | false |
38-
+----------------------------+------------------------------------------------------------------------------------------+
39-
| account.is_readonly | false |
40-
+----------------------------+------------------------------------------------------------------------------------------+
41-
| account.public_key | 0x36012395c6ddf99cc4e6d60f35ac24b59c3a930d5e2611ac39d8bdfac2bfecf4 |
42-
+----------------------------+------------------------------------------------------------------------------------------+
43-
| account.receipt_identifier | stc1psy4p48y0qwsq37t2usft4f5maq7nrgfm |
44-
+----------------------------+------------------------------------------------------------------------------------------+
45-
| auth_key | 0x7b9eb1fcbeb82e47c3e8958f4c5a2a97812a1a9c8f03a008f96ae412baa69be8 |
46-
+----------------------------+------------------------------------------------------------------------------------------+
47-
| sequence_number | |
48-
+----------------------------+------------------------------------------------------------------------------------------+
49-
30+
starcoin% account show 0x8771ab46ae92feef64749b9feaeede9b
31+
{
32+
"ok": {
33+
"account": {
34+
"address": "0x8771ab46ae92feef64749b9feaeede9b",
35+
"is_default": false,
36+
"is_readonly": false,
37+
"public_key": "0x50b42d796fd9bceafc5d146aedc1083b36d8ac3bafcebb5a9532a02d9b0f6dbb",
38+
"receipt_identifier": "stc1psac6k34wjtlw7er5nw074mk7nvv4gv6j"
39+
},
40+
"auth_key": "0x047647886667905740b3e671854954b18771ab46ae92feef64749b9feaeede9b",
41+
"balances": {},
42+
"sequence_number": null
43+
}
44+
}
5045
```
5146

5247
- address 是账户地址
@@ -72,9 +67,9 @@ starcoin% account list
7267
```bash
7368
starcoin% account default
7469
```
75-
0x812a1a9c8f03a008f96ae412baa69be8 设置位默认地址。
70+
0x8771ab46ae92feef64749b9feaeede9b 设置位默认地址。
7671
```bash
77-
starcoin% account default 0x812a1a9c8f03a008f96ae412baa69be8
72+
starcoin% account default 0x8771ab46ae92feef64749b9feaeede9b
7873
```
7974

8075
5. 导出导入账号
@@ -83,17 +78,17 @@ starcoin% account default 0x812a1a9c8f03a008f96ae412baa69be8
8378

8479
执行以下命令:
8580
```bash
86-
starcoin% account export 0x812a1a9c8f03a008f96ae412baa69be8 -p my-pass
81+
starcoin% account export 0x8771ab46ae92feef64749b9feaeede9b -p my-pass
8782
```
88-
即可导出 0x812a1a9c8f03a008f96ae412baa69be8 的私钥。
83+
即可导出 0x8771ab46ae92feef64749b9feaeede9b 的私钥。
8984

9085
执行以下命令:
9186

9287
```bash
93-
starcoin% account import -i <private-key> -p my-pass 0x812a1a9c8f03a008f96ae412baa69be8
88+
starcoin% account import -i <private-key> -p my-pass 0x8771ab46ae92feef64749b9feaeede9b
9489
```
9590

96-
即可导入 0x812a1a9c8f03a008f96ae412baa69be8 账号。这个命令也可以用于将账号导入到不同的节点上,用来做节点迁移。
91+
即可导入 0x8771ab46ae92feef64749b9feaeede9b 账号。这个命令也可以用于将账号导入到不同的节点上,用来做节点迁移。
9792

9893
6. 导入只读账号
9994

@@ -108,7 +103,7 @@ starcoin% account import-readonly -i <public-key>
108103
7. 删除账号
109104

110105
```bash
111-
starcoin% account remove 0x812a1a9c8f03a008f96ae412baa69be8 -p my-pass
106+
starcoin% account remove 0x8771ab46ae92feef64749b9feaeede9b -p my-pass
112107
```
113108

114109
如果是只读账号,无需传递 -p 参数。删除账号只是将账号从节点钱包中删除,并不影响该账号在链上的状态。

content/developer/cli/first_transaction.md

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Let's say you've run up a starcoin dev node locally.
2121
### Create an account
2222

2323
After connecting to the node, let's first create two accounts. Here we assume that both accounts have been created successfully,
24-
Alice is the default account with the address 0x988acf6d210701242af03cbb13780745 and Bob's address is 0x1179ec968815ded9c59775274446ad4c ,
25-
receipt_identifier is stc1pz9u7e95gzh0dn3vhw5n5g34dfsxum2pt .
24+
Alice is the default account with the address 0xfa635e304e0c1accf59e6ed211998158 and Bob's address is 0x76a12ea4a733de0fae0cf329083d1952 .
2625

2726
### Use Faucet to top up your account
2827

@@ -40,25 +39,26 @@ The output of the command is the transaction data issued by the FAUCET account
4039
Wait a few seconds and then check your account information again.
4140

4241
```bash
43-
starcoin% account show 0x988acf6d210701242af03cbb13780745
44-
+--------------------+------------------------------------------------------------------------------------------+
45-
| account.address | 0x988acf6d210701242af03cbb13780745 |
46-
+--------------------+------------------------------------------------------------------------------------------+
47-
| account.is_default | true |
48-
+--------------------+------------------------------------------------------------------------------------------+
49-
| account.public_key | 0xd574c33580942a124b377c0fa64c0d1c021c405893ac99b1cf77a44dc530e4b2 |
50-
+--------------------+------------------------------------------------------------------------------------------+
51-
| auth_key | 0x6d9ca71670371e406e6e7821c4560f31988acf6d210701242af03cbb13780745 |
52-
+--------------------+------------------------------------------------------------------------------------------+
53-
| receipt_identifier | stc1pnz9v7mfpquqjg2hs8ja3x7q8g5fsudrg |
54-
+--------------------+------------------------------------------------------------------------------------------+
55-
| sequence_number | 0 |
56-
+--------------------+------------------------------------------------------------------------------------------+
57-
| balances.STC | 100000000000 |
58-
+--------------------+------------------------------------------------------------------------------------------+
42+
starcoin% account show 0xfa635e304e0c1accf59e6ed211998158
43+
{
44+
"ok": {
45+
"account": {
46+
"address": "0xfa635e304e0c1accf59e6ed211998158",
47+
"is_default": true,
48+
"is_readonly": false,
49+
"public_key": "0xcf6af68573e8cc232e99aeb11ba2786c8e3f94d90108b1239c36154cd1a75788",
50+
"receipt_identifier": "stc1plf34uvzwpsdveav7dmfprxvptqrzyhqp"
51+
},
52+
"auth_key": "0x5007518ade0231dd0ebb785ba3cc3ecffa635e304e0c1accf59e6ed211998158",
53+
"balances": {
54+
"0x00000000000000000000000000000001::STC::STC": 100000000000
55+
},
56+
"sequence_number": 0
57+
}
58+
}
5959
```
6060

61-
Now, `balances` and `sequence_number` is filled.
61+
Now, `balances` is filled.
6262

6363

6464

@@ -75,11 +75,11 @@ where `-p my-pass` is the password that was needed when creating the account, if
7575
Once the account is unlocked, execute the following command.
7676

7777
```bash
78-
starcoin% account transfer -s 0x988acf6d210701242af03cbb13780745 -r stc1pz9u7e95gzh0dn3vhw5n5g34dfsxum2pt -v 10000 -b
78+
starcoin% account execute-function --function 0x1::TransferScripts::peer_to_peer_v2 -t 0x1::STC::STC --arg 0x76a12ea4a733de0fae0cf329083d1952 --arg 10000u128 -s 0xfa635e304e0c1accf59e6ed211998158
7979
```
8080

81-
- `-s 0x988acf6d210701242af03cbb13780745`: is Alice's account address.
82-
- `-r stc1pz9u7e95gzh0dn3vhw5n5g34dfsxum2pt`: is Bob's receipt_identifier.
81+
- `-s 0xfa635e304e0c1accf59e6ed211998158`: is Alice's account address.
82+
- `-r 0x76a12ea4a733de0fae0cf329083d1952`: is Bob's account address.
8383

8484
> If, Bob's account does not yet exist on the chain, the transfer transaction will automatically create Bob's account on the chain.
8585
@@ -90,22 +90,23 @@ Then check Bob's account information again:.
9090

9191

9292
``` bash
93-
starcoin% account show 0x1179ec968815ded9c59775274446ad4c
94-
+----------------------------+------------------------------------------------------------------------------------------+
95-
| account.address | 0x1179ec968815ded9c59775274446ad4c |
96-
+----------------------------+------------------------------------------------------------------------------------------+
97-
| account.is_default | false |
98-
+----------------------------+------------------------------------------------------------------------------------------+
99-
| account.public_key | 0xfacd584290ee7baea7fe8e22d13332633babca46e77c0ca941b6b5c6266523cb |
100-
+----------------------------+------------------------------------------------------------------------------------------+
101-
| account.receipt_identifier | stc1pz9u7e95gzh0dn3vhw5n5g34dfsxum2pt |
102-
+----------------------------+------------------------------------------------------------------------------------------+
103-
| auth_key | 0xce10e8b810895d64f3d3fe1cd2307cf61179ec968815ded9c59775274446ad4c |
104-
+----------------------------+------------------------------------------------------------------------------------------+
105-
| sequence_number | 0 |
106-
+----------------------------+------------------------------------------------------------------------------------------+
107-
| balances.STC | 10000 |
108-
+----------------------------+------------------------------------------------------------------------------------------+
93+
starcoin% account show 0x76a12ea4a733de0fae0cf329083d1952
94+
{
95+
"ok": {
96+
"account": {
97+
"address": "0x76a12ea4a733de0fae0cf329083d1952",
98+
"is_default": false,
99+
"is_readonly": false,
100+
"public_key": "0xabd226b1b90b0e969d1db3f937d600006f4c5db342ef3f8bc49a555e9c2fea2b",
101+
"receipt_identifier": "stc1pw6sjaf98x00qltsv7v5ss0ge2gnl9jpv"
102+
},
103+
"auth_key": "0x891410477b6abc7c95bb8eff9cdcf9af76a12ea4a733de0fae0cf329083d1952",
104+
"balances": {
105+
"0x00000000000000000000000000000001::STC::STC": 10000
106+
},
107+
"sequence_number": 0
108+
}
109+
}
109110
```
110111

111112
Bob has the money now!

0 commit comments

Comments
 (0)