Skip to content

Commit 9783e34

Browse files
committed
add mytonctrl init paragraph
1 parent 3b7697d commit 9783e34

File tree

12 files changed

+119
-0
lines changed

12 files changed

+119
-0
lines changed

docs/participate/run-nodes/mytonctrl.mdx

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,125 @@ Actually, there is [MyTonCtrl2](https://github.com/ton-blockchain/mytonctrl/tree
1111
We are actively seeking feedback about the installation process. If you have any questions or suggestions, please [contact us](https://t.me/Alexgton).
1212

1313

14+
## Wallet management
15+
16+
### Importing a wallet
17+
18+
MyTonCtrl2 supports various types of wallet-like contracts, including wallet-v1, wallet-v3, [lockup-wallet](https://github.com/ton-blockchain/lockup-wallet-contract/tree/main/universal), and others. Often, it provides a straightforward way to interact with these contracts.
19+
20+
#### Importing Using a Private Key
21+
22+
If you have access to a private key, you can easily import a wallet:
23+
24+
```bash
25+
MyTonCtrl> iw <wallet-addr> <wallet-secret-key>
26+
```
27+
28+
Here, `<wallet-secret-key>` is your private key in base64 format.
29+
30+
#### Importing Using a Mnemonic Phrase
31+
32+
If you have a mnemonic phrase (a sequence of 24 words like `tattoo during ...`), follow these steps:
33+
34+
1. Install Node.js.
35+
2. Clone and install [mnemonic2key](https://github.com/ton-blockchain/mnemonic2key):
36+
```
37+
git clone https://github.com/ton-blockchain/mnemonic2key.git
38+
cd mnemonic2key
39+
npm install
40+
```
41+
3. Run the following command, replacing `word1`, `word2`... with your mnemonic phrase and `address` with the address of your wallet contract:
42+
```
43+
node index.js word1 word2 ... word24 [address]
44+
```
45+
4. The script will generate `wallet.pk` and `wallet.addr`. Rename them to `imported_wallet.pk` and `imported_wallet.addr`.
46+
5. Copy both files to the `~/.local/share/mytoncore/wallets/` directory.
47+
6. Open the mytonctrl console and list the wallets using the `wl` command.
48+
7. Verify that the wallet has been imported and displays the correct balance.
49+
8. You can now send funds using the `mg` command. Enter `mg` to view the help documentation.
50+
Remember to replace placeholders (words inside `< >`) with your actual values when running commands.
51+
52+
### Show the list of wallets
53+
54+
```bash
55+
MyTonCtrl> wl
56+
```
57+
58+
![](/img/docs/mytonctrl/wl.png)
59+
60+
61+
### Create a new local wallet
62+
63+
Also you can create new empty wallet:
64+
65+
```bash
66+
MyTonCtrl> nw <workchain-id> <wallet-name> [<version> <subwallet>]
67+
```
68+
69+
### Activate a local wallet
70+
71+
If you want to use wallet it have to be activated:
72+
73+
```bash
74+
MyTonCtrl> aw <wallet-name>
75+
```
76+
77+
But before activating, send 1 Toncoin to wallet:
78+
79+
```bash
80+
MyTonCtrl> wl
81+
Name Status Balance Ver Wch Address
82+
validator_wallet_001 active 994.776032511 v1 -1 kf_dctjwS4tqWdeG4GcCLJ53rkgxZOGGrdDzHJ_mxPkm_Xct
83+
wallet_004 uninit 0.0 v1 0 0QBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Kbs
84+
85+
MyTonCtrl> mg validator_wallet_001 0QBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Kbs 1
86+
```
87+
88+
Then activate it:
89+
90+
```bash
91+
MyTonCtrl> aw wallet_004
92+
ActivateWallet - OK
93+
94+
MyTonCtrl> wl
95+
Name Status Balance Ver Wch Address
96+
validator_wallet_001 active 994.776032511 v1 -1 kf_dctjwS4tqWdeG4GcCLJ53rkgxZOGGrdDzHJ_mxPkm_Xct
97+
wallet_004 active 0.998256399 v1 0 kQBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Psp
98+
```
99+
100+
### Get the sequence number of the wallet
101+
102+
```bash
103+
MyTonCtrl> seqno <wallet-name>
104+
```
105+
106+
![](/img/docs/mytonctrl/nw.png)
107+
108+
### Set a wallet version
109+
110+
This command is needed when a modified wallet with interaction methods similar to a regular one is used.
111+
112+
```bash
113+
MyTonCtrl> swv <wallet-addr> <wallet-version>
114+
```
115+
116+
### Export a wallet
117+
118+
It's possible to get a certain wallet address and secret key.
119+
120+
```bash
121+
MyTonCtrl> ew <wallet-name>
122+
```
123+
124+
![](/img/docs/mytonctrl/ew.png)
125+
126+
### Delete a local wallet
127+
128+
```bash
129+
MyTonCtrl> dw <wallet-name>
130+
```
131+
132+
![](/img/docs/mytonctrl/dw.png)
14133

15134

16135
## See Also

static/img/docs/mytonctrl/bl.png

43.7 KB
Loading

static/img/docs/mytonctrl/db.png

8.96 KB
Loading

static/img/docs/mytonctrl/dw.png

80.9 KB
Loading

static/img/docs/mytonctrl/ew.png

353 KB
Loading

static/img/docs/mytonctrl/nb.png

20.9 KB
Loading

static/img/docs/mytonctrl/nw.png

119 KB
Loading
109 KB
Loading
20.6 KB
Loading

static/img/docs/mytonctrl/vah.png

180 KB
Loading

static/img/docs/mytonctrl/vas.png

228 KB
Loading

static/img/docs/mytonctrl/wl.png

277 KB
Loading

0 commit comments

Comments
 (0)