npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tondev

v0.11.2

Published

TON Dev Environment

Downloads

196

Readme

Get quick help in our telegram channel:

Channel on Telegram

Content Table

What is TONDev?

TONDev is a Node.js package with CLI interface that allows to perform the following use-cases from the single interface for Developer:

Use-cases

  • Easily manage all the core Free TON Developer Tools
  • Configure networks (including Local Blockchain, Developer Network, Free TON(main) network): add, configure giver;
  • Manage keys: add, remove
  • Work with Free TON blockchain from CLI

Also, this project serves as a backend for TONDev VS Code extension.

What tools does it support?

Components are downloaded and installed automatically for the target platform upon the first request.

  • Solidity Compiler

  • C/C++ Compiler

  • Contract Management Tool - Work with your contracts from CLI. Deploy and run your contracts with convenient CLI commands.

  • Network Tool - manage your networks: add, remove, configure givers.

  • Signer Tool - manage your keys and seedphrases: create your secret once and use it via alias with Contract Management Tool. Really easy.

  • TON OS Startup Edition – Local blockchain for development and testing

  • Debot Browser - Web debot browser. For now, Extraton Debot Browser is supported. Support of Surf Debot Browser is coming.

  • TestSuite4 – Python lightweight framework for contract testing.

  • tonos-cli – Command line tool for multisigwallet management and staking, includes CLI Debot Browser. TONDev helps with installation and version management.

TONDev can be extended with other tools following the instructions of integration.

Quick Start

Get your hands dirrty with our great tools:) Follow the Quick Start to get on board of Free TON Development ASAP!

Installation

Prerequisites

Install

npm i -g tondev

If you see an EACCESS error when you try to install a package globally on Mac or Linux, please see this instruction

Download

You can download precompiled binaries for your platform from the latest release. After download you need to create directory if it does not exists.

For linux/macos:

mkdir -p ~/.tondev/bin

Then unpack tondev from archive into this folder.

For windows:

md $env:HOMEDRIVE$env:HOMEPATH\.tondev\bin

Then move downloaded binary as tondev.exe into this folder.

To make it possible to run tondev from any folder, you need to update the system PATH environment variable.

For linux/macos:

echo 'export PATH=~/.tondev/bin:$PATH' >> ~/.profile && source ~/.profile

For windows run PowerShell and execute this line:

[System.Environment]::SetEnvironmentVariable("PATH", "$env:HOMEDRIVE$env:HOMEPATH\.tondev\bin;$([System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User))", [System.EnvironmentVariableTarget]::User)

After trying to run tondev on macos you can see the error: "tondev" cannot be opened because the developer cannot be verified. Open your computer System Preferences > Security & Privacy > Privacy. Here, you should see an option to click "Allow Anyway" next to the "tondev" application in question.

Update

npm r -g tondev
npm i -g tondev

Use in JS applications

You can easily use tondev as a regular npm package in your JS applications.

Just add dependency into you package.json:

npm i -s tondev

And then run any command from tondev:

const { consoleTerminal, runCommand } = require("tondev");
const path = require("path");

async function main() {
    await runCommand(consoleTerminal, "sol compile", {
        file: path.resolve(__dirname, "Hello.sol")
    });
}

main();

Command Line Interface

Quick start

Start testing your contracts without any delay with this guide. It will help you get test tokens in Developer Network, prepare your environment and test your first contract. Test my first contract!

General command syntax

tondev <tool> <command> ...args

Some tools (network, signer, contract, js) and commands have short aliases. For example instead of using tondev network list you can use tondev n l and even shorter tondev nl.

Solidity

Create your first contract

This command creates a hello-world Solidity contract with comments that you can observe and compile.

tondev sol create Contract

Compile

This command compiles and links a selected Solidity contract. After successful compilation you get .abi.json and .tvc files that you can later use in your DApps to deploy and run contract methods.

tondev sol compile Contract.sol

To save generated assembler code use -c option (default is false)

tondev sol compile Contract.sol -c path/to/output/file

Assembler code will be saved in path/to/output/file with the extension code

You can specify the output files location with the -o option:

tondev sol compile Contract.sol -o path/to/output/file

Ast

This command parses a ton-solidity file and creates an abstract syntax tree (AST) to the output directory.

tondev sol ast Contract.sol

