Sign inSign up

trinketer22/func_docker

By trinketer22

•Updated about 1 year ago

Docker images for testing funC contracts via toncli

Image
0

2.7K

trinketer22/func_docker repository overview

⁠FunC docker

⁠Goal

Main goal of this repo is to make testing of TON⁠ contracts code easy and reliable.

⁠Source

Images are built from https://github.com/Trinketer22/func_docker⁠ repo.
Any kind of contribution is welcome!

⁠Toncli

Is a tool for building/testing/interacting with TON contracts.
Check it out:https://github.com/disintar/toncli⁠

⁠Images

Multi arch support amd64 and arm64/v8 (M1 compatible).

  • latest/main based on Ubuntu 20.04 and supposed to be WSL compatible.
  • slim based on alpine linux and supposed to be as slim as possibe.

⁠Usage

Run docker tag trinketer22/func_docker toncli-local to give image shorter alias.

⁠Creating project

Run

docker run --rm -it \
-v ~/Dev:/code \
toncli-local start --name test_project wallet 

You're going to see the toncli project structure in ~/Dev/test_project
README.md build fift func project.yaml tests

⁠Building

Run

docker run --rm -it \
-v ~/Dev/test_project:/code \
toncli-local build
⁠Running tests
docker run --rm -it \
-v ~/Dev/test_project:/code \
toncli-local run_tests
⁠Deploying contract

Now here is the tricky part.
Toncli stores deployment info in it's config directory instead of your project directory.
So we're going to have to create another volume for that to persist.

Run

docker run --rm -it \
-v ~/Dev/test_project:/code \
-v /path/to/toncli_conf_dir/:/root/.config \
toncli-local update_libs

After that you should go through standard toncli initialization dialog and pass absolute paths to the binaries

  • /usr/local/bin/func
  • /usr/local/bin/fift
  • /usr/local/bin/lite-client

Don't get confused those path's are inside the docker image and not your local system.
After that you should get an initialized toncli directory on your local system at /path/to/toncli_conf_dir/toncli.
Looking like:

config.ini
fift-libs
func-libs
test-libs

Now you can use it in the deploy or any other process like so.

Run

docker run --rm -it \
-v /path/to/project:/code \
-v /path/to/toncli_conf_dir/:/root/.config \
toncli-local deploy --net testnet

wallet directory would be created inside your local config dir with all the usefull deployment information

⁠General usage
docker run --rm -it \
-v <code_volume> \
-v [optional config volume] \
<docker image name> \
<toncli command you want to run>

Tag summary

Content type

Image

Digest

sha256:66032c143…

Size

172.4 MB

Last updated

about 1 year ago

docker pull trinketer22/func_docker