MyTonCtrl
Overview
To install and manage your own node, use the MyTonCtrl open-source tool developed by the TON Foundation. MyTonCtrl is reliable and tested on most TON nodes.
MyTonCtrl is a console application that is a convenient wrapper for fift, lite-client, and validator-engine-console. It has been specifically developed to streamline the Linux operating system's wallet, domain, and validator management tasks.
We are actively seeking feedback about the installation process. If you have any questions or suggestions, please contact us.
General Commands
help
No args, prints help text.
exit
No args, exits from the console.
update
Updates MyTonCtrl. Param combinations:
Format name | Format | Example | Description |
---|---|---|---|
No args | update | update | Update from current repo |
URL format | update [https://github.com/author/repo/tree/branch] | update https://github.com/ton-blockchain/mytonctrl/tree/test | Update from specified URL |
Branch Only format | update [BRANCH] | update test | Update from specified branch of current repo |
Branch Override format | update [https://github.com/authorName/repoName/tree/branchName] [BRANCH] | update https://github.com/ton-blockchain/mytonctrl/tree/master test | Update the branch specified by the second argument in the designated repository |
upgrade
Updates the node. Param combinations:
Format name | Format | Example | Description |
---|---|---|---|
No args | upgrade | upgrade | Upgrade from current repo |
URL format | upgrade [https://github.com/author/repo/tree/branch] | upgrade https://github.com/ton-blockchain/ton/tree/master | Upgrade from specified URL |
Branch Only format | upgrade [BRANCH] | upgrade master | Upgrade from specified branch of current repo |
Branch Override format | upgrade [https://github.com/authorName/repoName/tree/branchName] [BRANCH] | upgrade https://github.com/ton-blockchain/ton/tree/master testnet | Upgrade from the branch specified by the second argument of the designated repository |
status
Gets current MyTonCtrl and node status. Param combinations:
Format name | Format | Example | Description |
---|---|---|---|
No args | status | status | Full status report including validator efficiency and online validators. |
Fast | status fast | status fast | This must be used on Testnet. The status report should exclude the efficiency of validators and the count of online validators. |
installer
No args, runs the installer of TON modules (script /usr/src/mytonctrl/mytoninstaller.py
).
status_modes
No args, shows MTC modes.
status_settings
No args, shows all available settings with their description and values.
enable_mode
Enables a specific mode.
MyTonCtrl> enable_mode <mode_name>
Example:
MyTonCtrl> enable_mode validator
disable_mode
Disables a specific mode.
MyTonCtrl> disable_mode <mode_name>
Example:
MyTonCtrl> disable_mode validator
about
Provides a description of the specified mode.
MyTonCtrl> about <mode_name>
Example:
MyTonCtrl> about validator
get
Gets the value of a specific setting in JSON format.
MyTonCtrl> get <setting_name>
Example:
MyTonCtrl> get stake
set
Sets the specified value for a given setting. Skip the check for setting existence if --force
is enabled.
MyTonCtrl> set <setting> <value> [--force]
Example:
MyTonCtrl> set stake 9000
rollback
No args, rollbacks to MyTonCtrl 1.0. You should avoid using MyTonCtrl 1.0 under any circumstances.
getconfig
Retrieves and displays the JSON representation of the configuration specified by <config-id>
.
MyTonCtrl> getconfig <config_id> # config id can be omitted
Example:
MyTonCtrl> getconfig 0
get_pool_data
Retrieves and displays the JSON representation of the pool data specified by <pool-name>
or <pool-addr>
.
MyTonCtrl> get_pool_data <<pool-name> | <pool-addr>>
Example:
get_pool_data pool_name # you can check possible pool names using ls /home/install_mytonctrl/.local/share/mytoncore/pools
Overlays
To better understand overlays, read the information here.
add_custom_overlay
Adds a custom overlay with the given <name>
using the configuration specified by <path_to_config>
.
MyTonCtrl> add_custom_overlay <name> <path_to_config>
Example:
add_custom_overlay custom /config.json
# check link from above to know what config this command requires (/v3/guidelines/nodes/custom-overlays)
list_custom_overlays
No args, prints custom overlays.
delete_custom_overlay
Deletes the custom overlay with the specified <name>
.
MyTonCtrl> delete_custom_overlay <name>
Validator
vo
Votes for the offer specified by <offer-hash>
.
MyTonCtrl> vo <offer-hash> # use `ol` to get offers
ve
No args, votes for election.
vc
Votes for the complaint specified by <complaint-hash>
in the election specified by <election-id>
MyTonCtrl> vc <election-id> <complaint-hash>
Actually, this will work as well, but you should use data from your current MyTonCtrl state:
MyTonCtrl> vc 0 0
check_ef
Outputs validator efficiency data for the current and previous rounds.
Note: The accuracy of data improves as the current round progresses.
Based on the validator index
, which can be obtained using the status
command, there are three possible scenarios:
-
Validator index in the range [0,
max_main_validators
): Thevalidator efficiency
must remain above 90% for the entire round. This percentage may be adjusted in the future based on statistics. If it falls below this threshold, a penalty (fine) may be imposed. -
Validator index in the range [
max_main_validators
,max_validators
): Thevalidator efficiency
should still be above 90% for the full round (this percentage may be adjusted in the future based on statistics). Currently, no penalties will be applied; however, this may change in future updates. -
The user is not a validator: No penalties apply, but the user is also not eligible for rewards. In this case, there is no
validator efficiency
to monitor. This situation can arise from having a low stake or an incorrect node configuration. Additionally, ensure thatMyTonCtrl
is running continuously.
Learn more about max_validators
and max_main_validators
on config parameters page. Get the current values for mainnet and for testnet.
Pool commands
Get more information at nominator pool page.
deposit_to_pool
Deposits the specified <amount>
to the pool specified by <pool-addr>
.
MyTonCtrl> deposit_to_pool <pool-addr> <amount>
Example:
MyTonCtrl> deposit_to_pool kf_JcC5pn3etTAdwOnc16_tyMmKE8-ftNUnf0OnUjAIdDJpX 1
withdraw_from_pool
Withdraws the specified <amount>
from the pool specified by <pool-addr>
MyTonCtrl> withdraw_from_pool <pool-addr> <amount>
Example:
MyTonCtrl> withdraw_from_pool kf_JcC5pn3etTAdwOnc16_tyMmKE8-ftNUnf0OnUjAIdDJpX 1
cleanup
No args, cleans up the validator database.
benchmark
No args, displays a table with several tests.
Single pool
Get more information at single nominator pool page.
new_single_pool
Creates a new single pool with the specified <pool-name>
and <owner-address>
.
MyTonCtrl> new_single_pool <pool-name> <owner-address>
Example:
MyTonCtrl> new_single_pool name kf9tZrL46Xjux3ZqvQFSgQkOIlteJK52slSYWbasqtOjrKUT
activate_single_pool
Activates the single pool specified by <pool-name>
.
MyTonCtrl> activate_single_pool <pool-name> # pool name from above
Wallet management
Importing a wallet
MyTonCtrl supports various types of wallet-like contracts, including wallet-v1, wallet-v3, lockup-wallet, among others. It often offers a straightforward way to interact with these contracts.
Importing Using a Private Key
If you have access to a private key, you can easily import a wallet:
MyTonCtrl> iw <wallet-addr> <wallet-secret-key>
In this context, <wallet-secret-key>
is your private key in base64 format.
Example:
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:
- Install Node.js.
- Clone and install mnemonic2key:
git clone https://github.com/ton-blockchain/mnemonic2key.git
cd mnemonic2key
npm install - Run the following command, replacing
word1
,word2
... with your mnemonic phrase andaddress
with the address of your wallet contract:node index.js word1 word2 ... word24 [address]
- The script will generate
wallet.pk
andwallet.addr
. Rename them toimported_wallet.pk
andimported_wallet.addr
. - Copy both files to the
~/.local/share/mytoncore/wallets/
directory. - Open the MyTonCtrl console and list the wallets using the
wl
command. - Verify that the wallet has been imported and displays the correct balance.
- You can now send funds using the
mg
command. Entermg
to view the help documentation. Remember to replace placeholders (words inside< >
) with your actual values when running commands.
Show the list of wallets
MyTonCtrl> wl
Create a new local wallet
You can also create a new empty wallet:
MyTonCtrl> nw <workchain-id> <wallet-name> [<version> <subwallet>]
Example:
MyTonCtrl> nw 0 name v3 # by default subwallet is 0x29A9A317 + workchain
Activate a local wallet
To use a wallet, you must activate it first:
MyTonCtrl> aw <wallet-name>
Before activating, send 1 Toncoin to the wallet:
MyTonCtrl> wl
Name Status Balance Ver Wch Address
validator_wallet_001 active 994.776032511 v1 -1 kf_dctjwS4tqWdeG4GcCLJ53rkgxZOGGrdDzHJ_mxPkm_Xct
wallet_004 uninit 0.0 v1 0 0QBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Kbs
MyTonCtrl> mg validator_wallet_001 0QBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Kbs 1
Then activate it:
MyTonCtrl> aw wallet_004
ActivateWallet - OK
MyTonCtrl> wl
Name Status Balance Ver Wch Address
validator_wallet_001 active 994.776032511 v1 -1 kf_dctjwS4tqWdeG4GcCLJ53rkgxZOGGrdDzHJ_mxPkm_Xct
wallet_004 active 0.998256399 v1 0 kQBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Psp
Get the sequence number of the wallet
MyTonCtrl> seqno <wallet-name>
Set a wallet version
This command is needed when a modified wallet with interaction methods similar to a regular one is used.
MyTonCtrl> swv <wallet-addr> <wallet-version>
Example:
MyTonCtrl> swv kf9tZrL46Xjux3ZqvQFSgQkOIlteJK52slSYWbasqtOjrKUT v3
Export a wallet
It is possible to obtain a specific wallet address along with its secret key:
MyTonCtrl> ew <wallet-name>
Delete a local wallet
MyTonCtrl> dw <wallet-name>
Account and transaction commands
Account status
To check account status and its transaction history use the following command:
MyTonCtrl> vas <account-addr>
# For example, you can get the address of the validator wallet by the wl command and use vas to get more information.
Account history
To view your account transaction history, use the following command, specifying the number of listed operations as limit
:
MyTonCtrl> vah <account-addr> <limit>
# limit is just unsigned integer number
Transfer coins
Transfer coins from the local wallet to another account:
MyTonCtrl> mg <wallet-name> <account-addr | bookmark-name> <amount>
Example:
MyTonCtrl> mg wallet_004 kQBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Psp 1
Wallet version 'v4' is not supported for the transfering
Transfer coins through a proxy
Transfer coins from local wallet to an account through a proxy:
MyTonCtrl> mgtp <wallet-name> <account-addr | bookmark-name> <amount>
Example:
MyTonCtrl> mgtp wallet_004 kQBxnZJq4oHVFs4ban3kJ5qllM1IQo57lIx8QP69Ue9A6Psp 1
General pools commands
There are two types of pools in MyTonCtrl:
All of them are managed by the following set of commands:
List of pools
MyTonCtrl> pools_list
Delete a pool
MyTonCtrl> delete_pool <pool-name>
Importing a pool
You can add an existing pool to the list of local pools:
MyTonCtrl> import_pool <pool-name> <pool-addr>
Example:
MyTonCtrl> import_pool name kf_JcC5pn3etTAdwOnc16_tyMmKE8-ftNUnf0OnUjAIdDJpX
Bookmarks
You can create an alias (bookmark) for an account address to simplify its usage.
Create a new bookmark
MyTonCtrl> nb <bookmark-name> <account-addr | domain-name>
Show the list of bookmarks
MyTonCtrl> bl
Delete a bookmark
MyTonCtrl> db <bookmark-name> <bookmark-type>
The other MyTonCtrl commands
ol
Show offers list:
Format name | Format | Description |
---|---|---|
No arguments | ol | Prints the table with the hashes reduced. |
JSON output | ol --json | Prints the JSON representation of data . |
Full hash output | ol hash | Prints the table with full hashes. |
JSON with full hash | ol --json hash | Prints the JSON representation of data . The "hash" argument has no effect in this case. |
od
Retrieves the offer diff.
MyTonCtrl> od [offer-hash]
el
Shows election entries list.
Format name | Format | Description |
---|---|---|
No arguments | el | Prints the table with ADNL, Pubkey, and Wallet reduced. |
Any combination of following args | el --json adnl pubkey wallet past | Full ADNL, Pubkey, Wallet, and past election entries in JSON representation. |
Descriptions for each arg:
--json
: Prints the JSON representation of data.past
: Includes past election entries.adnl
: Prints full ADNL.pubkey
: Displays full pubkey.wallet
: Displays full wallet.
vl
Show active validators
Format name | Format | Description |
---|---|---|
No arguments | vl | Prints the table with ADNL, Pubkey, and Wallet reduced. |
Any combination of following args | vl --json adnl pubkey wallet past | Full ADNL, Pubkey, Wallet, and past validator entries in JSON representation. |
Descriptions for each arg:
--json
: Prints the JSON representation of data.past
: Includes past validator entries.adnl
: Prints full ADNL.pubkey
: Displays full Pubkey.wallet
: Displays full Wallet.offline
: Excludes online validators.
cl
Show complaints list
Format name | Format | Description |
---|---|---|
No arguments | cl | Prints the table with ADNL reduced. |
Any combination of following args | cl --json adnl past | Full ADNL with past complaints in JSON representation. |
Descriptions for each parameter:
--json
: Prints the JSON representation of data.past
: Includes past complaints.adnl
: Prints full ADNL.
Installer
This section describes installer
sub-console, that can be opened by command
MyTonCtrl> installer
Example:
All commands can be called directly from MyTonCtrl console:
MyTonCtrl> installer [command] [args]
help
Displays all available commands.
clear
Clears terminal screen.
exit
Exits from mytoninstaller
terminal
status
Displays services status of Full node, MyTonCore, V.console, liteserver and node arguments.
set_node_argument
Format name | Format | Description |
---|---|---|
Add or replace arg | set_node_argument [-ARG_NAME] [ARG_VALUE] | Add argument or replace it value if it exists. -ARG_NAME must have - or -- at the beginning |
Delete arg | set_node_argument [-ARG_NAME] -d | Delete argument from list. |
Available arguments:
Node argument name | Description | Default value |
---|---|---|
threads | count of threads | cpus count - 1 |
daemonize | No value | |
global-config | path to global config | /usr/bin/ton/global.config.json |
db | path to database | /var/ton-work/db/ |
logname | path to logs | /var/ton-work/log |
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:
MyTonInstaller> set_node_argument --state-ttl 3601
Example:
MyTonInstaller> set_node_argument --state-ttl 3601
enable
Enables one of the modes for ton-http-api
and creates the necessary configuration:
MyTonInstaller> enable <MODE_NAME>
Modes can have following names:
FN
- Full NodeVC
- Validator ConsoleLS
- Lite ServerDS
- DHT ServerJR
- JSON RPCTHA
- TON HTTP APILSP
- ls proxyTSP
- TON storage + TON storage provider
Example:
MyTonInstaller> enable FN
update
Same as enable
of mytoninstaller
MyTonInstaller> update FN
plsc
Displays liteserver config.
Example:
{
"ip": 1111111111,
"port": 11111,
"id": {
"@type": "pub.ed25519",
"key": "UURGaaZZjsBbKHvnrBqslHerXYbMCVDKdswKNJvAHkc="
}
}
clcf
Creates a local config file (by default at /usr/bin/ton/local.config.json
)
print_ls_proxy_config
Displays ls proxy config.
create_ls_proxy_config_file
Currently, it is in the development stage and is not functioning yet.
drvcf
Dangerous recovery validator config file.
setwebpass
No args. Sets a password for the web admin interface, runs python3 /usr/src/mtc-jsonrpc/mtc-jsonrpc.py -p
.