To specify the ast format type, use -f or --format option:

tondev sol ast-json Contract.sol -f <json | compact-json>

To point the location of the output folder, use the -o or --output-dir option:

tondev sol ast-json Contract.sol -f <json | compact-json> -o path/to/output/file

Version

This command shows the currently installed Solidity compiler version.

tondev sol version

Update

This command updates the compiler and linker to the latest version.

tondev sol update

Attention! Use --force option to force update of components that do not update their version.

Set

This command sets the compiler and linker versions and downloads them if needed.

tondev sol set --compiler 0.38.0 --linker 0.23.54

Attention! Use --force option to force update of components that do not update their version.

C++

Create your first contract

This command creates a basic C++ contract with comments that you can observe and compile.

tondev clang create Contract

Compile

This command compiles and links a selected C++ contract. After successful compilation you get .abi.json and .tvc files that you can later use in your DApps to deploy and run contract methods.

tondev clang compile Contract.cpp

Version

This command shows the currently installed C++ compiler version.

tondev clang version

Update

This command updates the compiler to the latest version.

tondev clang update

Use --force or -f option to force reinstall, if the compiler is already up to date.

Set

This command sets the compiler version and downloads it if needed.

tondev clang set --compiler 7.0.0

Use --force or -f option to force reinstall, if the current version is the same as the requested version.

TON OS Startup Edition(SE)

Start

This command starts the TON OS SE container (Docker must be launched). When executed for the first time downloads the latest SE image from dockerhub.

tondev se start

Version

This command shows the default TON OS SE version and list of other available versions.

tondev se version

default: 0.24.12
Available Versions: 0, 0.24, 0.24.5, 0.24.6, 0.24.8, 0.24.9, 0.24.10, 0.24.11, 0.24.12, latest

Set

This command switches TON OS SE to the specified version and port and downloads it, if it is missing. Attention! This command does not start TON OS SE, you need to run start command separately.

tondev se set --version 0.24.11 --port 2020

Reset

This command resets the TON OS SE container (Docker must be launched) - restarts it from scratch with a clean database.

tondev se reset

Update

This command downloads the latest TON OS SE image (Docker must be launched) and starts it.

tondev se update

Stop

This command stops TON OS SE container.

tondev se stop

Info

This command shows info about the downloaded versions.

tondev se info

Instance  State    Version  GraphQL Port  ArangoDB Port  Docker Container            Docker Image
--------  -------  -------  ------------  -------------  --------------------------  --------------------------
default   running  0.24.12  2020                         tonlabs-tonos-se-ekaterina  tonlabs/local-node:0.24.12

SDK

See the list of available demo projects

This command shows the list of available demo projects

tondev js demo

Result:

$ tondev js demo
Demo          Description
------------  -------------------------
hello-wallet  Simple NodeJs Application

Install demo project

This command installs the specified demo project to the current directory. Proceed the instructions in the terminal to run it.

tondev js demo hello-wallet

Create an empty project

This command creates a Node.js project with SDK latest dependencies and index.js file with main Client object creation.

tondev js create test_project

Create contract JS wrapper

This command takes abi and, optionally, tvc file and generates a JS wrapper with abi and tvc converted into base64 that can be used further in SDK. tvc file must have the same name as abi.

tondev js wrap contractName.abi.json

The result name of the wrapper will be "ContractName||"Contract".js".

See other available generation options with help command:

tondev js wrap -h
TONDev Version: 0.4.0
Use: tondev js wrap file [options]
Args:
    file  ABI file
Options:
    --help, -h    Show command usage
    --print, -p   Print code to console
    --output, -o  Set output file name (default is built from source ABI file name)
    --export, -e  Export type and options
                  commonjs          Use CommonJS modules (NodeJs)
                  commonjs-default  Use CommonJS modules (NodeJS) with default export
                  es6               Use ES6 modules
                  es6-default       Use ES6 modules with default export

tonos-cli

TONDev installs tonos-cli globally, so after the installation is complete, you can access the functionality via command:

tonos-cli <command> <args>

See the tonos-cli usage documentation. See tonos-cli guides.

Install

This command installs the latest tonos-cli

tondev tonos-cli install

The installer requires NPM to be installed, so it can install packages globally without using sudo. In case of error, manually set environment variable PATH=$PATH:$HOME/.tondev/solidity

