> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ton.org/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.ton.org/feedback

```json
{
  "path": "/ecosystem/nodes/cpp/mytonctrl/installer",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Installer

> MyTonInstaller complements MyTonCtrl by bootstrapping and maintaining TON node components.

Run these commands from the installer context of mytonctrl:

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
MyTonCtrl> installer
Installer>
```

## status

**Purpose:** Inspect whether required TON services and credentials are in place, and review the current node arguments.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
status
```

**Behavior**

* Checks for the presence of validator, mytoncore, console, and liteserver artifacts under `/var/ton-work` and reports each as enabled/disabled.
* Loads the active node argument list (from `set_node_argument`) and prints every flag with its stored values.
* Does not modify any files, making it safe to rerun as a health check.

## set\_node\_argument

**Purpose:** Add, update, or remove TON validator/validator-engine command-line arguments.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
set_node_argument <arg-name> [arg-value] [-d]
```

**Behavior**

* Requires at least the argument name (for example, `--archive-ttl`, `-M`, `--add-shard`).
* When additional values are provided, they are concatenated and passed to the helper script `set_node_argument.py`, which edits `/etc/ton/validator-engine.conf`-style settings.
* Use `-d` as the final flag to delete the argument instead of setting a value.
* Runs with root privileges to ensure the validator configuration is writable.

**Examples**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
set_node_argument --archive-ttl 86400
set_node_argument --add-shard 0:2000000000000000 0:a000000000000000
set_node_argument --archive-ttl -d
```

## enable

**Purpose:** Provision or activate bundled components such as the validator console, liteserver, or auxiliary services.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
enable <code>
```

**Behavior**

* Accepts one of the codes listed below and invokes the corresponding setup routine through `mytoninstaller -e enable<code>`.
* If you enable the TON HTTP API (`THA`), the installer first generates a local liteserver config by running `clcf` automatically.
* All routines run with elevated privileges because they create system users, service units, configuration files, or keys.

**Supported codes**

| Code  | Component            | Purpose                                                                                                                   | Key tasks                                                                                                                                                                                       |
| ----- | -------------------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `FN`  | First node bootstrap | Prepare a fresh validator environment so MyTonCtrl can manage a node end-to-end.                                          | Creates the validator system user, installs the validator engine as a systemd service, generates the initial `config.json`, downloads blockchain dumps, and performs the first validator start. |
| `VC`  | Validator console    | Provide secure CLI access to the validator engine for MyTonCtrl and operators.                                            | Generates server/client key pairs, wires them into `validator.config.json`, updates MyTonCore with console credentials, and restarts validator + MyTonCore to apply.                            |
| `LS`  | liteserver           | Enable the local liteserver endpoint used by tooling and APIs.                                                            | Creates liteserver keys, registers them in `validator.config.json`, updates MyTonCore’s lite-client section, and restarts services to expose the port locally.                                  |
| `DS`  | DHT server           | Run a standalone DHT node so the validator can advertise itself through the ADNL network.                                 | Installs and enables the TON DHT service, provisions keys, selects public ports, generates/prints the ADNL address list, and starts the daemon under systemd.                                   |
| `JR`  | JSON-RPC frontend    | Install [MyTonCtrl’s JSON-RPC bridge](https://github.com/igroman787/mtc-jsonrpc) for programmatic control.                | Executes `jsonrpcinstaller.sh` with root privileges to deploy the service, wiring it for the current node user.                                                                                 |
| `THA` | TON HTTP API         | Expose the [TON HTTP API](https://github.com/toncenter/ton-http-api) backed by the local liteserver for REST-like access. | Generates a fresh liteserver config when needed and runs `ton_http_api_installer.sh` to install and configure the HTTP API service.                                                             |
| `LSP` | ls-proxy             | Proxy the liteserver connection for safer remote access and load balancing.                                               | Installs the ls-proxy binary, creates a systemd unit, bootstraps the config with local liteserver credentials, and starts the proxy service.                                                    |
| `TS`  | TON Storage          | Provide local TON Storage capabilities for block archives and state downloads.                                            | Deploys `tonutils-storage`, configures public UDP/API ports and external IP, persists the config, registers connectivity details in MyTonCore, and starts the storage daemon.                   |

**Example**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
enable FN
```

## update

**Purpose:** Rerun enablement routines for installed components to pull updates or repair their configuration.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
update <code>
```

**Behavior**

* Shares the same code list and internal handler as `enable`, but intended for repeat executions when you need to refresh binaries or regenerate configs (for example, after package updates).
* `update JR` is the common shorthand for reinstalling or updating the JSON-RPC service.
* Requires the same elevated privileges as `enable` because it delegates to the same installer events.

**Example**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
update JR
```

## plsc

**Purpose:** Print the current liteserver configuration JSON.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
plsc
```

**Behavior**

* Reads the configuration produced by `GetLiteServerConfig` (typically `/usr/bin/ton/local.config.json`) and prints it as pretty JSON.
* Useful for verifying that liteserver keys, ports, and peers match expectations after running `enable LS` or `clcf`.

## clcf

**Purpose:** Create or refresh the liteserver local configuration file.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
clcf [-u <user>]
```

**Behavior**

* Fetches the latest init block via TON API; if unavailable, falls back to the bundled `global.config.json`.
* Base64-encodes the init block and invokes `mytoninstaller -e clc -i <base64>` under the specified user (defaults to the installer’s current user).
* Writes `/usr/bin/ton/local.config.json` and related liteserver files so that services like TON HTTP API can start.

**Examples**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
clcf
clcf -u validator
```

## print\_ls\_proxy\_config

**Purpose:** Display the active ls-proxy configuration file.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
print_ls_proxy_config
```

**Behavior**

* Reads `/var/ls_proxy/ls-proxy-config.json` (via `get_ls_proxy_config`) and prints it in formatted JSON.
* Allows quick inspection of proxy targets after running `enable LSP`.

## create\_ls\_proxy\_config\_file

**Purpose:** Placeholder for generating an ls-proxy config file.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
create_ls_proxy_config_file
```

**Behavior**

* Outputs `TODO` because the implementation is not there yet.
* Use `print_ls_proxy_config` or edit `/var/ls_proxy/ls-proxy-config.json` manually until this command is implemented.

## `drvcf`

**Purpose:** Rebuild `config.json` for the validator engine using existing key material (dangerous recovery).

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
drvcf
```

**Behavior**

* Calls `DangerousRecoveryValidatorConfigFile`, which scans `/var/ton-work/db/keyring`, recent election dumps, and mytoncore settings to reconstruct validator, liteserver, control, DHT, and ADNL entries.
* Prints the reconstructed configuration and any unused keys so you can review the output before applying it manually.
* Intended for disaster recovery scenarios; it does not overwrite files automatically.

## setwebpass

**Purpose:** Set or change the password for the MyTonCtrl web administration (JSON-RPC) interface.

**Syntax**

```mytonctrl theme={"theme":{"light":"github-light-default","dark":"dark-plus"},"languages":{"custom":["/resources/grammars/tolk.tmLanguage.json","/resources/grammars/tlb.tmLanguage.json","/resources/grammars/fift.tmLanguage.json","/resources/grammars/tasm.tmLanguage.json","/resources/grammars/func.tmLanguage.json"]}}
setwebpass
```

**Behavior**

* Runs `/usr/src/mtc-jsonrpc/mtc-jsonrpc.py -p`, prompting for the new password and updating the credential store.
* No arguments are accepted; rerun whenever you need to rotate web admin credentials.
