-
Notifications
You must be signed in to change notification settings - Fork 0
Bce 8698 gal 445 create ton docker #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lipika-pal
wants to merge
34
commits into
main
Choose a base branch
from
BCE-8698-GAL-445-Create-TON-RPCs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
2d0d9fc
BCE-8698: Added ton docker
lipika-pal 4fc4b2f
BCE-8698: ports updated to ton docker
lipika-pal b30d67f
BCE-8698: config updated for ton docker
lipika-pal 05a2739
BCE-8698: config updated for ton docker
lipika-pal 0f9f63d
BCE-8698: config updated for ton docker
lipika-pal 622a799
BCE-8698: config updated for ton docker
lipika-pal d4b7dbf
BCE-8698: config updated for ton docker
lipika-pal fef4b46
BCE-8698: config updated for ton docker
lipika-pal ef6168b
BCE-8698: config updated for ton docker
lipika-pal df0e105
Remove .idea from repo and add to gitignore
lipika-pal 6502afa
BCE-8698: config updated for ton docker
lipika-pal 6303f2e
BCE-8698: config updated for ton docker
lipika-pal 4c8e2a3
BCE-8698: config updated for ton docker
lipika-pal 6e34083
BCE-8698: config updated for ton docker
lipika-pal 4f11052
BCE-8698: config updated for ton docker
lipika-pal a77c094
BCE-8698: added ton http api and refactored ton node
lipika-pal f0a3613
BCE-8698: lint fixes
lipika-pal 84a593d
BCE-8698: lint fixes
lipika-pal 8c2a525
BCE-8698: lint fixes
lipika-pal 28a5f01
BCE-8698: traefik labels added
lipika-pal f9392c8
BCE-8698: fix public ip detection
lipika-pal 6a65b14
BCE-8698: fix snapshot
lipika-pal c60d138
BCE-8698: auto generate liteserver config for ton-http-api
lipika-pal 8d224ef
BCE-8698: lint fixes
lipika-pal 8a0f88f
BCE-8698: fixing ton-http-api liteserver config generation
lipika-pal 29150e5
BCE-8698: fix ton http api
lipika-pal 59c77c9
BCE-8698: added ethd check-sync command
lipika-pal 85e9102
BCE-8698: updated ton-http-api checking ton node sync
lipika-pal 990866b
BCE-8698: fixed sync check
lipika-pal 68bc88a
BCE-8698: refactor
lipika-pal 368fcf4
BCE-8698:fixed ton-http-api
lipika-pal 0e10ef3
BCE-8698: refactored
lipika-pal 279edfb
BCE-8698: check sync updated
lipika-pal bdc4899
BCE-8698: ton node and http-api updated
lipika-pal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,13 @@ | |
| *.bak | ||
| *.original | ||
| custom.yml | ||
| .idea/ | ||
| *.iml | ||
| *.ipr | ||
| *.iws | ||
| .vscode/ | ||
| .DS_Store | ||
| *.log | ||
| *.tmp | ||
| tmp/ | ||
| temp/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # Overview | ||
|
|
||
| Docker Compose for TON (The Open Network) liteserver nodes. | ||
|
|
||
| `cp default.env .env`, adjust values for the right network (mainnet/testnet), then `./ethd up`. | ||
|
|
||
| Meant to be used with [central-proxy-docker](https://github.com/CryptoManufaktur-io/central-proxy-docker) for traefik and Prometheus remote write; use `:ext-network.yml` in `COMPOSE_FILE` inside `.env` in that case. | ||
|
|
||
| Add `ton-shared.yml` to `COMPOSE_FILE` to expose liteserver and validator console ports locally instead of via traefik. | ||
|
|
||
| `./ethd install` brings in docker-ce, if you don't have Docker installed already. | ||
|
|
||
| `cp default.env .env` | ||
|
|
||
| `nano .env` and adjust variables, particularly `GLOBAL_CONFIG_URL` and `SNAPSHOT` | ||
|
|
||
| `./ethd up` | ||
|
|
||
| Initial sync: ~10 hours (~4-5 hours with snapshot). | ||
|
|
||
| To update the software, run `./ethd update` and then `./ethd up` | ||
|
|
||
| # Configuration | ||
|
|
||
| ## Mainnet | ||
|
|
||
| Basic setup: | ||
| ```properties | ||
| TON_BRANCH=mainnet | ||
| GLOBAL_CONFIG_URL=https://ton.org/global.config.json | ||
| SNAPSHOT=latest | ||
| ``` | ||
|
|
||
| With HTTP API: | ||
| ```properties | ||
| COMPOSE_FILE=ton.yml:ton-http-api.yml | ||
| TON_API_HTTP_PORT=8081 | ||
| ``` | ||
|
|
||
| With local RPC access: | ||
| ```properties | ||
| COMPOSE_FILE=ton.yml:ton-shared.yml | ||
| ``` | ||
|
|
||
| ## Testnet | ||
|
|
||
| ```properties | ||
| TON_BRANCH=testnet | ||
| GLOBAL_CONFIG_URL=https://ton.org/testnet-global.config.json | ||
| SNAPSHOT=latest_testnet | ||
| ``` | ||
|
|
||
| ## HTTP API | ||
|
|
||
| Enable HTTP/JSON-RPC API in `COMPOSE_FILE`: | ||
| ```properties | ||
| COMPOSE_FILE=ton.yml:ton-http-api.yml | ||
| TON_API_HTTP_PORT=8081 | ||
| ``` | ||
|
|
||
| Test endpoints: | ||
| ```bash | ||
| # masterchain info | ||
| curl -H 'Content-Type: application/json' \ | ||
| -d '{"jsonrpc":"2.0","id":1,"method":"getMasterchainInfo","params":[]}' \ | ||
| http://localhost:8081 | ||
|
|
||
| # health check | ||
| curl http://localhost:8081/healthcheck | ||
| ``` | ||
|
|
||
| # Operations | ||
|
|
||
| ## Check Sync Status | ||
| ```bash | ||
| ./scripts/check-sync.sh | ||
| ``` | ||
| Exit codes: 0=synced, 1=syncing, 2=error | ||
|
|
||
| ## Monitor Logs | ||
| ```bash | ||
| ./ethd logs -f ton | ||
| ``` | ||
|
|
||
| ## Node Status | ||
| ```bash | ||
| docker compose exec ton mytonctrl | ||
| MyTonCtrl> status | ||
| ``` | ||
|
|
||
| ## Generate Liteserver Config | ||
| After full sync: | ||
| ```bash | ||
| docker compose exec ton mytonctrl | ||
| MyTonCtrl> installer clcf | ||
| ``` | ||
| Creates `/usr/bin/ton/local.config.json` for client connections. | ||
|
|
||
| # Hardware Requirements | ||
|
|
||
| **Mainnet:** | ||
| - 16 cores, 64GB RAM | ||
| - 1TB SSD/NVMe (~250GB used, grows over time) | ||
| - 1 Gbps, 10TB+ monthly traffic | ||
|
|
||
| **Testnet:** Similar, ~100GB storage | ||
|
|
||
| # Ports | ||
|
|
||
| Default ports (customizable in `.env`): | ||
| - `VALIDATOR_PORT` (30001/udp) - P2P networking | ||
| - `LITESERVER_PORT` (30003/tcp) - Liteserver connections | ||
| - `VALIDATOR_CONSOLE_PORT` (30002/tcp) - Console access | ||
| - `TON_API_HTTP_PORT` (8081/tcp) - HTTP API | ||
|
|
||
| Public IP auto-detected on startup. Override with `PUBLIC_IP` in `.env` if needed. | ||
|
|
||
| # Customization | ||
|
|
||
| `custom.yml` can override any settings and is not tracked by git. Add to `COMPOSE_FILE` in `.env` if used. | ||
|
|
||
| See `default.env` for all configuration options. | ||
|
|
||
| ## Version | ||
|
|
||
| This is TON Docker v1.0.0 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # copy to .env and adjust | ||
| COMPOSE_FILE=ton.yml | ||
|
|
||
| # uncomment to override public ip (kubernetes/special networks) | ||
| #PUBLIC_IP= | ||
|
|
||
| TON_BRANCH=mainnet | ||
|
|
||
| # testnet: https://ton.org/testnet-global.config.json | ||
| GLOBAL_CONFIG_URL=https://ton.org/global.config.json | ||
|
|
||
| MYTONCTRL_VERSION=master | ||
| TELEMETRY=true | ||
| IGNORE_MINIMAL_REQS=true | ||
| MODE=liteserver | ||
|
|
||
| ARCHIVE_TTL=2592000 | ||
| STATE_TTL=86400 | ||
| VERBOSITY=1 | ||
|
|
||
| LITESERVER_PORT=30003 | ||
| VALIDATOR_PORT=30001 | ||
| VALIDATOR_CONSOLE_PORT=30002 | ||
|
|
||
| TON_HOST=ton | ||
| TON_API_HOST=ton-api | ||
| DOMAIN=example.com | ||
|
|
||
| # faster sync (~200GB): latest | latest_testnet | https://dump.ton.org/dumps/latest.tar.lz | ||
| SNAPSHOT= | ||
|
|
||
| TON_DOCKERFILE=Dockerfile.binary | ||
| TON_DOCKER_TAG=latest | ||
| TON_DOCKER_REPO=ghcr.io/ton-blockchain/ton-docker-ctrl | ||
|
|
||
| # add ton-http-api.yml to COMPOSE_FILE to enable | ||
| TON_API_HTTP_PORT=8081 | ||
| TON_API_LOGS_LEVEL=INFO | ||
| TON_API_GET_METHODS_ENABLED=1 | ||
| TON_API_JSON_RPC_ENABLED=1 | ||
| TON_API_WEBSERVERS_WORKERS=1 | ||
| TON_API_CACHE_ENABLED=0 | ||
| TON_API_ROOT_PATH=/ | ||
| TON_API_TONLIB_PARALLEL_REQUESTS_PER_LITESERVER=50 | ||
| TON_API_TONLIB_REQUEST_TIMEOUT=10 | ||
| TON_API_LOGS_JSONIFY=0 | ||
| TON_API_GUNICORN_FLAGS= | ||
|
|
||
| SCRIPT_TAG= | ||
|
|
||
| # do not adjust | ||
| ENV_VERSION=1 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| FROM debian:bookworm-slim | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| ca-certificates bash curl pv plzip tar aria2 \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY ./fetch-snapshot.sh /usr/local/bin/fetch-snapshot.sh | ||
| RUN chmod 755 /usr/local/bin/fetch-snapshot.sh | ||
|
|
||
| ENTRYPOINT ["/usr/local/bin/fetch-snapshot.sh"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not working, make sure ./ethd commands work all of them, ie ./ethd version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed