From 9a1398dcce63c82ad12dbbef6a92a7f946a43db7 Mon Sep 17 00:00:00 2001 From: neodix42 Date: Tue, 3 Sep 2024 14:58:30 +0400 Subject: [PATCH] Docu update on MacOS installation and docker image with MyTonCtrl 2.0 (#755) * update ton installation on MacOS * update docker with MyTonCtrl 2.0 docu --------- Co-authored-by: neodiX --- docs/develop/howto/compile.md | 51 ++++++++++++++++++++---- docs/participate/run-nodes/run-docker.md | 22 +++++++++- 2 files changed, 64 insertions(+), 9 deletions(-) diff --git a/docs/develop/howto/compile.md b/docs/develop/howto/compile.md index d0e03d8db7..df0f7f50c3 100644 --- a/docs/develop/howto/compile.md +++ b/docs/develop/howto/compile.md @@ -27,7 +27,7 @@ git clone --recurse-submodules https://github.com/ton-blockchain/ton.git - OpenSSL (including C header files) version 1.1.1 or later - `build-essential`, `zlib1g-dev`, `gperf`, `libreadline-dev`, `ccache`, `libmicrohttpd-dev`, `pkg-config`, `libsodium-dev`, `libsecp256k1-dev` - On Ubuntu: +### On Ubuntu ```bash apt update @@ -50,23 +50,58 @@ export CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Release ../ton && cmake --build . -j$(nproc) ``` -:::warning -On MacOS Intel before next step we need maybe install `openssl@3` with `brew` or just link the lib: +### On MacOS +Prepare the system by installing required system packages ```zsh -brew install openssl@3 ninja libmicrohttpd pkg-config +brew install ninja libsodium libmicrohttpd pkg-config automake libtool autoconf gnutls +brew install llvm@16 ``` -Then need to inspect `/usr/local/opt`: +Use newly installed clang. +```zsh + export CC=/opt/homebrew/opt/llvm@16/bin/clang + export CXX=/opt/homebrew/opt/llvm@16/bin/clang++ +``` + +Compile secp256k1 +```zsh + git clone https://github.com/bitcoin-core/secp256k1.git + cd secp256k1 + secp256k1Path=`pwd` + git checkout v0.3.2 + ./autogen.sh + ./configure --enable-module-recovery --enable-static --disable-tests --disable-benchmark + make -j12 +``` +and lz4: + +```zsh + git clone https://github.com/lz4/lz4 + cd lz4 + lz4Path=`pwd` + git checkout v1.9.4 + make -j12 +``` +and relink OpenSSL 3.0 ```zsh -ls /usr/local/opt +brew unlink openssl@1.1 +brew install openssl@3 +brew unlink openssl@3 && brew link --overwrite openssl@3 ``` -Find `openssl@3` lib and export local variable: +Now you can compile TON ```zsh -export OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 +cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. \ +-DCMAKE_CXX_FLAGS="-stdlib=libc++" \ +-DSECP256K1_FOUND=1 \ +-DSECP256K1_INCLUDE_DIR=$secp256k1Path/include \ +-DSECP256K1_LIBRARY=$secp256k1Path/.libs/libsecp256k1.a \ +-DLZ4_FOUND=1 \ +-DLZ4_LIBRARIES=$lz4Path/lib/liblz4.a \ +-DLZ4_INCLUDE_DIRS=$lz4Path/lib ``` ::: diff --git a/docs/participate/run-nodes/run-docker.md b/docs/participate/run-nodes/run-docker.md index 3e136f6b72..5ab5135983 100644 --- a/docs/participate/run-nodes/run-docker.md +++ b/docs/participate/run-nodes/run-docker.md @@ -31,7 +31,13 @@ Variable **IGNORE_MINIMAL_REQS=true** turns off requirements verification of CPU * Debian 11 * Debian 12 -## Installation and start MyTonCtrl: +## Run MyTonCtrl v2 using official docker image: +* Pull the image and run the node with MyTonCtrl +```bash +docker run -d --name ton-node -v :/var/ton-work -it ghcr.io/ton-community/ton-docker-ctrl:latest +```` + +## Install and start MyTonCtrl from sources: 1. Clone the last version of the repository ```bash @@ -53,6 +59,20 @@ docker compose build ton-node ```bash docker compose up -d ``` + +## Migrate non-Docker fullnode or validator to a dockerized MyTonCtrl v2 + +Specify paths to TON binaries and sources, as well as to TON work directory, but most importantly to MyTonCtrl settings and wallets. + +```bash +docker run -d --name ton-node --restart always \ +-v :/var/ton-work \ +-v /usr/bin/ton:/usr/bin/ton \ +-v /usr/src/ton:/usr/src/ton \ +-v /home//.local/share:/usr/local/bin \ +ghcr.io/ton-community/ton-docker-ctrl:latest +``` + ## Variables setting: Variables indicated in the file .env