Version

This command shows the used tonos-cli version and list of available for download versions

tondev tonos-cli version

Version    Available
---------  ------------------------------------------------------
0.8.1      0.6.0, 0.6.1, 0.6.2, 0.7.1, 0.6.3, 0.7.0, 0.8.0, 0.8.1

Set

This command specifies tonos-cli version to use and downloads it if needed.

tondev tonos-cli set --version 0.8.0

Update

This command updates tonos-cli version to the latest

tondev tonos-cli update

TestSuite4

TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It contains lightweight blockchain emulator making it easy to develop contracts in a TDD-friendly style.

For more information, visit TestSuite4's documentation.

:information_source: Python 3.6 - 3.9 and pip required.

Version

This command shows the currently installed and available TestSuite4 framework versions.

tondev ts4 version

Install

This command installs (using pip) TestSuite4's latest or selected version and downloads them if needed.

tondev ts4 install # install latest version

tondev ts4 install 0.2.0 # install version 0.2.0

Update

This command updates TestSuite4 to the latest version.

tondev ts4 update

Create

This command creates a TestSuite4's template of the test (TestName.py).

tondev ts4 create TestName

tondev ts4 create TestName --folder tests # creates tests/TestName.py (folder must exist)

Run

This command runs selected test (TestName.py).

tondev ts4 run TestName

Signer Tool

Signer registry is a centralized place where you can store your development keys.

Each signer in registry has an unique user defined name. All tondev commands that require signing or encryption refer to the signer by name.

You can mark one of the signers as a default. It can be used in signing commands without providing signer option.

Signer repository management in tondev is accessible through the signer tool.

Note: If you need to generate an unsigned message, you may use the option --signer none in any relevant commands in other controllers. Omitting the signer option altogether always means using the default signer.

Note: Keys in the repository are stored unencrypted.

Add a signer with randomly generated keys

This command adds a signer with randomly generated keys.

tondev signer generate signer_name

See other available generation options with help command:

tondev signer generate -h
TONDev Version: 0.5.0
Use: tondev signer generate name [options]
Args:
    name  Signer name
Options:
    --help, -h        Show command usage
    --mnemonic, -m    Use mnemonic phrase
    --dictionary, -d  Mnemonic dictionary
                      0  TON
                      1  English
                      2  Chinese Simplified
                      3  Chinese Traditional
                      4  French
                      5  Italian
                      6  Japanese
                      7  Korean
                      8  Spanish
    --words, -w       Number of mnemonic words
    --force, -f       Overwrite signer if already exists

Add a signer with specific keys

This command adds a signer with previously generated (e.g. with tonos-cli) keys.

tondev signer add signer_name signer_secret_key_or_seed_phrase_in_quotes

See other available signer addition options with help command:

tondev signer add -h
TONDev Version: 0.5.0
Use: tondev signer add name secret [options]
Args:
    name    Signer name
    secret  Secret key or seed phrase
Options:
    --help, -h        Show command usage
    --dictionary, -d  Mnemonic dictionary
                      0  TON
                      1  English
                      2  Chinese Simplified
                      3  Chinese Traditional
                      4  French
                      5  Italian
                      6  Japanese
                      7  Korean
                      8  Spanish
    --force, -f       Overwrite signer if already exists

Note: By default the dictionary is set to english, which allows using seed phrases generated by other TONOS tools, such as tonos-cli.

List registered signers

This command lists all registered signers with their public keys.

tondev signer list

Result:

$ tondev signer list

Signer           Public Key
---------------  ----------------------------------------------------------------
sign1 (Default)  cffd3a2f1d241807b2205220a7d6df980e67a3cc7c47eba2766cdc1bbddfc0e3
sign2            0fc4e781720d80f76257db333c6b6934090562418652cf30352878c87707aa94

Get signer details

This command lists all information (including secret data) for a specified signer.

tondev signer info signer_name

Result:

$ tondev signer info sign2
{
    "name": "sign2",
    "description": "",
    "keys": {
        "public": "760d69964d038997d891fca0a0407c2ffefb701e7cb2f9ff0a87fbbf1e8098f2",
        "secret": "72571b5a9392e6bb215b460ca3c0545c34d790e185f66f5b2e7564329ffea86c"
    }
}

