Skip to content

Commit

Permalink
Examples (#736)
Browse files Browse the repository at this point in the history
* Update examples & add -t flag explanation

* Complete examples

---------

Co-authored-by: Full-Hat <nikita3131228@gmail.com>
  • Loading branch information
pixelplex and Full-Hat authored Aug 30, 2024
1 parent 57e7b5d commit 1d7b5c4
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/participate/run-nodes/full-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ This will reduce synchronization time by several times.
* `-c <path>` - If you want to use not public liteservers for synchronization. _(not required)_
* `-i` - Ignore minimum requirements, use it only if you want to check compilation process without real node usage.
* `-m` - Mode, can be `validator` or `liteserver`.
* `-t` - Disable telemetry.

**To use testnet**, `-c` flag should be provided with `https://ton.org/testnet-global.config.json` value.

Expand Down
149 changes: 139 additions & 10 deletions docs/participate/run-nodes/mytonctrl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ Enable a specific mode.
MyTonCtrl> enable_mode <mode_name>
```

Example:

```bash
MyTonCtrl> enable_mode validator
```

### disable_mode

Disable a specific mode.
Expand All @@ -83,6 +89,12 @@ Disable a specific mode.
MyTonCtrl> disable_mode <mode_name>
```

Example:

```bash
MyTonCtrl> disable_mode validator
```

### about

Provide a description of the specified mode
Expand All @@ -91,12 +103,24 @@ Provide a description of the specified mode
MyTonCtrl> about <mode_name>
```

Example:

```bash
MyTonCtrl> about validator
```

### get

Get the value of a specific setting in JSON format

```bash
MyTonCtrl> setting <setting_name>
MyTonCtrl> get <setting_name>
```

Example:

```bash
MyTonCtrl> get stake
```

### set
Expand All @@ -107,16 +131,28 @@ Set the specified value of a specified setting. Skip setting existence checking
MyTonCtrl> set <setting> <value> [--force]
```

Example:

```bash
MyTonCtrl> set stake 9000
```

### rollback

No args, rollback to mytonctrl 1.0.
No args, rollback to mytonctrl 1.0. You shouldn't use mytonctrl 1.0 in any case.

### getconfig

Retrieves and prints the JSON representation of the configuration specified by `<config-id>`

```bash
MyTonCtrl> getconfig <config_id>
MyTonCtrl> getconfig <config_id> # config id can be omitted
```

Example:

```bash
MyTonCtrl> getconfig 0
```

### get_pool_data
Expand All @@ -127,8 +163,16 @@ Retrieves and prints the JSON representation of the pool data specified by `<poo
MyTonCtrl> get_pool_data <<pool-name> | <pool-addr>>
```
Example:
```bash
get_pool_data pool_name # you can check possible pool names using ls /home/install_mytonctrl/.local/share/mytoncore/pools
```
## Overlays
Read more about [overlays here](/participate/network-maintenance/custom-overlays).
### add_custom_overlay
Adds a custom overlay with the given `<name>` using the configuration specified by `<path_to_config>`
Expand All @@ -137,6 +181,12 @@ Adds a custom overlay with the given `<name>` using the configuration specified
MyTonCtrl> add_custom_overlay <name> <path_to_config>
```
Example:
```bash
add_custom_overlay custom /config.json # check link from above to know what config this command requires (https://docs.ton.org/participate/network-maintenance/custom-overlays)
```
### list_custom_overlays
No args, prints custom overlays
Expand All @@ -156,7 +206,7 @@ MyTonCtrl> delete_custom_overlay <name>
Votes for the offer specified by `<offer-hash>`
```bash
MyTonCtrl> vo <offer-hash>
MyTonCtrl> vo <offer-hash> # use `ol` to get offers
```
### ve
Expand All @@ -168,11 +218,19 @@ No args, vote for election
Votes for the complaint specified by `<complaint-hash>` in the election specified by `<election-id>`
```bash
MyTonCtrl> vc <<election-id>, <complaint-hash>>
MyTonCtrl> vc <election-id> <complaint-hash>
```
Actually, even this will work, but you should use data from your current mytonctrl state:
```bash
MyTonCtrl> vc 0 0
```
## Pool commands
Get more information [at nominator pool page](/participate/network-maintenance/nominator-pool).
### deposit_to_pool
Deposits the specified `<amount>` to the pool specified by `<pool-addr>`
Expand All @@ -181,6 +239,12 @@ Deposits the specified `<amount>` to the pool specified by `<pool-addr>`
MyTonCtrl> deposit_to_pool <pool-addr> <amount>
```
Example:
```bash
MyTonCtrl> deposit_to_pool kf_JcC5pn3etTAdwOnc16_tyMmKE8-ftNUnf0OnUjAIdDJpX 1
```
### withdraw_from_pool
Withdraws the specified `<amount>` from the pool specified by `<pool-addr>`
Expand All @@ -189,6 +253,12 @@ Withdraws the specified `<amount>` from the pool specified by `<pool-addr>`
MyTonCtrl> withdraw_from_pool <pool-addr> <amount>
```
Example:
```bash
MyTonCtrl> withdraw_from_pool kf_JcC5pn3etTAdwOnc16_tyMmKE8-ftNUnf0OnUjAIdDJpX 1
```
### cleanup
No args, cleanup validator database
Expand All @@ -199,6 +269,8 @@ No args, prints table with several tests
## Single pool
Get more information [at single nominator pool page](/participate/network-maintenance/nominator-pool).
### new_single_pool
Creates a new single pool with the specified `<pool-name>` and `<owner-address>`
Expand All @@ -207,12 +279,18 @@ Creates a new single pool with the specified `<pool-name>` and `<owner-address>`
MyTonCtrl> new_single_pool <pool-name> <owner-address>
```
Example:
```bash
MyTonCtrl> new_single_pool name kf9tZrL46Xjux3ZqvQFSgQkOIlteJK52slSYWbasqtOjrKUT
```
### activate_single_pool
Activates the single pool specified by `<pool-name>`
```bash
MyTonCtrl> activate_single_pool <pool-name>
MyTonCtrl> activate_single_pool <pool-name> # pool name from above
```
## Wallet management
Expand All @@ -231,6 +309,11 @@ MyTonCtrl> iw <wallet-addr> <wallet-secret-key>
Here, `<wallet-secret-key>` is your private key in base64 format.
Example:
```bash
MyTonCtrl> iw kf9tZrL46Xjux3ZqvQFSgQkOIlteJK52slSYWbasqtOjrKUT AAAH++/ve+/vXrvv73vv73vv73vv71DWu+/vWcpA1E777+92Ijvv73vv70iV++/ve+/vUTvv70d77+9UFjvv71277+9bO+/ve+/vXgzdzzvv71i77+977+9CjLvv73vv73vv71i77+9Bu+/vV0oJe+/ve+/vUPvv73vv73vv70=
```
#### Importing Using a Mnemonic Phrase
If you have a mnemonic phrase (a sequence of 24 words like `tattoo during ...`), follow these steps:
Expand Down Expand Up @@ -270,9 +353,15 @@ Also you can create new empty wallet:
MyTonCtrl> nw <workchain-id> <wallet-name> [<version> <subwallet>]
```
Example:
```bash
MyTonCtrl> nw 0 name v3 # by default subwallet is 0x29A9A317 + workchain
```
### Activate a local wallet
If you want to use wallet it have to be activated:
If you want to use wallet, it has to be activated:
```bash
MyTonCtrl> aw <wallet-name>
Expand Down Expand Up @@ -317,6 +406,12 @@ This command is needed when a modified wallet with interaction methods similar t
MyTonCtrl> swv <wallet-addr> <wallet-version>
```
Example:
```bash
MyTonCtrl> swv kf9tZrL46Xjux3ZqvQFSgQkOIlteJK52slSYWbasqtOjrKUT v3
```
### Export a wallet
It's possible to get a certain wallet address and secret key.
Expand All @@ -343,7 +438,7 @@ MyTonCtrl> dw <wallet-name>
To check account status and its transaction history use the following command:
```bash
MyTonCtrl> vas <account-addr>
MyTonCtrl> vas <account-addr> # for example you can get address of validator wallet by wl command and use vas to get more information
```
![](/img/docs/mytonctrl/vas.png)
Expand All @@ -353,7 +448,7 @@ MyTonCtrl> vas <account-addr>
To check account transaction history use the following command using the number of listed operations as `limit`:
```bash
MyTonCtrl> vah <account-addr> <limit>
MyTonCtrl> vah <account-addr> <limit> # limit is just unsigned integer number
```
![](/img/docs/mytonctrl/vah.png)
Expand All @@ -366,6 +461,12 @@ Transfer coins from local wallet to an account:
MyTonCtrl> mg <wallet-name> <account-addr | bookmark-name> <amount>
```
Example:
```bash
MyTonCtrl> mg wallet_004 kQBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Psp 1
```
:::caution
Wallet version 'v4' is not supported for the transfering
:::
Expand All @@ -378,6 +479,12 @@ Transfer coins from local wallet to an account through a proxy:
MyTonCtrl> mgtp <wallet-name> <account-addr | bookmark-name> <amount>
```
Example:
```bash
MyTonCtrl> mgtp wallet_004 kQBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Psp 1
```
## General Pools Commands
There are two types of pools in **MyTonCtrl**:
Expand Down Expand Up @@ -409,6 +516,12 @@ You can create already created pool to the list of local pools:
MyTonCtrl> import_pool <pool-name> <pool-addr>
```
Example:
```bash
MyTonCtrl> import_pool name kf_JcC5pn3etTAdwOnc16_tyMmKE8-ftNUnf0OnUjAIdDJpX
```
## Bookmarks
You can create an alias (bookmark) for an account address to simplify it usage.
Expand Down Expand Up @@ -559,6 +672,12 @@ Possible arguments:
| `state-ttl` | ttl of blockchain states that node keep | 3600 |
| `archive-ttl` | ttl of blocks node stores. _To force node not to store archive blocks use the value `86400`_ | 2592000 if liteserver mode was enabled during installation process, otherwise 86400 |
Example:
```bash
MyTonInstaller> set_node_argument --state-ttl 3601
```
### enable
Enable one of the modes, for `ton-http-api` creates config
Expand All @@ -577,10 +696,20 @@ Modes can have following names:
- LSP - ls proxy
- TSP - TON storage + TON storage provider
Example:
```bash
MyTonInstaller> enable FN
```
### update
Same as `enable` of mytoninstaller
```bash
MyTonInstaller> update FN
```
### plsc
Print liteserver config
Expand Down Expand Up @@ -615,7 +744,7 @@ Dangerous recovery validator config file
### setwebpass
Set a password for the web admin interface, runs `python3 /usr/src/mtc-jsonrpc/mtc-jsonrpc.py -p`.
No args. Set a password for the web admin interface, runs `python3 /usr/src/mtc-jsonrpc/mtc-jsonrpc.py -p`.
## See Also
Expand Down

0 comments on commit 1d7b5c4

Please sign in to comment.