See [https://docs.ton.dev](https://docs.ton.dev) for documentation. Also check our [Youtube channel](https://www.youtube.com/channel/UC9kJ6DKaxSxk6T3lEGdq-Gg) for tutorials.
# Install ```shell npm install -g ton-dev-cli ```
or
sudo npm install -g ton-dev-cli
# Basic operations
ton-dev-cli
package installs its executable tondev
globally, so you could
use it everywhere in your file system.
Type:
tondev
info
(or justtondev
) - to see current statustondev
-V
- to seeton-dev-cli
versiontondev
-a
- to see versions of the compilers and node containers available in DockerHub registrytondev
-h
ortondev
--help
for the help about usage, options and subcommands
You can see additional help about subcommands by using
tondev <subcommand> -h
ortondev <subcommand> --help
command!
In order to get started, run: tondev setup
The command triggers Docker image pull from DockerHub registry and launches the corresponding containers:
- tonlabs/compilers-<local user name> that is used for building solidity contracts
- tonlabs/local-node-<local user name> is a local TON node container runs compiled contracts.
You can specify additional options to customize the installation:
-n
,--networks
-m
,--compilers
To start and stop both containers, use the tondev start
and tondev stop
commands.
Use these commands to save machine resources.
-
restart
restarts the installed containers. -
recreate
removes containers and re-creates them again. Start tondev utility again after. -
-n
,--networks [names]
applies the command to specified network(s) (use comma to separate) -
-m
,--compilers applies
the command to the compiler kit container
To test your contract at multiple nodes, create a network. A network consists of multiple inter-connected local nodes.
A single run of tondev setup
creates a single local node listening to port 80.
In order to add another node:
tondev add anotherNode
tondev set --port 81 anotherNode
tondev add
adds another node to network config. By default it uses port 80.
Given that multiple nodes cannot use the same port, reset the port with tondev set -p
.
Note: You can add multiple nodes simultaneously by separating names with a space.
It is useful to expose ArangoDB built in each local node. To do it, run:
tondev set --db-port 8881 anotherNode
Instead of the port number you can specify "bind" to use the default Arango DB port or "unbind" to stop exposing the port.
In order to rename a node, run:
tondev set --new-name newName oldName
To remove a node run tondev remove anotherNode
or tondev rm anotherNode
.
Solidity contracts are compiled with the following command:
tondev sol [options] [files...]
The following options are available:
-l
,--client-languages <languages>
to generate client code for languages: "js", "rs" (use comma to separate several languages)-L
,--client-level <client-level>
client code level: "run" to run only, "deploy" to run and deploy (includes an imageBase64 of a binary contract)
tondev CLI allows switching between compiler versions; run:
tondev use 0.14.0
The command pulls a relevant Docker container. You can also run:
tondev use [options] <version> to use specified version for containers
In order to remove Docker containers and images related to TON Dev, run:
tondev clean
The following options are available to customize the command:
-n
,--networks
clean local node docker containers and images-m
,--compilers
clean compilers docker containers and images-c
,--containers
clean containers only (default: false)
If no option is specified, the command removes all TON Dev docker containers and images.
command: keys
Usage: tondev keys|k
[options]
Generate random Key Pair