disintar/ton-k8s
Easy to setup production ready infrastructure for TON network via compose / kubernetes
ton-k8s
Docker images, python mini-lib, helm chart for comfortable TON infrastructure
Own-net locally
Run:
./pre-build.sh && docker-compose -f ./composes/ownnet.yaml up
More info about ownnet - ownnet.md
(you need to wait some time while network is starting)
Change local validators count:
deploy:
replicas: 3
If you want to reset your private network - remove all volumes:
docker-compose -f ./composes/ownnet.yaml down -v --rmi all
Features
| Feature name | Status |
|---|---|
| Full node for mainnet / testnet | ✅ |
| Lite-client for mainnet / testnet | ✅ |
| Helm chart | ✅ |
| K8s secrets for keys | ✅ |
| Custom ton network | ✅ |
| Compose | ✅ |
| RPC API / ton-http-api | ✅ |
| Jupyter in toncenter with examples | ✅ |
| Punisher on validator nodes | ⌛ |
| Status page | ⌛ |
| K8s resource limits | ⌛ |
Local build
It's one of the easiest way to start TON network locally:
./pre-build.sh
Files
pre-build.sh - build all docker files and send them to registry
ton-compile-source - main Docker image, compile TON sources. You can
passis_testnet. If true - compile and build safer_overlay branch,
because testnet is working on it.
ton-full-node - run mainnet / testnet full node, you need to pass version build argument mainnet-v0
or testnet-v0
Helm / k8s
- Change registry in build_for_k8s.sh
- Run build_for_k8s.sh and push images to registry
- Change
./chart/values.yamlto specify your needs:- Change
runsection to chose which images you want to run - Change
persistent, add your storageClassName / create persistent - Change
imagePullSecretsto your registry - Notice that ports in nodes used
30001-30006nodePorts that will open in all your nodes (to get UDP traffic to local TON stuff) - Change
testnetToncenter.CONFIG/toncenter.CONFIGparams to your domains - Change
ingressto correct setup of domains
- Change
Then:
kubectl create namespace ton
helm upgrade --install --namespace ton ton ./chart/ --values ./chart/values.yaml Tips and tricks
After publish UDP services to k8s you need to specify externalIp to bind public port.
Read more about externalIp
ENVIRON
Feel free to change environs in compose / helm
config = {
"PUBLIC_IP": os.getenv('PRIVATE_CONFIG', ip),
"CONFIG": os.getenv('CONFIG', 'https://test.ton.org/ton-global.config.json'),
"PRIVATE_CONFIG": os.getenv('PRIVATE_CONFIG', 'false') == 'true',
"LITESERVER": os.getenv('LITESERVER', 'true') == 'true', # convert to bool
"CONSOLE_PORT": int(os.getenv("CONSOLE_PORT", 46732)),
"PUBLIC_PORT": int(os.getenv("PUBLIC_PORT", 50001)),
"DHT_PORT": int(os.getenv("DHT_PORT", 6302)),
"LITESERVER_PORT": int(os.getenv("LITESERVER_PORT", 43680)),
"NAMESPACE": os.getenv("NAMESPACE", None),
"THREADS": int(os.getenv("CPU_COUNT", cpu_count)),
"GENESIS": os.getenv("GENESIS", False),
"VERBOSE": os.getenv("VERBOSE", 3)
}
Donations
TON: EQCsCSLisPZ6xUtkgi_Tn5c-kipelVHRCxGdPu9x1gaVTfVC