Set default signer

This command sets a previously added signer as default (initially the first added signer is used by default).

tondev signer default signer_name

Delete a signer

This command deletes a previously added signer from signer registry.

tondev signer delete signer_name

Network Tool

Network tool is a convenient way to organize all of your network configurations in one place.

You can register several blockchains (networks) under short names and then use these names as a target blockchain when working with contracts.

You can mark one of the networks as a default. It can be used in network commands without providing net name.

Add a network

This command adds a network to the tondev registry.

tondev network add network_name network_endpoints

See other available network addition options with help command:

$ tondev network add -h
TONDev Version: 0.5.0
Use: tondev network add name endpoints [options]
Args:
    name
    endpoints  Comma separated endpoints
Options:
    --help, -h   Show command usage
    --force, -f  Overwrite key if already exists

Example with all main.ton.dev endpoints:

tondev network add main main.ton.dev,main2.ton.dev,main3.ton.dev,main4.ton.dev

Set a giver for a network

This command sets a giver account for a network. Giver will be used to top up your account balances on the network, including during deployment.

tondev network giver network_name giver_address

See other available network addition options with help command:

$ tondev network giver -h
TONDev Version: 0.5.0
Use: tondev network giver name address [options]
Args:
    name     Network name
    address  Giver address
Options:
    --help, -h    Show command usage
    --signer, -s  Signer to be used with giver
    --value, -v   Deploying account initial balance in nanotokens

Note: The default signer and the initial balance value of 10 tokens will be used, unless otherwise specified through options. Also note, that some contracts may require a higher initial balance for successful deployment. DePool contract, for instance, requires a minimun of 21 tokens.

Only one giver can be set for a network. Setting another one will overwrite the current giver. To view the current giver settings for all networks, use the tondev network list command (for details see the section below).

List registered networks

This command lists all registered networks, their public endpoints, and their giver addresses, if any.

tondev network list

Result:

$ tondev network list
Network        Endpoints                                        Giver
-------------  -----------------------------------------------  ------------------------------------------------------------------
se             http://localhost                                 0:b5e9240fc2d2f1ff8cbb1d1dee7fb7cae155e5f6320e585fcc685698994a19a5
dev (Default)  net.ton.dev, net1.ton.dev, net5.ton.dev          0:255a3ad9dfa8aa4f3481856aafc7d79f47d50205190bd56147138740e9b177f3
main           main.ton.dev, main2.ton.dev, main3.ton.dev, ...

Set default network

This command sets a previously added network as default (initially the mainnet is used by default).

tondev network default network_name

Delete a network

This command deletes a network from tondev registry.

tondev network delete network_name

Contract Management

Contract management in tondev gives you the ability to easily deploy and run your smart contracts on blockchain network(s).

View contract info

This command displays a detailed summary for a contract. Contract ABI and TVC files are required to run it. Account address on the network is calculated from TVC and signer.

tondev contract info abi_filename

Result example:

$ tondev contract info SetcodeMultisigWallet.abi.json

Configuration

  Network: dev (net.ton.dev, net1.ton.dev, net5.ton.dev)
  Signer:  test (public ad4bf7bd8da244932c52127a943bfa9217b6e215c1b3307272283c4d64f34486)

Address:   0:04dee1edc3f3d6b23529dcf5a6133627d06a39826bb14cc6334ffea272b15d50 (calculated from TVC and signer public)
Code Hash: e2b60b6b602c10ced7ea8ede4bdf96342c97570a3798066f3fb50a4b2b27a208 (from TVC file)
Account:   Active
Balance:   1919381000 (≈ 2 tokens)
Details:   {
    "json_version": 5,
    "id": "0:04dee1edc3f3d6b23529dcf5a6133627d06a39826bb14cc6334ffea272b15d50",
    "workchain_id": 0,
    "boc": "te6ccgECZwEAGvQAAm/AAE3uHtw/PW ... 4MEDIoIQ/////byxkOAB8AH4R26Q3o (6912 bytes)",
    "last_paid": 1619084675,
    "bits": "0xcbc7",
    "cells": "0x67",
    "public_cells": "0x0",
    "last_trans_lt": "0x3baac81fb43",
    "balance": "0x72676e08",
    "code": "te6ccgECXwEAGcoAAib/APSkICLAAZ ... wQMighD////9vLGQ4AHwAfhHbpDeg= (6614 bytes)",
    "code_hash": "e2b60b6b602c10ced7ea8ede4bdf96342c97570a3798066f3fb50a4b2b27a208",
    "data": "te6ccgEBBwEA7gAC361L972NokSTLF ... S/Xy90TNN3lUFM1WGpdlIcBQDAAAFA (249 bytes)",
    "data_hash": "ec28abd34e75f40a66561bdc06b436cbe24d10d5da7519a7d5db41026c67155d",
    "acc_type": 1,
    "acc_type_name": "Active"
}

