How to install¶
Using Docker¶
Using ft with Docker will work on Linux, Mac OS and Windows.
The latest image of ft is available on:
https://hub.docker.com/r/ocamlpro/ft
You just need to copy the script (either for Linux/MacOS or Windows) on your computer and run it!
There are a few known limitations:
- All files to which you refer should be in the current directory (or its subdirectories)
- You cannot update the utility tools (solc, tvm_linker, etc.) using
ft init
Build and install¶
In the following, you will need to use the OCaml Package Manager
called opam. It is available from
https://github.com/ocaml/opam (you can directly download binary
versions from the Releases section, just make sure to choose a version
above 2.0.0).
From OPAM¶
For now, these packages are available from https://github.com/OCamlPro/ocp-opam-repository .
You can use:
$ opam repo add ocp git+https://github.com/OCamlPro/ocp-opam-repository
$ opam install ft --destdir $HOME/local
to get ft installed as $HOME/local/bin/ft.
You can then either add $HOME/local/bin to your PATH
or copy the binary in another directory in your PATH.
From Sources¶
First, you need a switch with at least version 4.10.0 of OCaml,
you can for example create it with:
$ opam switch create 4.10.0
Second, checkout the sources of freeton_wallet in a directory:
$ git clone git@github.com:OCamlPro/freeton_wallet.git
Then, you need to install all the dependencies:
$ cd freeton_wallet/
$ opam repo add ocp git+https://github.com/OCamlPro/ocp-opam-repository
$ opam install --deps-only ./ft.opam
Finally, you can build the package ft:
$ eval $(opam env)
$ dune build
The ft binary should be available in the top directory, you
can copy it somewhere in your PATH.
Initial Configuration¶
To be able to use ft, we will need some tools from TON-SDK
(tonos-cli, tvm_linker, solc and
stdlib_sol.tvm) to be installed in $HOME/.ft/bin/.
For that, ft provides a simple command that will download
their sources and build them, provided that you have a recent version
of Rust installed:
$ ft init
If it fails, you may have to do it manually:
- Follow the steps from https://github.com/tonlabs/tonos-cli, and copy
tonos-cliinto$HOME/.ft/bin/ - Follow the steps in https://github.com/tonlabs/TON-Solidity-Compiler,
and copy the resulting files (
solcfrombuild/solcandstdlib_sol.tvmfromlib/stdlib_sol.tvm) into$HOME/.ft/bin/ - Follow the steps from https://github.com/tonlabs/TVM-linker, and copy
tvm_linker/target/release/tvm_linkerinto$HOME/.ft/bin/
Note that you only need the steps (2) and (3) if you plan to build and deploy smart contracts.
FreeTON Crawler ft crawler¶
The ft crawler command requires a specific installation.
Indeed, this command crawls the blockchain and stores events for a
specific contract in the local PostgresQL database.
You will need to configure PostgresQL to use it:
$ sudo -i -u postgres
$ psql
CREATE USER <user>;
ALTER ROLE <user> CREATEDB;
The command ft crawler account will create a database
account. You can check it afterwards, for this example using
psql account.