Sign inSign up

theanurin/tonos-cli

By theanurin

Updated almost 2 years ago

Image
0

2.2K

theanurin/tonos-cli repository overview

Docker Image Version Docker Image Size Docker Pulls Docker Stars

TON OS command line tool

tonos-cli is a command line interface utility designed to work with TON blockchain.

Image reason

Just a free contribution into Free TON ecosystem.

Spec

The image is built as command line tool (tonos-cli as entrypoint) to be able to use as alias on host system.

Volumes

  • /data - default work (current) directory for tonos-cli. Used for share configs, keys, etc...

Inside

Launch

Test

docker run --interactive --tty --rm theanurin/tonos-cli

Usage

First, you have to create a directory on a host for configs, keys, etc... (using .tonos-cli-data inside home directory in example bellow)

mkdir "${HOME}/.tonos-cli-data"

It is pretty cool to make alias like:

alias tonos-cli='docker run --interactive --tty --rm --mount "type=bind,source=${HOME}/.tonos-cli-data,target=/data" theanurin/tonos-cli'
alias tonos-cli='docker run --interactive --tty --rm --mount "type=bind,source=${PWD}/.tonos.local,target=/data" theanurin/tonos-cli:alpine'

tonos-cli --help
tonos-cli [subcommand args]

Support

Sample Test Sequence

  1. Prepare test environment by creating data directory, generate config for test network and download SafeMultisigWallet contract.
    mkdir "${HOME}/.tonos-cli-data-simpletest"
    cd "${HOME}/.tonos-cli-data-simpletest"
    alias tonos-cli='docker run --interactive --tty --rm --mount "type=bind,source=${HOME}/.tonos-cli-data-simpletest,target=/data" theanurin/tonos-cli'
    
    # Generate configuration file tonos-cli.conf.json
    tonos-cli config
    
    # Download contract
    wget https://raw.githubusercontent.com/tonlabs/ton-labs-contracts/776bc3d614ded58330577167313a9b4f80767f41/solidity/safemultisig/SafeMultisigWallet.abi.json
    wget https://raw.githubusercontent.com/tonlabs/ton-labs-contracts/776bc3d614ded58330577167313a9b4f80767f41/solidity/safemultisig/SafeMultisigWallet.tvc
    
    # Self check
    cat ./tonos-cli.conf.json
    cat ./SafeMultisigWallet.abi.json
    sha1sum ./SafeMultisigWallet.abi.json # Expected: 1c33f77ca18d2cedee23f3e78596fab0ce9f1b33
    sha1sum ./SafeMultisigWallet.tvc # Expected: 7c5605a0d12637309cd5f57330af76e971c76a3b
    
    Of coure, you may use own contract instead SafeMultisigWallet.
  2. Genrarate your keypair
    tonos-cli genphrase
    tonos-cli getkeypair ./keyfile.json '<Seed phrase of previous command>'
    
    # Self check
    cat ./keyfile.json
    
    Of coure, you may use own keypair.
  3. Deploy SafeMultisigWallet contract
    # Obtain account (address)
    tonos-cli genaddr --setkey keyfile.json ./SafeMultisigWallet.tvc ./SafeMultisigWallet.abi.json
    
    # Double check that account is Uninit
    tonos-cli account 0:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    # THERE YOU HAVE TO MAKE LITTLE DEPOSIT TO THE ACCOUNT (because deployment requires fee)
    
    # Deploy contract (with single owner). Where yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy is "public" field from your ./keyfile.json
    tonos-cli deploy --sign keyfile.json --abi ./SafeMultisigWallet.abi.json ./SafeMultisigWallet.tvc \
    '{"owners":["0xyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"],"reqConfirms":1}'
    
  4. Enjoy

Tag summary

Content type

Image

Digest

sha256:843b90bc2

Size

35.7 MB

Last updated

almost 2 years ago

docker pull theanurin/tonos-cli