Network, signer, data and account address parameters can be overridden with the following options:

$ tondev contract info -h
TONDev Version: 0.5.0
Use: tondev contract info file [options]
Args:
    file  ABI file
Options:
    --help, -h     Show command usage
    --network, -n  Network name
    --signer, -s   Signer key name
    --data, -d     Deploying initial data as name:value,...
                   This data is required to calculate the account address and to
                   deploy contract.
                   Array values must be specified as [item,...]. Spaces are not
                   allowed. If value contains spaces or special symbols "[],:"
                   it must be enclosed in "" or ''
    --address, -a  Account address

Deploy contract

This command deploys a contract to the blockchain. Contract ABI and TVC files are required to run it.

tondev contract deploy abi_filename

Command displays deployment summary and requests constructor function parameters. Result example:

$ tondev contract deploy Contract.abi.json

Configuration

  Network: dev
  Signer:  sign1

Address: 0:0435cb4e70585759ac514bb9fd1770caeb8c3941d882b5a16d589b368cb49261

Enter constructor parameters

  param1 (uint256[]): value

Enter constructor parameters

  param2 (uint8): value

Deploying...

Deploy parameters can be specified in the deploy command with the following options:

$ tondev contract deploy -h
TONDev Version: 0.5.0
Use: tondev contract deploy file function [options]
Args:
    file      ABI file
    function  Function name
Options:
    --help, -h        Show command usage
    --network, -n     Network name
    --signer, -s      Signer key name
    --input, -i       Function parameters as name:value,...
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --data, -d        Deploying initial data as name:value,...
                      This data is required to calculate the account address and to
                      deploy contract.
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --value, -v       Deploying balance value in nano tokens
    --prevent-ui, -p  Prevent user interaction
                      Useful in shell scripting e.g. on server or in some
                      automating to disable waiting for the user input.
                      Instead tondev will abort with error.
                      For example when some parameters are missing in command line
                      then ton dev will prompt user to input values for missing
                      parameters (or fails if prevent-ui option is specified).

Example of a 2/3 multisig wallet deployment command:

tondev contract deploy SetcodeMultisigWallet.abi.json constructor -n dev -s sign1 -i owners:[0xad4bf7bd8da244932c52127a943bfa9217b6e215c1b3307272283c4d64f34486,0x5c2e348c5caeb420a863dc5e972f897ebe5ee899a6ef2a8299aac352eca4380a,0x8534c46f7a135058773fa1298cb3a299a5ddd40dafe41cb06c64f274da360bfb],reqConfirms:2

Run contract deployed on the network

This command runs any function of a contract deployed on the blockchain. Contract ABI and TVC files are required to run it.

tondev contract run abi_filename

Command displays available functions and asks to select one. Result example:

$ tondev contract run Contract.abi.json

Configuration

  Network: dev
  Signer:  sign1

Address: 0:a4629d617df931d8ad86ed24f4cac3d321788ba082574144f5820f2894493fbc

Available functions:

  1) func1
  2) func2

  Select function (number): 2

Running...

Network, signer and account address parameters can be overridden and function parameters specified in the command with the following options:

$ tondev contract run -h
TONDev Version: 0.5.0
Use: tondev contract run file function [options]
Args:
    file      ABI file
    function  Function name
Options:
    --help, -h        Show command usage
    --network, -n     Network name
    --signer, -s      Signer key name
    --data, -d        Deploying initial data as name:value,...
                      This data is required to calculate the account address and to
                      deploy contract.
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --address, -a     Account address
    --input, -i       Function parameters as name:value,...
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --prevent-ui, -p  Prevent user interaction
                      Useful in shell scripting e.g. on server or in some
                      automating to disable waiting for the user input.
                      Instead tondev will abort with error.
                      For example when some parameters are missing in command line
                      then ton dev will prompt user to input values for missing
                      parameters (or fails if prevent-ui option is specified).

