Skip to content

Commit

Permalink
Docu update on MacOS installation and docker image with MyTonCtrl 2.0 (
Browse files Browse the repository at this point in the history
…#755)

* update ton installation on MacOS

* update docker with MyTonCtrl 2.0 docu

---------

Co-authored-by: neodiX <[email protected]>
  • Loading branch information
neodix42 and neodiX committed Sep 3, 2024
1 parent ecc888e commit 9a1398d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 9 deletions.
51 changes: 43 additions & 8 deletions docs/develop/howto/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 [email protected]
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
```

:::
Expand Down
22 changes: 21 additions & 1 deletion docs/participate/run-nodes/run-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <YOUR_LOCAL_FOLDER>:/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
Expand All @@ -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 <EXISTING_TON_WORK_FOLDER>:/var/ton-work \
-v /usr/bin/ton:/usr/bin/ton \
-v /usr/src/ton:/usr/src/ton \
-v /home/<USER>/.local/share:/usr/local/bin \
ghcr.io/ton-community/ton-docker-ctrl:latest
```

## Variables setting:

Variables indicated in the file .env
Expand Down

0 comments on commit 9a1398d

Please sign in to comment.