TON (Telegram Open Network) use the principle «Proof of Stake». This requires the use of masternodes. Third-party developers (validators) are owners of Masternodes.
This image was made especially for launch Free TON Network.
- Free TON Community
- The Declaration of Decentralization
- Join the Community channel
- Join the Contest channel
- TON Live explorer
- TON Full Node HOWTO
- Image Maintaner Support channel
-
Docker Host check list:
- - Empty directory for global configuration, let's say
/ton/etc
- - Empty directory for TON database, let's say
/ton/db
According recommendations you need 1000 GB (prefer SSD) for the database directory.
- - Empty directory for global configuration, let's say
-
Fetch latest version of the image
docker pull cexiolabs/freeton-validator
-
Start a container
docker run --name freeton-validator --interactive --tty --network host --mount type=bind,source=/ton/etc,target=/etc/ton --mount type=bind,source=/ton/db,target=/var/ton cexiolabs/freeton-validator
On first launch the container will enter into setup mode, due your directories
/ton/etc
and/ton/db
are empty. Let answer for a few questions:- Choose template of global.config.json (NOTE! devnet is die yet)
- Enter your public IP address (v4 only right now)
- Enter ADNL port
Setup script will create minimal configuration for choosen network and generate id keys.
See Advanced Usage section to make this job by hand.
Expected result:
Directories /etc/ton and /var/ton are empty. Looks like this is a first launch. Entering setup mode... Please select template of global.config.json. See section 'Global configuration of the TON Blockchain' of the https://test.ton.org/FullNode-HOWTO.txt freeton-devnet freeton-mainnet freeton-testnet Enter template file name [freeton-testnet]: /usr/local/share/ton/freeton-testnet-global.config.json -> /etc/ton/global.config.json Enter your external IPv4 address for this TON node [X.X.X.X]: Enter ADNL port [30310]: Launching validator-engine to generate instance configuration... [ 3][t 1][1589413681.457912922][validator-engine.cpp:1160][!validator-engine] no init block in config. using zero state [ 1][t 1][1589413681.465116262][validator-engine.cpp:1445][!validator-engine] created config file '/var/ton/config.json' [ 1][t 1][1589413681.465180159][validator-engine.cpp:1446][!validator-engine] check it manually before continue Generating keys for server, liteserver and client(validator-engine-console)... Starting Validator Engine... [ 3][t 1][1589413681.505045414][validator-engine.cpp:1160][!validator-engine] no init block in config. using zero state [ 3][t 1][1589413681.536607504][manager.cpp:1429][!manager] failed to load blocks from import dir: [PosixError : No such file or directory : 2 : File "/var/ton/import" can't be opened for reading] [ 3][t 4][1589413681.584379911][manager-init.cpp:35][!reiniter] init_block_id=[ w=-1 s=9223372036854775808 seq=0 ... ...
-
Check status
NOTE: Validator Engine need some time to start synchronization. Be patient :)
docker exec --interactive --tty freeton-validator validator-engine-console --address 127.0.0.1:3030 --key /etc/ton/keys/client --pub /etc/ton/keys/server.pub -c "getstats" -c "quit"
Expected result:
connecting to [127.0.0.1:3030] local key: C4BD31198D39F6214A6505BC00BC6192158256C91F172B44BEFBF0299E74C7E4 remote key: 2A10CE7EE52139109E186F9588851CCA3FED05F7A574EBD7E7AB49D62DF56863 conn ready unixtime 1589469708
- Patches for ton-blockchain/ton sources that uses inside TON Labs build scripts.
x86-64
build of ton-blockchain/ton sources for Alpine Linux.- Templates of the
global.config.json
for Free TON networks: mainnet, testnet and devnet. - Simple setup shell script.
/
├── BANNER
└── usr
└── local
├── bin
│ ├── docker-entrypoint.sh
│ ├── generate-random-id
│ ├── validator-engine
│ └── validator-engine-console
└── share
└── ton
├── freeton-devnet-global.config.json
├── freeton-mainnet-global.config.json
└── freeton-testnet-global.config.json
It is possible to improve node perfomance if you build an image for your CPU (instead x86-64
) by providing TON_ARCH build argument. See GCC Options and choose correct one value cpu-type
. If you hard to determine correct cpu-type
just use native
.
git clone https://github.com/cexiolabs/contrib.freeton.validator-docker.git freeton-validator-docker
cd freeton-validator-docker
docker build --tag cexiolabs/freeton-validator --build-arg TON_ARCH=native --file docker/alpine/Dockerfile .
Build variables (pass as --build-arg):
Variable | Default value | Description |
---|---|---|
TON_ARCH | x86-64 | See GCC Options for cpu-type |
BUILD_THREADS | 2 | Positive integer |
BUILD_TYPE | Release | Release or RelWithDebInfo . See notes for -DCMAKE_BUILD_TYPE |
The image includes ton-blockchain/ton utils like generate-random-id
. You may use it just pass as arguments, like:
docker run --rm cexiolabs/freeton-validator generate-random-id --mode keys