diff --git a/docs/participate/network-maintenance/nominator-pool.mdx b/docs/participate/network-maintenance/nominator-pool.mdx new file mode 100644 index 0000000000..48b3a65a3f --- /dev/null +++ b/docs/participate/network-maintenance/nominator-pool.mdx @@ -0,0 +1,118 @@ +# Nominator Pool + +## Running the Validator in Nominator Pool Mode + +1. Set up the hardware for the validator - you will need 8 vCPUs, 64GB memory, 1TB SSD, a fixed IP address, and 1Gb/s internet speed. + + For maintaining network stability, it's recommended to distribute validator nodes in different geographical locations worldwide rather than concentrating them in a single data center. You can use [this site](https://status.toncenter.com/) to assess the load of various locations. The map indicates high data center utilization in Europe, especially in Finland, Germany, and Paris. Therefore, using providers such as Hetzner and OVH is not recommended. + + > Ensure your hardware matches or exceeds the specifications above. Running the validator on insufficient hardware negatively impacts the network and could result in penalties. + + > Note that as of May 2021, Hetzner has prohibited mining on its servers, and this ban includes both PoW and PoS algorithms. Even installing a regular node may be considered a violation of their terms of service. + + > **Recommended providers include:** [Amazon](https://aws.amazon.com/), [DigitalOcean](https://www.digitalocean.com/), [Linode](https://www.linode.com/), [Alibaba Cloud](https://alibabacloud.com/), [Latitude](https://www.latitude.sh/). + +2. Install and synchronize **mytonctrl** as described in the guide [here](/participate/run-nodes/full-node#how-to-run-a-node-video). + + You can also refer to this [Video Instruction](https://ton.org/docs/#/nodes/run-node) for additional help. + +3. Transfer 1 TON to the validator wallet address shown in the `wl` list. + +4. Use the `aw` command to activate your validator wallet. + +5. Activate pool mode: + + ```bash + enable_mode nominator-pool + set stake null + ``` + +6. Create two pools (for even and odd validation rounds): + + ```bash + new_pool p1 0 1 1000 300000 + new_pool p2 0 1 1001 300000 + ``` + + where: + * `p1` is the pool name; + * `0` % is the validator's reward share (e.g., use 40 for 40%); + * `1` is the maximum number of nominators in the pool (should be <= 40); + * `1000` TON is the minimum validator stake (should be >= 1K TON); + * `300000` TON is the minimum nominator stake (should be >= 10K TON); + + > (!) Pool configurations do not have to be identical, you can add 1 to the minimum stake of one pool to make them different. + + > (!) Use https://tonmon.xyz/ to determine the current minimum validator stake. + +7. Type `pools_list` to display pool addresses: + + ```bash + pools_list + Name Status Balance Address + p1 empty 0 0f98YhXA9wnr0d5XRXT-I2yH54nyQzn0tuAYC4FunT780qIT + p2 empty 0 0f9qtmnzs2-PumMisKDmv6KNjNfOMDQG70mQdp-BcAhnV5jL + ``` + +8. Send 1 TON to each pool and activate the pools: + + ```bash + mg validator_wallet_001 0f98YhXA9wnr0d5XRXT-I2yH54nyQzn0tuAYC4FunT780qIT 1 + mg validator_wallet_001 0f9qtmnzs2-PumMisKDmv6KNjNfOMDQG70mQdp-BcAhnV5jL 1 + activate_pool p1 + activate_pool p2 + ``` + +9. Type `pools_list` to display pools: + + ```bash + pools_list + Name Status Balance Address + p1 active 0.731199733 kf98YhXA9wnr0d5XRXT-I2yH54nyQzn0tuAYC4FunT780v_W + p2 active 0.731199806 kf9qtmnzs2-PumMisKDmv6KNjNfOMDQG70mQdp-BcAhnV8UO + ``` + +10. Open each pool via the link "https://tonscan.org/nominator/" and verify pool configurations. + +11. Proceed with the validator deposit to each pool: + + ```bash + deposit_to_pool validator_wallet_001 1005 + deposit_to_pool validator_wallet_001 1005 + ``` + + In these commands, `1005` TON is the deposit amount. Be aware that 1 TON will be deducted by the pool for processing the deposit. + +12. Proceed with the nominator deposit to each pool: + + Visit the pool link (from **Step 9**) and click **ADD STAKE**. + You can also make a deposit using **mytonctrl**, using the following commands: + + ```bash + mg nominator_wallet_001 300001 -C d + mg nominator_wallet_001 300001 -C d + ``` + + > (!) The nominator wallet must be initialized in basechain (workchain 0). + + > (!) Keep in mind that the validator wallet and nominator wallet must be stored separately! The validator wallet should be stored on the server with the validator node to ensure processing of all system transactions. Meanwhile, the nominator wallet should be stored in your cold cryptocurrency wallet. + + > To withdraw a nominator deposit, send a transaction with the comment `w` to the pool address (attach 1 TON to process the transaction). You can also perform this action using **mytonctrl**. + +13. Invite nominators to deposit into your pools. The participation in validation will commence automatically. + + > (!) Ensure that you have at least 200 TON/month in your validator wallet for operation fees. + +## Pool Configuration + +If you're intending to lend to yourself, use `new_pool p1 0 1 1000 300000` (maximum of 1 nominator, 0% validator share). + +If you're creating a pool for numerous nominators, you might use something like this: `new_pool p1 40 40 10000 10000` (maximum of 40 nominators, 40% validator share, minimum participant stakes of 10K TON). + +## Transitioning a Regular Validator to Nominator Pool Mode + +1. Input `set stake 0` to discontinue election participation. + +2. Await the return of both your stakes from the elector. + +3. Proceed with the steps under "Running the Validator in Nominator Pool Mode" from the **4th step** onwards. diff --git a/docs/participate/network-maintenance/single-nominator.mdx b/docs/participate/network-maintenance/single-nominator.mdx index 6ae82e95ca..6d451fd729 100644 --- a/docs/participate/network-maintenance/single-nominator.mdx +++ b/docs/participate/network-maintenance/single-nominator.mdx @@ -414,6 +414,8 @@ If user doesn't want to take part in validating anymore: ```bash MyTonCtrl> disable_mode validator +``` + 2. [Withdraw](/participate/network-maintenance/single-nominator#withdraw-funds) all funds from the Single Nominator contract to the owner wallet. ## Transitioning a Regular Validator to Nominator Pool Mode diff --git a/docs/participate/nodes/node-maintenance-and-security.md b/docs/participate/nodes/node-maintenance-and-security.md index 4eb7114b21..8b2a31fd5d 100644 --- a/docs/participate/nodes/node-maintenance-and-security.md +++ b/docs/participate/nodes/node-maintenance-and-security.md @@ -9,7 +9,9 @@ This document assumes that a validator is installed using the configuration and ### Database grooming TON Node/Validator keeps it's database within the path specified by `--db` flag of `validator-engine`, usually `/var/ton-work/db`, this directory is created and managed by the node but it is recommended to perform a database grooming/cleanup task once a month to remove some artefacts. -**Important**: You **must** stop the validator process before performing the steps outlined below, failure to do that will likely cause database corruption. +:::caution Do not forget to stop validator process +You **must** stop the validator process before performing the steps outlined below, failure to do that will likely cause database corruption. +::: The procedure takes ~5 minutes to complete and will not cause major service disruption. diff --git a/docs/participate/nodes/node-types.md b/docs/participate/nodes/node-types.md index 718953bfc6..e8a6cec234 100644 --- a/docs/participate/nodes/node-types.md +++ b/docs/participate/nodes/node-types.md @@ -2,11 +2,13 @@ import Button from '@site/src/components/button' # TON Node Types +In *simplified terms*, a blockchain `node` is **one of the computers** that **collectively run the blockchain's software**. It enables the blockchain to search and optionally validate transactions and keep the network secure ensuring that the network remains **decentralized**. + When diving into the world of The Open Network (TON), understanding the distinct node types and their functionalities is crucial. This article breaks down each node type to provide clarity for developers wishing to engage with the TON blockchain. ## Full Node -A **Full Node** in TON is a node that maintains synchronization with the blockchain. +A `Full Node` in TON is a node that **maintains synchronization** with the blockchain. It retains the _current state_ of the blockchain and can house either the entire block history or parts of it. This makes it the backbone of the TON blockchain, facilitating the network's decentralization and security. @@ -15,67 +17,73 @@ colorType="primary" sizeType={'sm'}> Running a Full Node -## Validator Node - -A **Validator Node** is activated when it holds a necessary amount of Toncoin as a stake. Validator nodes are vital for the network's operability, participating in the validation of new network blocks. - -TON operates on a Proof-of-Stake mechanism, where validators are pivotal in maintaining network functionality. Validators are [rewarded in Toncoin](/participate/network-maintenance/staking-incentives) for their contributions, incentivizing network participation and ensuring network security. +## Archive Node -[Running a Full Node as a Validator](/participate/run-nodes/full-node#become-a-validator) +If `Full node` archives the **entire block history** it's called `Archive Node`. +Such nodes are indispensable for creating blockchain explorers or other tools that necessitate a full blockchain history. -## Full Node + Liteserver + -When an endpoint is activated on a full node, the node assumes the role of a **Liteserver**. This node type can field and respond to requests from Lite Clients, allowing to seamlessly interract with the TON Blockchain. +## Validator Node -### Lite Clients: the SDKs to interact with TON +TON operates on a **Proof-of-Stake** mechanism, where `validators` are pivotal in maintaining network functionality. `Validators` are [rewarded in Toncoin](/participate/network-maintenance/staking-incentives) for their contributions, incentivizing network participation and ensuring network security. -Liteservers enable swift communication with Lite Clients, facilitating tasks like retrieving balance or submitting transactions without necessitating the full block history. +If `full node` holds a **necessary amount of Toncoin** as a **stake**, it can be used as `Validator Node`. -Each SDK which supports ADNL protocol can be used as a Lite Client with `config.json` file. The `config.json` file contains a list of endpoints that can be used to connect to the TON Blockchain. + -[Choose a TON SDK](/develop/dapps/apis/sdk) +## Liteserver -Each SDK without ADNL support usually uses HTTP middleware to connect to the TON Blockchain. It's less secure and slower than ADNL, but it's easier to use. +`Full Node` can be used as `Liteserver`. This node type can field and respond to requests from `Lite Clients`, allowing to seamlessly interact with the TON Blockchain. -### Interaction with TON: Public Liteservers (endpoints) +`Liteservers` enable swift communication with Lite Clients, facilitating tasks like retrieving balance or submitting transactions without necessitating the full block history. -The TON Foundation provides several public Liteservers, integrated into the global config, which are accessible for universal use. These endpoints, such as those used by standard wallets, ensure that even without setting up a personal liteserver, interaction with the TON Blockchain remains possible. +Actually, there are two public `Liteservers` configs both for mainnet and testnet, that already have been provided by the TON Foundation. They are accessible for universal use. But it's not recommended to use public `Liteservers` in production since they are not stable because of permanent high load. - [Public Liteserver Configurations - mainnet](https://ton.org/global-config.json) - [Public Liteserver Configurations - testnet](https://ton.org/testnet-global.config.json) -Use the downloaded `config.json` file in your application with [TON SDK](/participate/nodes/node-types#lite-clients-the-sdks-to-interact-with-ton). - -#### Troubleshooting +These endpoints, such as those used by standard wallets, ensure that even without setting up a personal liteserver, interaction with the TON Blockchain remains possible. -##### Timed out after 3 seconds - -If you see this error this means that the liteserver you are trying to connect to is not available. The correct way to solve this issue for public liteservers is as follows: - -1. Download the config.json file from the tontech link: +If you want to have more stable _connection_, you can run your own `Liteserver`. To run a `full node` as a `Liteserver`, simply enable the `Liteserver` mode in your node's configuration file. -```bash -wget https://api.tontech.io/ton/wallet-mainnet.autoconf.json -O /usr/bin/ton/global.config.json -``` + -It removes slow liteservers from the configuration file. +## Lite Clients: the SDKs to interact with TON -2. Use the downloaded config.json file in your application with [TON SDK](/participate/nodes/node-types#lite-clients-the-sdks-to-interact-with-ton). +Each SDK which supports ADNL protocol can be used as a `Lite Client` with `config.json` file (find how to download it [here](/participate/nodes/node-types#troubleshooting)). The `config.json` file contains a list of endpoints that can be used to connect to the TON Blockchain. +Each SDK without ADNL support usually uses HTTP middleware to connect to the TON Blockchain. It's less secure and slower than ADNL, but it's easier to use. -### Running a Full Node as a Liteserver + -If your project requires a high level of _security_, you can run your own Liteserver. To run a full node as a Liteserver, simply enable the Liteserver mode in your node's configuration file: +### Troubleshooting -[Enable Liteserver in your Node](/participate/run-nodes/full-node#enable-liteserver-mode) +Below you can find approaches how to fix common nowed issues with `light clients` +### Timed out after 3 seconds -## Archive Node +If you see this error this means that the liteserver you are trying to connect to is not available. The correct way to solve this issue for public liteservers is as follows: -An **Archive Node** is essentially a full node that archives the entire block history. +1. Download the config.json file from the tontech link: -Such nodes are indispensable for creating blockchain explorers or other tools that necessitate a full blockchain history. +```bash +wget https://api.tontech.io/ton/wallet-mainnet.autoconf.json -O /usr/bin/ton/global.config.json +``` - [Running an Archive Node](/participate/run-nodes/archive-node) +It removes slow liteservers from the configuration file. +2. Use the downloaded config.json file in your application with [TON SDK](/develop/dapps/apis/sdk). diff --git a/docs/participate/run-nodes/archive-node.md b/docs/participate/run-nodes/archive-node.md index a762a0045f..e9c95bf9f4 100644 --- a/docs/participate/run-nodes/archive-node.md +++ b/docs/participate/run-nodes/archive-node.md @@ -1,22 +1,20 @@ -# Running an Archive Node +# Archive Node -## Overview - -:::caution System Administrator Required -For running nodes basic knowledge of Linux/Ubuntu system administration is required. +:::info +Read about [Full Node](/participate/run-nodes/full-node) before this article ::: -An Archive Node is a type of [Full Node](/participate/run-nodes/full-node) that stores extended historical data of a blockchain. If you are creating a blockchain explorer or a similar application that requires access to historical data, using an Archive Node as an indexer is recommended. +## Overview + +An Archive Node is a type of Full Node that stores extended historical data of a blockchain. If you are creating a blockchain explorer or a similar application that requires access to historical data, using an Archive Node as an indexer is recommended. -## Prerequisites +## OS requirements We highly recommend install mytonctrl using the supported operating systems: * Ubuntu 20.04 * Ubuntu 22.04 * Debian 11 -Please, use a [non-root user with sudo privileges](/participate/run-nodes/full-node#prerequisites-1) to install and run mytonctrl. - ## Hardware requirements * 16 x Cores CPU @@ -31,15 +29,6 @@ __Note__: 4TB assumes usage of zfs volume with compression enabled ## Installation -In general, you need the following steps to run an Archive Node: - -1. Install ZFS and Prepare Volume -2. Install MyTonCtrl -3. Run a Full Node on your server and stop validator process -4. Download and restore dump data from https://archival-dump.ton.org -5. Run Full Node with Configuring DB specs for Archive Node - - ### Install ZFS and Prepare Volume Dumps come in form of ZFS Snapshots compressed using plzip, you need to install zfs on your host and restore the dump, see [Oracle Documentation](https://docs.oracle.com/cd/E23824_01/html/821-1448/gavvx.html#scrolltoc) for more details. @@ -63,7 +52,7 @@ sudo zfs set compression=lz4 data ### Install MyTonCtrl -Please, use a [Running Full Node](/participate/run-nodes/full-node) to install mytonctrl. +Please, use a [Running Full Node](/participate/run-nodes/full-node) to **install** and **run** mytonctrl. ### Run an Archive Node @@ -176,7 +165,7 @@ systemctl start validator.service ## Troubleshooting and backups If for some reason something does not work / breaks you can always [roll back](https://docs.oracle.com/cd/E23824_01/html/821-1448/gbciq.html#gbcxk) to @archstate snapshot on your ZFS filesystem, this is the original state from dump. -1. Stop validator process (Never skip this!) +1. Stop validator process (**Never skip this!**) ```shell sudo -s systemctl stop validator.service diff --git a/docs/participate/run-nodes/become-validator.md b/docs/participate/run-nodes/become-validator.md new file mode 100644 index 0000000000..21ac873e05 --- /dev/null +++ b/docs/participate/run-nodes/become-validator.md @@ -0,0 +1,56 @@ +# Validator Node + +:::info +Read about [Full Node](/participate/run-nodes/full-node) before this article +::: + +Check that validator mode is enabled using `status_modes` command. If it's not, refer [mytonctrl enable_mode command](/participate/run-nodes/mytonctrl#enable_mode). + +## View the List of Wallets + +Check out the list of available wallets in the **MyTonCtrl** console using the `wl` command: + +```sh +wl +``` + +During the installation of **mytonctrl**, the **validator_wallet_001** wallet is created: + +![wallet list](/img/docs/nodes-validator/manual-ubuntu_mytonctrl-wl_ru.png) + + +## Activate the Wallets + +1. Send the necessary number of coins to the wallet and activate it. + + Recently (_at the end of 2023_), the approximate figures have been a minimum stake of around __340K TON__ and a maximum of about __1M TON__. + + Check current stakes with [tonscan.com](https://tonscan.com/validation) to understand necessary amount of coins. + + Read more [how maximum and minimum stakes calculated](/participate/network-maintenance/staking-incentives#values-of-stakes-max-effective-stake). + +2. Use the `vas` command to display the history of transfers: + + ```sh + vas [wallet name] + ``` + +3. Activate the wallet using the `aw` command (`wallet name` is optional, if no arguments provided it will activate all available) + + ```sh + aw [wallet name] + ``` + +![account history](/img/docs/nodes-validator/manual-ubuntu_mytonctrl-vas-aw_ru.png) + +## Your Validator is Now Ready + +**mytoncore** will automatically join the elections. It divides the wallet balance into two parts and uses them as a stake to participate in the elections. You can also manually set the stake size: + +```sh +set stake 50000 +``` + +`set stake 50000` — this sets the stake size to 50k coins. If the bet is accepted and our node becomes a validator, the bet can only be withdrawn in the second election (according to the rules of the electorate). + +![setting stake](/img/docs/nodes-validator/manual-ubuntu_mytonctrl-set_ru.png) \ No newline at end of file diff --git a/docs/participate/run-nodes/enable-liteserver-node.md b/docs/participate/run-nodes/enable-liteserver-node.md new file mode 100644 index 0000000000..654d30d7d5 --- /dev/null +++ b/docs/participate/run-nodes/enable-liteserver-node.md @@ -0,0 +1,283 @@ +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Liteserver Node + +:::info +Read about [Full Node](/participate/run-nodes/full-node) before this article +::: + +When an endpoint is activated in a full node, the node assumes the role of a **Liteserver**. This node type can field and respond to requests from Lite Clients, allowing for seamless interaction with the TON Blockchain. + +## Hardware requirements + +Compared to a [validator](/participate/run-nodes/full-node#hardware-requirements), a liteserver mode requires less resources. However, it is still recommended to use a powerful machine to run a liteserver. + +- at least 16 cores CPU +- at least 128 GB RAM +- at least 1TB GB NVMe SSD _OR_ Provisioned 32+k IOPS storage +- 1 Gbit/s network connectivity +- 16 TB/month traffic on peak load +- public IP address (_fixed IP address_) + +### Recommended Providers + +Feel free to use cloud providers listed in the [Recommended Providers](/participate/run-nodes/full-node#recommended-providers) section. + +Hetzner and OVH are forbidden to run a validator, but you can use them to run a liteserver: + +- __Hetzner__: EX101, AX102 +- __OVH__: RISE-4 + +## Installation of liteserver + +If you don't have mytonctrl, install it with `-m liteserver` flag: + + + + + ```bash + wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/mytonctrl2/scripts/install.sh + sudo bash install.sh -m liteserver -d + ``` + + + + + ```bash + wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/mytonctrl2/scripts/install.sh + su root -c 'bash install.sh -m liteserver -d' + ``` + + + + +If you already have mytonctrl installed, run: + +```bash +user@system:~# mytonctrl +MyTonCtrl> enable_mode liteserver +``` + +## Check the firewall settings + +First, verify the Liteserver port specified in your `config.json` file. This port changes with each new installation of `MyTonCtrl`. It is located in the `port` field: + +```json +{ + ... + "liteservers": [ + { + "ip": 1605600994, + "port": LITESERVER_PORT + ... + } + ] +} +``` + +If you are using a cloud provider, you need to open this port in the firewall settings. For example, if you are using AWS, you need to open the port in the [security group](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html). + +Below is an example of opening a port in the bare metal server firewall. + +### Opening a port in the firewall + +We will use the `ufw` utility ([cheatsheet](https://www.cyberciti.biz/faq/ufw-allow-incoming-ssh-connections-from-a-specific-ip-address-subnet-on-ubuntu-debian/)). You can use the one you prefer. + +1. Install `ufw` if it is not installed: + +```bash +sudo apt update +sudo apt install ufw +``` + +2. Allow ssh connections: + +```bash +sudo ufw allow ssh +``` + +3. Allow the port specified in the `config.json` file: + +```bash +sudo ufw allow +``` + +4. Enable the firewall: + +```bash +sudo ufw enable +``` + +5. Check the firewall status: + +```bash +sudo ufw status +``` + +This way, you can open the port in the firewall settings of your server. + +## Interaction with Liteserver (Lightclient) + +0. Create an empty project on your machine and paste `config.json` in the project directory. + +1. Install libraries. + + + + + ```bash + npm i --save ton-core ton-lite-client + ``` + + + + + ```bash + pip install pytonlib + ``` + + + + + ```bash + go get github.com/xssnick/tonutils-go + go get github.com/xssnick/tonutils-go/liteclient + go get github.com/xssnick/tonutils-go/ton + ``` + + + +2. Initialize a client and request masterchain info to ensure the liteserver is running. + + + + +Change project type to `module` in your `package.json` file: + + ```json + { + "type": "module" + } + ``` + +Create `index.js` file with the following content: + ```js + import { LiteSingleEngine } from 'ton-lite-client/dist/engines/single.js' + import { LiteRoundRobinEngine } from 'ton-lite-client/dist/engines/roundRobin.js' + import { LiteClient } from 'ton-lite-client/dist/client.js' + import config from './config.json' assert {type: 'json'}; + + + function intToIP(int ) { + var part1 = int & 255; + var part2 = ((int >> 8) & 255); + var part3 = ((int >> 16) & 255); + var part4 = ((int >> 24) & 255); + + return part4 + "." + part3 + "." + part2 + "." + part1; + } + + let server = config.liteservers[0]; + + async function main() { + const engines = []; + engines.push(new LiteSingleEngine({ + host: `tcp://${intToIP(server.ip)}:${server.port}`, + publicKey: Buffer.from(server.id.key, 'base64'), + })); + + const engine = new LiteRoundRobinEngine(engines); + const client = new LiteClient({ engine }); + const master = await client.getMasterchainInfo() + console.log('master', master) + + } + + main() + + ``` + + + + + ```python + from pytoniq import LiteClient + + async def main(): + client = LiteClient.from_mainnet_config( # choose mainnet, testnet or custom config dict + ls_i=0, # index of liteserver from config + trust_level=2, # trust level to liteserver + timeout=15 # timeout not includes key blocks synchronization as it works in pytonlib + ) + + await client.connect() + + await client.get_masterchain_info() + + await client.reconnect() # can reconnect to an exising object if had any errors + + await client.close() + + """ or use it with context manager: """ + async with LiteClient.from_mainnet_config(ls_i=0, trust_level=2, timeout=15) as client: + await client.get_masterchain_info() + + ``` + + + + + ```go + package main + + import ( + "context" + "encoding/json" + "io/ioutil" + "log" + "github.com/xssnick/tonutils-go/liteclient" + "github.com/xssnick/tonutils-go/ton" + ) + + func main() { + client := liteclient.NewConnectionPool() + + content, err := ioutil.ReadFile("./config.json") + if err != nil { + log.Fatal("Error when opening file: ", err) + } + + config := liteclient.GlobalConfig{} + err = json.Unmarshal(content, &config) + if err != nil { + log.Fatal("Error during Unmarshal(): ", err) + } + + err = client.AddConnectionsFromConfig(context.Background(), &config) + if err != nil { + log.Fatalln("connection err: ", err.Error()) + return + } + + // initialize ton API lite connection wrapper + api := ton.NewAPIClient(client) + + master, err := api.GetMasterchainInfo(context.Background()) + if err != nil { + log.Fatalln("get masterchain info err: ", err.Error()) + return + } + + log.Println(master) +} + + ``` + + + +3. Now you can interact with your own liteserver. + +## See also + +* [[YouTube]Tutorial how to launch liteserver](https://youtu.be/p5zPMkSZzPc) \ No newline at end of file diff --git a/docs/participate/run-nodes/faq.mdx b/docs/participate/run-nodes/faq.mdx new file mode 100644 index 0000000000..4f8c05cb3b --- /dev/null +++ b/docs/participate/run-nodes/faq.mdx @@ -0,0 +1,104 @@ +# FAQ + +## MyTonCtrl Directory Usage + +MyTonCtrl is a wrapper that stores its files in two places: + +1. `~/.local/share/mytonctrl/` - Long-term files such as logs are stored here. +2. `/tmp/mytonctrl/` - Temporary files are stored here. + +MyTonCtrl also includes another script, mytoncore, which in turn stores files in the following locations: + +1. `~/.local/share/mytoncore/` - Permanent files, the main configuration will be stored here. +2. `/tmp/mytoncore/` - Temporary files, parameters used for elections will be saved here. + +MyTonCtrl downloads the source code for itself and the validator into the following directories: + +1. `/usr/src/mytonctrl/` +2. `/usr/src/ton/` + +MyTonCtrl compiles the validator components into the following directory: + +1. `/usr/bin/ton/` + +MyTonCtrl creates a working directory for the validator here: + +1. `/var/ton/` + +--- + +## If MyTonCtrl was installed as root + +The configurations will be stored differently: + +1. `/usr/local/bin/mytonctrl/` +2. `/usr/local/bin/mytoncore/` + +--- + +## How to remove MyTonCtrl + +Run the script as an administrator and remove the compiled TON components: + +```bash +sudo bash /usr/src/mytonctrl/scripts/uninstall.sh +sudo rm -rf /usr/bin/ton +``` + +During this process, ensure you have sufficient permissions to delete or modify these files or directories. + + +## Directory Changes with MyTonCtrl + +### Changing Validator Working Directory Pre-installation + +If you wish to change the working directory of the validator prior to installation, there are two ways to do so: + +1. **Fork the project** - You can fork the project and make your changes there. Learn how to fork a project with `man git-fork`. +2. **Create a symbolic link** - You can also create a symbolic link with the following command: + + ```bash + ln -s /opt/ton/var/ton + ``` +This command will create a link `/var/ton` that points to `/opt/ton`. + +### Changing Validator Working Directory Post-installation + +If you want to change the working directory of the validator from `/var/ton/` after installation, perform the following steps: + +1. **Stop services** - You will need to stop the services with these commands: + + ```bash + systemctl stop validator.service + systemctl stop mytoncore.service + ``` + +2. **Move validator files** - You then need to move the validator files with this command: + + ```bash + mv /var/ton/* /opt/ton/ + ``` + +3. **Update configuration paths** - Replace the paths in the configuration located at `~/.local/share/mytoncore/mytoncore.db`. + +4. **Note on experience** - There is no prior experience with such a transfer, so consider this when moving forward. + +Remember to make sure you have sufficient permissions to make these changes or run these commands. + +## Understanding Validator Status and Restarting Validator in MyTonCtrl + +This document will help you understand how to confirm if MyTonCtrl has become a full validator and how to restart your validator. + +## Restarting Your Validator + +If you need to restart your validator, you can do so by running the following command: + +```bash +systemctl restart validator.service +``` + +Ensure you have sufficient permissions to execute these commands and make necessary adjustments. Always remember to back up important data before performing operations that could potentially affect your validator. + +## See Also + +* [Troubleshooting](/participate/run-nodes/nodes-troubleshooting) \ No newline at end of file diff --git a/docs/participate/run-nodes/full-node.mdx b/docs/participate/run-nodes/full-node.mdx index 9995488987..fb28bcbd41 100644 --- a/docs/participate/run-nodes/full-node.mdx +++ b/docs/participate/run-nodes/full-node.mdx @@ -1,32 +1,22 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Running a Full Node - - -:::caution System Administrator Required -For running nodes basic knowledge of Linux/Ubuntu system administration is required. -::: - -To install and manage your own node, use the **MyTonCtrl** open-source tool developed by the TON Foundation. The majority of TON Nodes are reliable and tested by **MyTonCtrl**. - -[MyTonCtrl](https://github.com/ton-blockchain/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 wallet, domain, and validator management tasks on the Linux operating system. - -We are actively seeking feedback about the installation process. If you have any questions or suggestions, please [contact us](https://t.me/Alexgton). - -## Prerequisites +# Full Node +## OS requirements We highly recommend installing MyTonCtrl using the supported operating systems: * Ubuntu 20.04 * Ubuntu 22.04 * Debian 11 -Please, [non-root user with sudo privileges](/participate/run-nodes/full-node#prerequisites-1) to install and run MyTonCtrl. - ## Hardware requirements -These requirements are for a **full node with a validator**. If you want to run a full node without a validator (e.g. [liteserver](/participate/run-nodes/full-node#hardware-requirements-1)), you can use a less powerful machine. +:::caution Node usage on personal local machine +You shouldn't run any type of node on your personal local machine for long, even if it is satisfy the requirements. Nodes actively use disks and can damage them fast. +::: + +### With validator - 16 cores CPU - 128 GB RAM @@ -35,13 +25,13 @@ These requirements are for a **full node with a validator**. If you want to run - public IP address (_fixed IP address_) - 16 TB/month traffic on peak load -You need a machine with a **fixed IP address** and a **high-bandwidth network connection** to run a TON Blockchain Full Node. - -Typically you'll need a sufficiently powerful server in a data center with good network connectivity, using at least a 1 Gbit/s connection to reliably accommodate peak loads (the average load is expected to be approximately 100 Mbit/s). +:::info Be ready for peak loads +Typically you'll need at least a 1 Gbit/s connection to reliably accommodate peak loads (the average load is expected to be approximately 100 Mbit/s). +::: ### Port Forwarding -All types of nodes require a static external IP address, one UDP port to be forwarded for incoming connections and all outgoing connections to be open - the node uses random ports for new outgoing connections. It's necessarily for the node to be visible to the outside world over the NAT. +All types of nodes require a static external IP address, one UDP port to be forwarded for incoming connections and all outgoing connections to be open - the node uses random ports for new outgoing connections. It's necessarily for the node to be visible to the outside world over the NAT. It can be done with your network provider or [rent a server](/participate/run-nodes/full-node#recommended-providers) to run a node. @@ -53,71 +43,20 @@ It's possible to find out which UDP port is opened from the `netstat -tulpn` com The TON Foundation recommends the following providers for running a Validator: -#### GCP (Google Cloud Platform) - -- **Machine Type:** `n2-standard-16` -- **CPU:** `32 vCPUs` -- **RAM:** `128 GB` -- **Storage:** `1 TB NVMe SSD persistent disk` -- **Network:** `16 Gbps` -- **Public IP:** `Reserve a static external IP address.` -- **Traffic:** `16 TB/month` - -#### Alibaba Cloud - -- **Instance Type:** `ecs.g6.4xlarge` -- **CPU:** `32 vCPUs` -- **RAM:** `128 GB` -- **Storage:** `1 TB NVMe SSD disk` -- **Network:** `Up to 10 Gbps` -- **Public IP:** `Bind an Elastic IP for a fixed IP address.` -- **Traffic:** `16 TB/month` - -#### Tencent Cloud - -- **Instance Type:** `M5.4XLARGE` -- **CPU:** `32 vCPUs` -- **RAM:** `128 GB` -- **Storage:** `1 TB NVMe SSD cloud disk` -- **Network:** `Up to 10 Gbps` -- **Public IP:** `Associate an Elastic IP for a fixed IP address.` -- **Traffic:** `16 TB/month` - -#### Vultr - -- **Instance Type:** `bare metal Intel E-2388G` -- **CPU:** `16 Cores / 32 Threads` -- **RAM:** `128 GB` -- **Storage:** `1.92TB NVMe SSD` -- **Network:** `10 Gbps` -- **Public IP:** `Fixed IP address included with instance.` -- **Traffic:** `16 TB/month` - -#### DigitalOcean - -- **Instance Type:** `general purpose premium Intel` -- **CPU:** `32 vCPUs` -- **RAM:** `128 GB` -- **Storage:** `1TB NVMe SSD` -- **Network:** `10 Gbps` -- **Public IP:** `Fixed IP address included with instance.` -- **Traffic:** `16 TB/month` - -#### Latitude - -- **Instance Type:** `c3.medium.x86` -- **CPU:** `16 Cores / 32 Threads` -- **RAM:** `128 GB` -- **Storage:** `1.9TB NVMe SSD` -- **Network:** `10 Gbps` -- **Public IP:** `Fixed IP address included with instance.` -- **Traffic:** `16 TB/month` +| Cloud Provider | Instance Type | CPU | RAM | Storage | Network | Public IP | Traffic | +|------------------|-----------------------|----------------|--------|-------------------|--------------|-----------------------------------|---------------| +| GCP | `n2-standard-16` | `32 vCPUs` | `128GB`| `1TB NVMe SSD` | `16 Gbps` | Reserve a static external IP | `16 TB/month`| +| Alibaba Cloud | `ecs.g6.4xlarge` | `32 vCPUs` | `128GB`| `1TB NVMe SSD` | `Up to 10 Gbps` | Bind an Elastic IP | `16 TB/month`| +| Tencent Cloud | `M5.4XLARGE` | `32 vCPUs` | `128GB`| `1TB NVMe SSD` | `Up to 10 Gbps` | Associate an Elastic IP | `16 TB/month`| +| Vultr | `bare metal Intel E-2388G` | `16 Cores / 32 Threads` | `128GB` | `1.92TB NVMe SSD` | `10 Gbps` | Fixed IP address included with instance | `16 TB/month`| +| DigitalOcean | `general purpose premium Intel` | `32 vCPUs` | `128GB` | `1TB NVMe SSD` | `10 Gbps` | Fixed IP address included with instance | `16 TB/month`| +| Latitude | `c3.medium.x86` | `16 Cores / 32 Threads` | `128GB` | `1.9TB NVMe SSD` | `10 Gbps` | Fixed IP address included with instance | `16 TB/month`| :::info **Note:** Prices, configurations, and availability may vary. It is advisable to always check the official documentation and pricing pages of the respective cloud provider before making any decisions. ::: -## How to run a Node? (video) +## Run a Node (video) [//]: # () @@ -127,18 +66,11 @@ Please, check this video step-by-step tutorial to start promptly: -## Step-by-step instructions - -### Prerequisites - - -#### Login with non-root sudo user - -Login to your server as a **non-root** user with **sudo** privileges. +## Run a Node (text) -#### Create and login non-root sudo user +### Switch to non-root user -If you don't have **non-root** user, you can create this with the following steps steps. +If you don't have **non-root** user, you can create this with the following steps (otherwise skip first two steps and go to the third). 1. Login as root and create new user: @@ -152,25 +84,22 @@ sudo adduser sudo usermod -aG sudo ``` -3. Log into the server as a new user using ssh +3. Log into the new user (if you are using ssh, you will need to stop current session and reconnect with correct user) ```bash ssh @ ``` - ### Install the MyTonCtrl -Download and run the installation script from the **non-root** user account with **sudo** privileges. Choose your Linux distributive: - - +Download and run the installation script from the **non-root** user account with **sudo** privileges: ```bash wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/scripts/install.sh - sudo bash install.sh -m full -d + sudo bash install.sh -d ``` @@ -178,27 +107,27 @@ Download and run the installation script from the **non-root** user account with ```bash wget https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/scripts/install.sh - su root -c 'bash install.sh -m full -d' + su root -c 'bash install.sh -d' ``` -* `-m full` - Full node installation mode. * `-d` - **mytonctrl** will download a [dump](https://dump.ton.org/) of the latest blockchain state. This will reduce synchronization time by several times. * `-c ` - 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`, ### Run the mytonctrl -1. Run **MyTonCtrl** console from the local user account used for installation in [step 1](/participate/run-nodes/full-node#prerequisites-1): +1. Run `MyTonCtrl` console **from the local user account used for installation**: - ```sh -mytonctrl + ```sh + mytonctrl ``` -2. Check the MyTonCtrl status using the `status` command: +2. Check the `MyTonCtrl` status using the `status` command: ```sh status @@ -208,12 +137,12 @@ mytonctrl The following statuses should be displayed: * **mytoncore status**: Should be in green. -* **Local validator status**: Should also be in green. -* **Local validator out of sync**: Initially, a large number is displayed. As soon as the newly created validator connects with other validators, the number will be around 250k. As synchronization progresses, this number decreases. When it falls below 20, the validator is synchronized. +* **local validator status**: Should also be in green. +* **local validator out of sync**: Initially, a `n/a` string is displayed. As soon as the newly created validator connects with other validators, the number will be around 250k. As synchronization progresses, this number decreases. When it falls below 20, the validator is synchronized. Example of the **status** command output: -![status](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/mytonctrl-status.png) +![status](/img/docs/nodes-validator/mytonctrl-status.png) :::caution Make sure you have same output for status For all nodes type **Local Validator status** section should appear. @@ -222,353 +151,22 @@ Otherwise, [check troubleshooting section](/participate/run-nodes/full-node#stat Wait until `Local validator out of sync` becomes less than 20 seconds. -## Become a Validator - -### Import existed account - -It is possible to import existed account to **MyTonCtrl** using `iw` command: - -```sh -iw -``` - -During the execution, the wallet_001 wallet is created: - -![](\img\docs\full-node\import-acc.png) - -### View the List of Wallets - -Check out the list of available wallets in the **MyTonCtrl** console using the `wl` command: - -```sh -wl -``` - -During the installation of **mytonctrl**, the **validator_wallet_001** wallet is created: - -![wallet list](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytonctrl-wl_ru.png) - - -### Activate the Wallets - -1. Send the necessary number of coins to the wallet and activate it. - -Recently (_at the end of 2023_), the approximate figures have been a minimum stake of around __340K TON__ and a maximum of about __1M TON__. - -Check current stakes with [tonscan.com](https://tonscan.com/validation) to understand necessary amount of coins. - -Read more [how maximum and minimum stakes calculated](/participate/network-maintenance/staking-incentives#values-of-stakes-max-effective-stake). - -2. Use the `vas` command to display the history of transfers: - -```sh -vas -``` - -3. Activate the wallet using the `aw` command - -```sh -aw [wallet name] -``` - -![account history](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytonctrl-vas-aw_ru.png) - -### Your Validator is Now Ready - -**mytoncore** will automatically join the elections. It divides the wallet balance into two parts and uses them as a stake to participate in the elections. You can also manually set the stake size: - -```sh -set stake 50000 -``` - -`set stake 50000` — this sets the stake size to 50k coins. If the bet is accepted and our node becomes a validator, the bet can only be withdrawn in the second election (according to the rules of the electorate). - -![setting stake](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytonctrl-set_ru.png) - - -## Enable Liteserver mode - -When an endpoint is activated in a full node, the node assumes the role of a **Liteserver**. This node type can field and respond to requests from Lite Clients, allowing for seamless interaction with the TON Blockchain. - -### Hardware requirements - -Compared to a [validator](/participate/run-nodes/full-node#hardware-requirements), a liteserver mode requires less resources. However, it is still recommended to use a powerful machine to run a liteserver. - -- at least 16 cores CPU -- at least 128 GB RAM -- at least 1TB GB NVMe SSD _OR_ Provisioned 32+k IOPS storage -- 1 Gbit/s network connectivity -- 16 TB/month traffic on peak load -- public IP address (_fixed IP address_) - -#### Recommended Providers - -Feel free to use cloud providers listed in the [Recommended Providers](/participate/run-nodes/full-node#recommended-providers) section. - -Hetzner and OVH are forbidden to run a validator, but you can use them to run a liteserver: - -- __Hetzner__: EX101, AX102 -- __OVH__: RISE-4 - -### Installation of liteserver - -1. Complete the previous steps to install [MyTonCtrl](/participate/run-nodes/full-node#step-by-step-instructions). - -2. Create a config file - -```bash -MyTonCtrl> installer -MyTonInstaller> clcf - -Local config file created: /usr/bin/ton/local.config.json -``` +### Uninstall mytonctrl -3. This file will help you to connect to your liteserver. Copy the config file located on the specified path to your home to save it. +Download script and run it: ```bash -cp /usr/bin/ton/local.config.json ~/config.json +sudo bash /usr/src/mytonctrl/uninstall.sh ``` -4. Create an empty `config.json` file on your local machine. +### Check mytonctrl owner -5. Copy the content from the console to your local machine `config.json` file. +Run: ```bash -cat ~/config.json -``` - -### Check the firewall settings - -First, verify the Liteserver port specified in your `config.json` file. This port changes with each new installation of `MyTonCtrl`. It is located in the `port` field: - -```json -{ - ... - "liteservers": [ - { - "ip": 1605600994, - "port": LITESERVER_PORT - ... - } - ] -} +ls -lh /var/ton-work/keys/ ``` -If you are using a cloud provider, you need to open this port in the firewall settings. For example, if you are using AWS, you need to open the port in the [security group](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-security-groups.html). - -Below is an example of opening a port in the bare metal server firewall. - -#### Opening a port in the firewall - -We will use the `ufw` utility ([cheatsheet](https://www.cyberciti.biz/faq/ufw-allow-incoming-ssh-connections-from-a-specific-ip-address-subnet-on-ubuntu-debian/)). You can use the one you prefer. - -1. Install `ufw` if it is not installed: - -```bash -sudo apt update -sudo apt install ufw -``` - -2. Allow ssh connections: - -```bash -sudo ufw allow ssh -``` - -3. Allow the port specified in the `config.json` file: - -```bash -sudo ufw allow -``` - -4. Check the firewall status. After running this command, you can verify that the rules have been added successfully by checking the UFW status: - -```bash -sudo ufw status -``` - -5. Enable the firewall: - -```bash -sudo ufw enable -``` - -This way, you can open the port in the firewall settings of your server. - -### Interaction with Liteserver - -0. Create an empty project on your machine and paste `config.js` in the project directory. - -1. Install libraries. - - - - - ```bash - npm i --save ton-core ton-lite-client - ``` - - - - - ```bash - pip install pytonlib - ``` - - - - - ```bash - go get github.com/xssnick/tonutils-go - go get github.com/xssnick/tonutils-go/liteclient - go get github.com/xssnick/tonutils-go/ton - ``` - - - -2. Initialize a client and request masterchain info to ensure the liteserver is running. - - - - - Change project type to `module` in your `package.json` file: - - ```json - { - "type": "module" - } - ``` - - Create `index.js` file with the following content: - ```js - import { LiteSingleEngine } from 'ton-lite-client/dist/engines/single.js' - import { LiteRoundRobinEngine } from 'ton-lite-client/dist/engines/roundRobin.js' - import { LiteClient } from 'ton-lite-client/dist/client.js' - import config from './config.json' assert {type: 'json'}; - - - function intToIP(int ) { - var part1 = int & 255; - var part2 = ((int >> 8) & 255); - var part3 = ((int >> 16) & 255); - var part4 = ((int >> 24) & 255); - - return part4 + "." + part3 + "." + part2 + "." + part1; - } - - let server = config.liteservers[0]; - - async function main() { - const engines = []; - engines.push(new LiteSingleEngine({ - host: `tcp://${intToIP(server.ip)}:${server.port}`, - publicKey: Buffer.from(server.id.key, 'base64'), - })); - - const engine = new LiteRoundRobinEngine(engines); - const client = new LiteClient({ engine }); - const master = await client.getMasterchainInfo() - console.log('master', master) - - } - - main() - - ``` - - - - - ```python - import asyncio - from pytonlib import TonlibClient - from pathlib import Path - import json - - - async def get_client() -> TonlibClient: - with open('config.json', 'r') as f: - config = json.loads(f.read()) - - keystore_dir = '/tmp/ton_keystore' - Path(keystore_dir).mkdir(parents=True, exist_ok=True) - - client = TonlibClient(ls_index=0, config=config, keystore=keystore_dir, tonlib_timeout=10) - await client.init() - - return client - - - async def test_client(): - client = await get_client() - - print(await client.get_masterchain_info()) - - await client.close() - - - if __name__ == '__main__': - asyncio.run(test_client()) - ``` - - - - - ```go - package main - - import ( - "context" - "encoding/json" - "io/ioutil" - "log" - "github.com/xssnick/tonutils-go/liteclient" - "github.com/xssnick/tonutils-go/ton" - ) - - func main() { - client := liteclient.NewConnectionPool() - - content, err := ioutil.ReadFile("./config.json") - if err != nil { - log.Fatal("Error when opening file: ", err) - } - - config := liteclient.GlobalConfig{} - err = json.Unmarshal(content, &config) - if err != nil { - log.Fatal("Error during Unmarshal(): ", err) - } - - err = client.AddConnectionsFromConfig(context.Background(), &config) - if err != nil { - log.Fatalln("connection err: ", err.Error()) - return - } - - // initialize ton API lite connection wrapper - api := ton.NewAPIClient(client) - - master, err := api.GetMasterchainInfo(context.Background()) - if err != nil { - log.Fatalln("get masterchain info err: ", err.Error()) - return - } - - log.Println(master) -} - - ``` - - - -3. Now you can interact with your own liteserver. - -### See also - -* [[YouTube]Tutorial how to launch liteserver](https://youtu.be/p5zPMkSZzPc) - - ## Tips & Tricks ### List of available commands @@ -579,9 +177,9 @@ This way, you can open the port in the firewall settings of your server. ### Check the mytonctrl logs -- To check **mytoncrl** logs, open `~/.local/share/mytoncore/mytoncore.log` for a local user or `/usr/local/bin/mytoncore/mytoncore.log` for Root. +- To check **mytonctrl** logs, open `~/.local/share/mytoncore/mytoncore.log` for a local user or `/usr/local/bin/mytoncore/mytoncore.log` for Root. -![logs](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytoncore-log.png) +![logs](/img/docs/nodes-validator/manual-ubuntu_mytoncore-log.png) ### Check the node logs @@ -590,162 +188,3 @@ Check the node logs upon failure: ```bash tail -f /var/ton-work/log.thread* ``` - - -## Troubleshooting - -This section contains answers to the most frequently asked questions about running nodes. - - -### Failed to get account state - -``` -Failed to get account state -``` - -This error means that there are issues during search for this account in shard state. -Most probably it means that liteserver node is syncing too slow, in particular the Masterchain synchronisation overtook shardchains (Basechain) synchronisation. In this case node knows the recent Masterchain block but can not check account state in recent shardchain block and returns Failed to get account state. - - -### Failed to unpack account state - -``` -Failed to unpack account state -``` -This error means that requested account doesn't exist in current state. That means that this account is simultaneously is not deployed AND has zero balance - -### Cannot apply external message to current state : External message was not accepted - -``` -Cannot apply external message to current state : External message was not accepted -``` -This error means that contract didn't accepted external message. You need to find exitcode in trace. -13 means that account doesn't have enough TON to accept message (or it requires more than gas_credit). In case of wallet contracts exitcode=33 means wrong seqno (probably seqno data you use is outdatd), exitcode=34 means wrong subwallet_id (for old wallets v1/v2 it means wrong signature), exitcode=35 means that either message is expired (wallets v1-v3) or signature is wrong (v4r2), exitcode=36 means message is expired (usually it means that system time is incorrect). - -### What does Error 651 mean? - -`[Error : 651 : no nodes]` indicates that your node cannot locate another node within the TON Blockchain. - -Sometimes, this process can take up to 24 hours. However, if you've been receiving this error for several days, that means that your node cannot synchronize via a current network connection. - -:::tip Solution -You need to check the firewall settings, including any [NAT](/participate/run-nodes/full-node#port-forwarding) settings if they exist. - -It should allow incoming connections on one specific port and outgoing connections from any port. -::: - -### Validator console is not settings - -If you encounter the `Validator console is not settings` error, it indicates that you are running `MyTonCtrl` from a user other than the one you used for the installation. - -:::tip Solution -Run `MyTonCtrl` from [the user you've installed](/participate/run-nodes/full-node#prerequisites-1) it (non-root sudo user). - -```bash -mytonctrl -``` -::: - -### What does "block is not applied" mean? - -__Q:__ Sometimes we get `block is not applied` or `block is not ready` for various requests - is this normal? - -__A:__ This is normal, typically this means you tried to retrieve block, which does not reach the node you asked. - -__Q:__ If comparative frequency appears, does it mean there is a problem somewhere? - -__A:__ No. You need to check "Local validator out of sync" value in mytonctrl. If it's less than 60 seconds, then everything is fine. - -But you need to keep in mind that the node is constantly synchronizing. Sometimes, you may try to receive a block that has not reached the node you requested. - -You need to repeat the request with a slight delay. - -### Out of Sync Issue with -d Flag - -If you encounter an issue where the `out of sync` equals the timestamp after downloading `MyTonCtrl` with the `-d` flag, it's possible that the dump wasn't installed correctly (or it's already outdated). - -:::tip Solution -The recommended solution is to reinstall `MyTonCtrl` again with the new dump. -::: - -If syncing takes an unusually long time, there may have been issues with the dump. Please [contact us](https://t.me/SwiftAdviser) for assistance. - -Please, run `mytonctrl` from the user you've installed it. - - -### Error command<...> timed out after 3 seconds - -This error means that the local node is not yet synchronized(out of sync lesser then 20 sec) and public nodes are being used. -Public nodes do not always respond and end up with a timeout error. - -:::tip Solution -The solution to the problem is to wait for the local node to synchronize or execute the same command several times before execution. -::: - -### Status command displays without local node section - -![](\img\docs\full-node\local-validator-status-absent.png) - -If there is no local node section in the node status, typically this means, something went wrong during installation and the step of creating/assigning a validator wallet was skipped. -Also check that the validator wallet is specified. - -Check directly the following: - -```bash -mytonctrl> get validatorWalletName -``` - -If validatorWalletName is null then execute the following: - -```bash -mytonctrl> set validatorWalletName validator_wallet_001 -``` - -### Status error on Testnet - -![](\img\docs\full-node\status-error.jpg) - -This error could be seen on Testnet network on `status` command. Use the following instead: - -```bash -mytonctrl> status fast -``` - -### Transfer a Validator on the new Server - -:::info -Transfer all keys and configs from the old to the working node and start it. In case something goes wrong on the new one, there is still the source where everything is set up. -::: - -The best way (while the penalty for temporary non-validation is small, it can be done without interruption): - -1. Perform a clean installation on the new server using `mytonctrl`, and wait until everything is synchronized. - -2. Stop the `mytoncore` and validator `services` on both machines, make backups on the source and on the new one: - -- 2.1 `/usr/local/bin/mytoncore/...` -- 2.2 `/home/${user}/.local/share/mytoncore/...` -- 2.3 `/var/ton-work/db/config.json` -- 2.4 `/var/ton-work/db/config.json.backup` -- 2.5 `/var/ton-work/db/keyring` -- 2.6 `/var/ton-work/keys` - - -3. Transfer from the source to the new one (replace the contents): - -- 3.1 `/usr/local/bin/mytoncore/...` -- 3.2 `/home/${user}/.local/share/mytoncore/...` -- 3.3 `/var/ton-work/db/config.json` -- 3.4 `/var/ton-work/db/keyring` -- 3.5 `/var/ton-work/keys` - -4. In `/var/ton-work/db/config.json` edit `addrs[0].ip` to the current one, which was after installation (can be seen in the backup `/ton-work/db/config.json.backup`) - -5. Check the permissions on all replaced files - -6. On the new one, start the `mytoncore` and `validator` services, check that the node synchronizes and then validates - -7. On the new one, make a backup: - -```bash -cp var/ton-work/db/config.json var/ton-work/db/config.json.backup -``` diff --git a/docs/participate/run-nodes/mytonctrl.mdx b/docs/participate/run-nodes/mytonctrl.mdx new file mode 100644 index 0000000000..b9a0b60773 --- /dev/null +++ b/docs/participate/run-nodes/mytonctrl.mdx @@ -0,0 +1,606 @@ +# MyTonCtrl + +## Overview + +To install and manage your own node, use the **MyTonCtrl** open-source tool developed by the TON Foundation. The majority of TON Nodes are reliable and tested by **MyTonCtrl**. + +[MyTonCtrl](https://github.com/ton-blockchain/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 wallet, domain, and validator management tasks on the Linux operating system. + +Actually, there is [MyTonCtrl2](https://github.com/ton-blockchain/mytonctrl/tree/mytonctrl2) with a lot of improvements ([single nominator pool](/participate/network-maintenance/single-nominator), more checks, etc.). + +We are actively seeking feedback about the installation process. If you have any questions or suggestions, please [contact us](https://t.me/Alexgton). + +## General Commands + +### help + +No args, print help text + +### clear + +No args, clear console + +### exit + +No args, exit from console. + +### update + +Update 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/mytonctrl2` | Update from specified URL | +| Branch Only format | `update [BRANCH]` | `update mytonctrl2` | 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 mytonctrl2` | Update from branch specified by second argument of specified repository | + +### upgrade + +Update 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 branch specified by second argument of specified repository | + +### status + +Get 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` | Must be used on TestNet. Status report without validator efficiency and online validators count. | + +### installer + +No args, run the installer of TON modules (script /usr/src/mytonctrl/mytoninstaller.py) + +### status_modes + +No args, show MTC modes. + +### status_settings + +No args, show all available settings with their description and values. + +### enable_mode + +Enable a specific mode. + +```bash +MyTonCtrl> enable_mode +``` + +### disable_mode + +Disable a specific mode. + +```bash +MyTonCtrl> disable_mode +``` + +### about + +Provide a description of the specified mode + +```bash +MyTonCtrl> about +``` + +### get + +Get the value of a specific setting in JSON format + +```bash +MyTonCtrl> setting +``` + +### set + +Set the specified value of a specified setting. Skip setting existence checking if `--force` enabled + +```bash +MyTonCtrl> set [--force] +``` + +### rollback + +No args, rollback to mytonctrl 1.0. + +### getconfig + +Retrieves and prints the JSON representation of the configuration specified by `` + +```bash +MyTonCtrl> getconfig +``` + +### get_pool_data + +Retrieves and prints the JSON representation of the pool data specified by `` or ``. + +```bash +MyTonCtrl> get_pool_data < | > +``` + +## Overlays + +### add_custom_overlay + +Adds a custom overlay with the given `` using the configuration specified by `` + +```bash +MyTonCtrl> add_custom_overlay +``` + +### list_custom_overlays + +No args, prints custom overlays + +### delete_custom_overlay + +Deletes the custom overlay with the specified `` + +```bash +MyTonCtrl> delete_custom_overlay +``` + +## Validator + +### vo + +Votes for the offer specified by `` + +```bash +MyTonCtrl> vo +``` + +### ve + +No args, vote for election + +### vc + +Votes for the complaint specified by `` in the election specified by `` + +```bash +MyTonCtrl> vc <, > +``` + +## Pool commands + +### deposit_to_pool + +Deposits the specified `` to the pool specified by `` + +```bash +MyTonCtrl> deposit_to_pool +``` + +### withdraw_from_pool + +Withdraws the specified `` from the pool specified by `` + +```bash +MyTonCtrl> withdraw_from_pool +``` + +### cleanup + +No args, cleanup validator database + +### benchmark + +No args, prints table with several tests + +## Single pool + +### new_single_pool + +Creates a new single pool with the specified `` and `` + +```bash +MyTonCtrl> new_single_pool +``` + +### activate_single_pool + +Activates the single pool specified by `` + +```bash +MyTonCtrl> activate_single_pool +``` + +## Wallet management + +### Importing a wallet + +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. + +#### Importing Using a Private Key + +If you have access to a private key, you can easily import a wallet: + +```bash +MyTonCtrl> iw +``` + +Here, `` is your private key in base64 format. + +#### Importing Using a Mnemonic Phrase + +If you have a mnemonic phrase (a sequence of 24 words like `tattoo during ...`), follow these steps: + +1. Install Node.js. +2. Clone and install [mnemonic2key](https://github.com/ton-blockchain/mnemonic2key): + ``` + git clone https://github.com/ton-blockchain/mnemonic2key.git + cd mnemonic2key + npm install + ``` +3. Run the following command, replacing `word1`, `word2`... with your mnemonic phrase and `address` with the address of your wallet contract: + ``` + node index.js word1 word2 ... word24 [address] + ``` +4. The script will generate `wallet.pk` and `wallet.addr`. Rename them to `imported_wallet.pk` and `imported_wallet.addr`. +5. Copy both files to the `~/.local/share/mytoncore/wallets/` directory. +6. Open the mytonctrl console and list the wallets using the `wl` command. +7. Verify that the wallet has been imported and displays the correct balance. +8. You can now send funds using the `mg` command. Enter `mg` to view the help documentation. + Remember to replace placeholders (words inside `< >`) with your actual values when running commands. + +### Show the list of wallets + +```bash +MyTonCtrl> wl +``` + +![](/img/docs/mytonctrl/wl.png) + + +### Create a new local wallet + +Also you can create new empty wallet: + +```bash +MyTonCtrl> nw [ ] +``` + +### Activate a local wallet + +If you want to use wallet it have to be activated: + +```bash +MyTonCtrl> aw +``` + +But before activating, send 1 Toncoin to wallet: + +```bash +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: + +```bash +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 + +```bash +MyTonCtrl> seqno +``` + +![](/img/docs/mytonctrl/nw.png) + +### Set a wallet version + +This command is needed when a modified wallet with interaction methods similar to a regular one is used. + +```bash +MyTonCtrl> swv +``` + +### Export a wallet + +It's possible to get a certain wallet address and secret key. + +```bash +MyTonCtrl> ew +``` + +![](/img/docs/mytonctrl/ew.png) + +### Delete a local wallet + +```bash +MyTonCtrl> dw +``` + +![](/img/docs/mytonctrl/dw.png) + + +## Account and Transaction commands + +### Account status + +To check account status and its transaction history use the following command: + +```bash +MyTonCtrl> vas +``` + +![](/img/docs/mytonctrl/vas.png) + +### Account history + +To check account transaction history use the following command using the number of listed operations as `limit`: + +```bash +MyTonCtrl> vah +``` + +![](/img/docs/mytonctrl/vah.png) + +### Transfer coins + +Transfer coins from local wallet to an account: + +```bash +MyTonCtrl> mg +``` + +:::caution +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: + +```bash +MyTonCtrl> mgtp +``` + +## General Pools Commands + +There are two types of pools in **MyTonCtrl2**: + +1. [Nominator Pool](/participate/network-maintenance/nominator-pool) +2. [Single Nominator Pool](/participate/network-maintenance/single-nominator) + +All of them are managed by the following set of commands: + +### List of pools + +```bash +MyTonCtrl> pools_list +``` + +![](/img/docs/mytonctrl/test-pools-list.png) + +### Delete a pool + +```bash +MyTonCtrl> delete_pool +``` + +### Importing a pool + +You can create already created pool to the list of local pools: + +```bash +MyTonCtrl> import_pool +``` + +## Bookmarks + +You can create an alias (bookmark) for an account address to simplify it usage. + +### Create a new bookmark + +```bash +MyTonCtrl> nb +``` + +![](/img/docs/mytonctrl/nb.png) + +### Show the list of bookmarks + +```bash +MyTonCtrl> bl +``` + +![](/img/docs/mytonctrl/bl.png) + +### Delete a bookmark + +```bash +MyTonCtrl> db +``` + +![](/img/docs/mytonctrl/db.png) + +## 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 + +```bash +MyTonCtrl> od [offer-hash] +``` + +### el + +Show 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: Prints full Pubkey. +- wallet: Prints 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: Prints full Pubkey. +- wallet: Prints 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 + +### help + +prints all available commands + +### clear + +clear terminal + +### exit + +exit from mytoninstaller terminal + +### status + +prints 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. | + +Possible 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 | 2592000 if liteserver mode was enabled during installation process, otherwise 86400 | + +### enable + +Enable one of the modes, for `ton-http-api` creates config + +```bash +MyTonInstaller> enable +``` + +Modes can have following names: +- FN - Full Node +- VC - Validator Console +- LS - Lite Server +- DS - DHT Server +- JR - Jsonrpc +- THA - TON HTTP API +- LSP - ls proxy +- TSP - TON storage + TON storage provider + +### update + +Same as `enable` of mytoninstaller + +### plsc + +Print liteserver config + +Example: +```json +{ + "ip": 1111111111, + "port": 11111, + "id": { + "@type": "pub.ed25519", + "key": "UURGaaZZjsBbKHvnrBqslHerXYbMCVDKdswKNJvAHkc=" + } +} +``` + +### clcf + +Create local config file + +### print_ls_proxy_config + +Print ls proxy config + +### create_ls_proxy_config_file + +Do nothing for now, on development stage + +### drvcf + +Dangerous recovery validator config file + +### setwebpass + +Set a password for the web admin interface, runs `python3 /usr/src/mtc-jsonrpc/mtc-jsonrpc.py -p`. + +## See Also + +* [FAQ](/participate/run-nodes/faq) +* [Troubleshooting](/participate/run-nodes/nodes-troubleshooting) \ No newline at end of file diff --git a/docs/participate/run-nodes/nodes-troubleshooting.md b/docs/participate/run-nodes/nodes-troubleshooting.md new file mode 100644 index 0000000000..86849fb731 --- /dev/null +++ b/docs/participate/run-nodes/nodes-troubleshooting.md @@ -0,0 +1,162 @@ +# Troubleshooting + +This section contains answers to the most frequently asked questions about running nodes. + + +## Failed to get account state + +``` +Failed to get account state +``` + +This error means that there are issues during search for this account in shard state. +Most probably it means that liteserver node is syncing too slow, in particular the Masterchain synchronisation overtook shardchains (Basechain) synchronisation. In this case node knows the recent Masterchain block but can not check account state in recent shardchain block and returns Failed to get account state. + + +## Failed to unpack account state + +``` +Failed to unpack account state +``` +This error means that requested account doesn't exist in current state. That means that this account is simultaneously is not deployed AND has zero balance + +## Cannot apply external message to current state : External message was not accepted + +``` +Cannot apply external message to current state : External message was not accepted +``` +This error means that contract didn't accepted external message. You need to find exitcode in trace. -13 means that account doesn't have enough TON to accept message (or it requires more than gas_credit). In case of wallet contracts exitcode=33 means wrong seqno (probably seqno data you use is outdatd), exitcode=34 means wrong subwallet_id (for old wallets v1/v2 it means wrong signature), exitcode=35 means that either message is expired or signature is wrong. + +## What does Error 651 mean? + +`[Error : 651 : no nodes]` indicates that your node cannot locate another node within the TON Blockchain. + +Sometimes, this process can take up to 24 hours. However, if you've been receiving this error for several days, that means that your node cannot synchronize via a current network connection. + +:::tip Solution +You need to check the firewall settings, including any NAT settings if they exist. + +It should allow incoming connections on one specific port and outgoing connections from any port. +::: + +## Validator console is not settings + +If you encounter the `Validator console is not settings` error, it indicates that you are running `MyTonCtrl` from a user other than the one you used for the installation. + +:::tip Solution +Run `MyTonCtrl` from [the user you've installed](/participate/run-nodes/full-node#prerequisites-1) it (non-root sudo user). + +```bash +mytonctrl +``` +::: + +###Running MyTonCtrl as Different User + +Running MyTonCtrl as a different user may trigger the following error: + +```bash +Error: expected str, bytes or os.PathLike object, not NoneType +``` + +To resolve this, you should run MyTonCtrl as the user who installed it. + +## What does "block is not applied" mean? + +__Q:__ Sometimes we get `block is not applied` or `block is not ready` for various requests - is this normal? + +__A:__ This is normal, typically this means you tried to retrieve block, which does not reach the node you asked. + +__Q:__ If comparative frequency appears, does it mean there is a problem somewhere? + +__A:__ No. You need to check "Local validator out of sync" value in mytonctrl. If it's less than 20 seconds, then everything is fine. + +But you need to keep in mind that the node is constantly synchronizing. Sometimes, you may try to receive a block that has not reached the node you requested. + +You need to repeat the request with a slight delay. + +## Out of Sync Issue with -d Flag + +If you encounter an issue where the `out of sync` equals the timestamp after downloading `MyTonCtrl` with the `-d` flag, it's possible that the dump wasn't installed correctly (or it's already outdated). + +:::tip Solution +The recommended solution is to reinstall `MyTonCtrl` again with the new dump. +::: + +If syncing takes an unusually long time, there may have been issues with the dump. Please [contact us](https://t.me/SwiftAdviser) for assistance. + +Please, run `mytonctrl` from the user you've installed it. + + +## Error command<...> timed out after 3 seconds + +This error means that the local node is not yet synchronized(out of sync lesser then 20 sec) and public nodes are being used. +Public nodes do not always respond and end up with a timeout error. + +:::tip Solution +The solution to the problem is to wait for the local node to synchronize or execute the same command several times before execution. +::: + +## Status command displays without local node section + +![](\img\docs\full-node\local-validator-status-absent.png) + +If there is no local node section in the node status, typically this means, something went wrong during installation and the step of creating/assigning a validator wallet was skipped. +Also check that the validator wallet is specified. + +Check directly the following: + +```bash +mytonctrl> get validatorWalletName +``` + +If validatorWalletName is null then execute the following: + +```bash +mytonctrl> set validatorWalletName validator_wallet_001 +``` + + +## Transfer a Validator on the new Server + +:::info +Transfer all keys and configs from the old to the working node and start it. In case something goes wrong on the new one, there is still the source where everything is set up. +::: + +The best way (while the penalty for temporary non-validation is small, it can be done without interruption): + +1. Perform a clean installation on the new server using `mytonctrl`, and wait until everything is synchronized. + +2. Stop the `mytoncore` and validator `services` on both machines, make backups on the source and on the new one: + +- 2.1 `/usr/local/bin/mytoncore/...` +- 2.2 `/home/${user}/.local/share/mytoncore/...` +- 2.3 `/var/ton-work/db/config.json` +- 2.4 `/var/ton-work/db/config.json.backup` +- 2.5 `/var/ton-work/db/keyring` +- 2.6 `/var/ton-work/keys` + + +3. Transfer from the source to the new one (replace the contents): + +- 3.1 `/usr/local/bin/mytoncore/...` +- 3.2 `/home/${user}/.local/share/mytoncore/...` +- 3.3 `/var/ton-work/db/config.json` +- 3.4 `/var/ton-work/db/keyring` +- 3.5 `/var/ton-work/keys` + +4. In `/var/ton-work/db/config.json` edit `addrs[0].ip` to the current one, which was after installation (can be seen in the backup `/ton-work/db/config.json.backup`) + +5. Check the permissions on all replaced files + +6. On the new one, start the `mytoncore` and `validator` services, check that the node synchronizes and then validates + +7. On the new one, make a backup: + +```bash +cp var/ton-work/db/config.json var/ton-work/db/config.json.backup +``` + +## See Also + +* [MyTonCtrl FAQ](/participate/run-nodes/faq) \ No newline at end of file diff --git a/docusaurus.config.js b/docusaurus.config.js index 94667bb298..16de3949c1 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -362,34 +362,49 @@ const config = { label: 'Nodes', items: [ { - to: 'participate/nodes/node-types', + to: '/participate/run-nodes/mytonctrl', + label: 'MyTonCtrl', + }, + { + to: '/participate/nodes/node-types', label: 'Node Types', }, { - to: 'https://ton.org/validator', - label: 'Become a Validator', + to: '/participate/run-nodes/full-node', + label: 'Full Node', + }, + { + to: '/participate/run-nodes/enable-liteserver-node', + label: 'Liteserver Node', }, { - to: 'participate/run-nodes/full-node', - label: 'Run a Full Node', + to: '/participate/run-nodes/become-validator', + label: 'Validator Node', }, { - to: 'https://docs.ton.org/participate/run-nodes/full-node#enable-liteserver-mode', - label: 'Enable Liteserver', + to: '/participate/run-nodes/archive-node', + label: 'Archive Node', }, { - to: 'participate/run-nodes/archive-node', - label: 'Run an Archive Node', + to: '/participate/run-nodes/nodes-troubleshooting', + label: 'Troubleshooting the Node', }, { to: '/participate/network-maintenance/single-nominator', label: 'Single Nominator Pool', }, - + { + to: '/participate/network-maintenance/nominator-pool', + label: 'Nominator Pool', + }, { to: '/participate/network-maintenance/vesting-contract', label: 'Vesting Contract', }, + { + to: '/participate/run-nodes/faq', + label: 'FAQ', + }, ], }, { @@ -454,9 +469,9 @@ const config = { 'aria-label': 'GitHub repository', }, { - type: 'localeDropdown', - position: 'right', - }, + type: 'localeDropdown', + position: 'right', + }, ], }, footer: { diff --git a/i18n/mandarin/docusaurus-plugin-content-docs/current/participate/run-nodes/full-node.mdx b/i18n/mandarin/docusaurus-plugin-content-docs/current/participate/run-nodes/full-node.mdx index 9b65b30d74..c665ec1a89 100644 --- a/i18n/mandarin/docusaurus-plugin-content-docs/current/participate/run-nodes/full-node.mdx +++ b/i18n/mandarin/docusaurus-plugin-content-docs/current/participate/run-nodes/full-node.mdx @@ -201,7 +201,7 @@ su - **status**命令输出的示例: -![status](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/mytonctrl-status.png) +![status](/docs/participate/run-nodes/images/mytonctrl-status.png) :::caution 确保状态输出相同 对于所有类型的节点,**Local Validator status**部分应该显示。 @@ -222,7 +222,7 @@ wl 在安装**mytonctrl**期间,将创建**validator_wallet_001**钱包: -![wallet list](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytonctrl-wl_ru.png) +![wallet list](/docs/participate/run-nodes/images/manual-ubuntu_mytonctrl-wl_ru.png) ### 激活钱包 @@ -247,7 +247,7 @@ vas aw [wallet name] ``` -![account history](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytonctrl-vas-aw_ru.png) +![account history](/docs/participate/run-nodes/images/manual-ubuntu_mytonctrl-vas-aw_ru.png) ### 您的验证者现已准备就绪 @@ -259,7 +259,7 @@ set stake 50000 `set stake 50000` — 这将质押代币大小设置为50k coins。如果质押代币被接受并且我们的节点成为验证者,那么质押代币只能在第二次选举中提取(根据选民的规则)。 -![setting stake](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytonctrl-set_ru.png) +![setting stake](/docs/participate/run-nodes/images/manual-ubuntu_mytonctrl-set_ru.png) ## 启用Liteserver模式 @@ -292,8 +292,7 @@ Hetzner和OVH被禁止运行验证者,但您可以使用它们运行liteserver 2. 创建配置文件 ```bash -MyTonCtrl> installer -MyTonInstaller> clcf +MyTonCtrl> installer clcf 本地配置文件已创建:/usr/bin/ton/local.config.json ``` @@ -550,7 +549,7 @@ sudo ufw enable - 要检查**mytoncrl**日志,请打开本地用户的`~/.local/share/mytoncore/mytoncore.log`,或者Root的`/usr/local/bin/mytoncore/mytoncore.log`。 -![logs](https://raw.githubusercontent.com/ton-blockchain/mytonctrl/master/screens/manual-ubuntu_mytoncore-log.png) +![logs](/docs/participate/run-nodes/images/manual-ubuntu_mytoncore-log.png) ## 故障排除 diff --git a/sidebars.js b/sidebars.js index c8b49b41f5..0b7714648e 100644 --- a/sidebars.js +++ b/sidebars.js @@ -663,12 +663,17 @@ const sidebars = { label: 'Blockchain Nodes', items: [ 'participate/nodes/node-types', + 'participate/run-nodes/mytonctrl', 'participate/run-nodes/full-node', + 'participate/run-nodes/enable-liteserver-node', + 'participate/run-nodes/become-validator', 'participate/run-nodes/archive-node', + 'participate/run-nodes/nodes-troubleshooting', //'participate/run-nodes/liteserver', //'participate/nodes/nodes-faq', 'participate/nodes/node-maintenance-and-security', 'participate/run-nodes/local-ton', + 'participate/run-nodes/faq', ], }, { @@ -677,6 +682,7 @@ const sidebars = { items: [ 'participate/network-maintenance/staking-incentives', 'participate/network-maintenance/single-nominator', + 'participate/network-maintenance/nominator-pool', 'participate/network-maintenance/vesting-contract', 'participate/network-maintenance/nominators', 'participate/network-maintenance/persistent-states', diff --git a/static/img/docs/mytonctrl/bl.png b/static/img/docs/mytonctrl/bl.png new file mode 100644 index 0000000000..d4b77805cf Binary files /dev/null and b/static/img/docs/mytonctrl/bl.png differ diff --git a/static/img/docs/mytonctrl/db.png b/static/img/docs/mytonctrl/db.png new file mode 100644 index 0000000000..32adb33532 Binary files /dev/null and b/static/img/docs/mytonctrl/db.png differ diff --git a/static/img/docs/mytonctrl/dw.png b/static/img/docs/mytonctrl/dw.png new file mode 100644 index 0000000000..936a192829 Binary files /dev/null and b/static/img/docs/mytonctrl/dw.png differ diff --git a/static/img/docs/mytonctrl/ew.png b/static/img/docs/mytonctrl/ew.png new file mode 100644 index 0000000000..be197e1515 Binary files /dev/null and b/static/img/docs/mytonctrl/ew.png differ diff --git a/static/img/docs/mytonctrl/nb.png b/static/img/docs/mytonctrl/nb.png new file mode 100644 index 0000000000..2d3bc5e202 Binary files /dev/null and b/static/img/docs/mytonctrl/nb.png differ diff --git a/static/img/docs/mytonctrl/nw.png b/static/img/docs/mytonctrl/nw.png new file mode 100644 index 0000000000..8cb9e1440e Binary files /dev/null and b/static/img/docs/mytonctrl/nw.png differ diff --git a/static/img/docs/mytonctrl/test-pools-list.png b/static/img/docs/mytonctrl/test-pools-list.png new file mode 100644 index 0000000000..9b8b31c394 Binary files /dev/null and b/static/img/docs/mytonctrl/test-pools-list.png differ diff --git a/static/img/docs/mytonctrl/tetsnet-conf.png b/static/img/docs/mytonctrl/tetsnet-conf.png new file mode 100644 index 0000000000..1d29369832 Binary files /dev/null and b/static/img/docs/mytonctrl/tetsnet-conf.png differ diff --git a/static/img/docs/mytonctrl/vah.png b/static/img/docs/mytonctrl/vah.png new file mode 100644 index 0000000000..190e714ea0 Binary files /dev/null and b/static/img/docs/mytonctrl/vah.png differ diff --git a/static/img/docs/mytonctrl/vas.png b/static/img/docs/mytonctrl/vas.png new file mode 100644 index 0000000000..e3f2557e91 Binary files /dev/null and b/static/img/docs/mytonctrl/vas.png differ diff --git a/static/img/docs/mytonctrl/wl.png b/static/img/docs/mytonctrl/wl.png new file mode 100644 index 0000000000..33919f8239 Binary files /dev/null and b/static/img/docs/mytonctrl/wl.png differ diff --git a/static/img/docs/nodes-validator/manual-ubuntu_mytoncore-log.png b/static/img/docs/nodes-validator/manual-ubuntu_mytoncore-log.png new file mode 100644 index 0000000000..9a3ea61325 Binary files /dev/null and b/static/img/docs/nodes-validator/manual-ubuntu_mytoncore-log.png differ diff --git a/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-set_ru.png b/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-set_ru.png new file mode 100644 index 0000000000..86c0795dd8 Binary files /dev/null and b/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-set_ru.png differ diff --git a/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-vas-aw_ru.png b/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-vas-aw_ru.png new file mode 100644 index 0000000000..99592eb878 Binary files /dev/null and b/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-vas-aw_ru.png differ diff --git a/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-wl_ru.png b/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-wl_ru.png new file mode 100644 index 0000000000..a9971f5633 Binary files /dev/null and b/static/img/docs/nodes-validator/manual-ubuntu_mytonctrl-wl_ru.png differ diff --git a/static/img/docs/nodes-validator/mytonctrl-status.png b/static/img/docs/nodes-validator/mytonctrl-status.png new file mode 100644 index 0000000000..4582c7b8d9 Binary files /dev/null and b/static/img/docs/nodes-validator/mytonctrl-status.png differ