Example of creating a transaction and confirming it in a multisig wallet:

tondev contract run SetcodeMultisigWallet.abi.json submitTransaction -n dev -s sign1 -i dest:255a3ad9dfa8aa4f3481856aafc7d79f47d50205190bd56147138740e9b177f3,value:500000000,bounce:true,allBalance:false,payload:""
tondev contract run SetcodeMultisigWallet.abi.json confirmTransaction -n dev -a 0:04dee1edc3f3d6b23529dcf5a6133627d06a39826bb14cc6334ffea272b15d50 -s sign2 -i transactionId:6954030467099431873

To execute a contract without signing, use signer none option:

tondev contract run --signer none --address <address>

or

tondev contract run -s none -a <address>

In this case you have to explicitly specify address in run function because otherwise tondev may calculate a wrong address from empty pubkey.

To execute a smart contract function with bytes argument, the argument needs to be in hex format.

Example:

cat bytes | xxd -p | tr -d '\n' > bytes.hex
tondev contract run contract.abi.json fucntion_name -i value:$(cat bytes.hex)

Execute a smart contract function with structure argument:

tondev contract run shapes.tvc \
    --address 0:540c1837656674d548c934258ddec9b5fd11b543da977b0016c14b5650bc7eb5 \
    --input '{ "point": { "color": "red", "center": { "x": 1, "y": 2 } } }'

Run contract locally on TVM

This command downloads a contract and runs it locally on TVM. Contract ABI and TVC files are required to run it.

tondev contract run-local abi_filename

Command displays available functions and asks to select one. Result example:

$ tondev contract run-local Contract.abi.json
Configuration

  Network: dev
  Signer:  sign1

Address: 0:a4629d617df931d8ad86ed24f4cac3d321788ba082574144f5820f2894493fbc

Available functions:

  1) func1
  2) func1

  Select function (number):

Network, signer and account address parameters can be overridden and function parameters specified in the command with the following options:

$ tondev contract run-local -h
TONDev Version: 0.5.0
Use: tondev contract run-local file function [options]
Args:
    file      ABI file
    function  Function name
Options:
    --help, -h        Show command usage
    --network, -n     Network name
    --signer, -s      Signer key name
    --data, -d        Deploying initial data as name:value,...
                      This data is required to calculate the account address and to
                      deploy contract.
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --address, -a     Account address
    --input, -i       Function parameters as name:value,...
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --prevent-ui, -p  Prevent user interaction
                      Useful in shell scripting e.g. on server or in some
                      automating to disable waiting for the user input.
                      Instead tondev will abort with error.
                      For example when some parameters are missing in command line
                      then ton dev will prompt user to input values for missing
                      parameters (or fails if prevent-ui option is specified).

Emulate transaction executor locally on TVM

This command downloads a contract and emulates transaction execution locally on TVM. Contract ABI and TVC files are required to run it.

tondev contract run-executor abi_filename

Command displays available functions and asks to select one. Result:

$ tondev contract run-executor Contract.abi.json

Configuration

  Network: dev
  Signer:  sign1

Address: 0:a4629d617df931d8ad86ed24f4cac3d321788ba082574144f5820f2894493fbc

Available functions:

  1) func1
  2) func2

  Select function (number):

Network, signer and account address parameters can be overridden and function parameters specified in the command with the following options:

$ tondev contract run-executor -h
TONDev Version: 0.5.0
Use: tondev contract run-executor file function [options]
Args:
    file      ABI file
    function  Function name
Options:
    --help, -h        Show command usage
    --network, -n     Network name
    --signer, -s      Signer key name
    --data, -d        Deploying initial data as name:value,...
                      This data is required to calculate the account address and to
                      deploy contract.
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --address, -a     Account address
    --input, -i       Function parameters as name:value,...
                      Array values must be specified as [item,...]. Spaces are not
                      allowed. If value contains spaces or special symbols "[],:"
                      it must be enclosed in "" or ''
    --prevent-ui, -p  Prevent user interaction
                      Useful in shell scripting e.g. on server or in some
                      automating to disable waiting for the user input.
                      Instead tondev will abort with error.
                      For example when some parameters are missing in command line
                      then ton dev will prompt user to input values for missing
                      parameters (or fails if prevent-ui option is specified).

Top up contract balance from giver

If you have set a giver for a network, you can top up contract balances on it with the following command.

tondev contract topup abi_filename

Defalt signer and giver parameters will be used, unless otherwise specified through the following options:

$ tondev contract topup -h
TONDev Version: 0.5.0
Use: tondev contract topup file [options]
Args:
    file  ABI file
Options:
    --help, -h     Show command usage
    --address, -a  Account address
    --network, -n  Network name
    --signer, -s   Signer key name
    --data, -d     Deploying initial data as name:value,...
                   This data is required to calculate the account address and to
                   deploy contract.
                   Array values must be specified as [item,...]. Spaces are not
                   allowed. If value contains spaces or special symbols "[],:"
                   it must be enclosed in "" or ''
    --value, -v    Deploying balance value in nano tokens

To top up any known address without providing keys or contract files, use the following command:

tondev contract topup --address <address>

or

tondev ct -a <addrress>

DeBrowser

The ExtraTON DeBot Browser.

Version

This command shows the list of available versions.

tondev debrowser version

Available Versions: 1.1.0, 1.2.0, 1.2.1, 1.3.1

Interfaces

This command shows the list of implemented interfaces.

tondev debrowser interfaces

Realised interfaces:
 - Address Input
 - Amount Input
 - Confirm Input
 - Menu
 - Network
 - Number Input
 - QR Code
 - Signing Box Input
 - Terminal
 - User Info

Start

This command downloads image and starts DeBrowser container (Docker must be launched).

tondev debrowser start 1.3.1

Stop

This command stops DeBrowser container.

tondev debrowser stop

View controller info

This command displays a summary of all controller configurations.

tondev info

Output example:

$ tondev info

C++ compiler

Component  Version  Available
---------  -------  ---------
clang      7.0.0    7.0.0

Solidity Compiler

Component  Available
---------  ----------------------------------------------
compiler   0.42.0, 0.41.0, 0.40.0, 0.39.0, 0.38.2, 0.38.1
linker     0.3.0, 0.1.0
stdlib     0.42.0, 0.41.0, 0.40.0, 0.39.0, 0.38.2, 0.38.1

TON OS SE

Instance  State          Version  GraphQL Port  Docker Container      Docker Image
--------  -------------  -------  ------------  --------------------  -----------------------
default   not installed  0.27     80            tonlabs-tonos-se-test  tonlabs/local-node:0.27

Network Registry

Network        Endpoints                                        Giver
-------------  -----------------------------------------------  ------------------------------------------------------------------
se             http://localhost                                 0:b5e9240fc2d2f1ff8cbb1d1dee7fb7cae155e5f6320e585fcc685698994a19a5
dev (Default)  net.ton.dev, net1.ton.dev, net5.ton.dev          0:255a3ad9dfa8aa4f3481856aafc7d79f47d50205190bd56147138740e9b177f3
main           main.ton.dev, main2.ton.dev, main3.ton.dev, ...

Signer Registry

Signer          Public Key
--------------  ----------------------------------------------------------------
surf            8534c46f7a135058773fa1298cb3a299a5ddd40dafe41cb06c64f274da360bfb
test (Default)  ad4bf7bd8da244932c52127a943bfa9217b6e215c1b3307272283c4d64f34486
test2           5c2e348c5caeb420a863dc5e972f897ebe5ee899a6ef2a8299aac352eca4380a

TON OS CLI

Component  Version  Available
---------  -------  --------------------------------------------------------------------------------
tonoscli   0.11.3   0.11.4, 0.11.3, 0.11.2, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.2, 0.9.1, 0.9.0, ...

TONDev Extensibility

TON Dev Environment is an integration point for development tools related to Free TON Blockchain.

There are two kind of software connected to TONDev:

  • Development tools such as a compilers, networks, debuggers and so on.
  • User Interaction services such as an IDE plugins, CLI, GUI applications etc.

Learn more about creating your own controller: Creating Controller

Troubleshooting

If you encountered any problem try to seek the solution in Troubleshooting Notes. If it didn't help - please, ask in our telegram channel.