소스에서 컴파일하기
여기에서 미리 빌드된 바이너리를 다운로드할 수 있습니다.
여전히 직접 소스를 컴파일하고 싶다면, 아래 지침을 따르세요.
주의
This is a simplified quick build guide.
가정용이 아닌 프로덕션용으로 빌드하는 경우, 자동 빌드 스크립트를 사용하는 것이 좋습니다.
공통
이 소프트웨어는 대부분의 Linux 시스템에서 컴파일되고 제대로 작동할 것입니다. macOS와 Windows에서도 작동해야 합니다.
- GitHub 저장소 https://github.com/ton-blockchain/ton/에서 사용 가능한 최신 버전의 TON 블록체인 소스를 다운로드하세요:
git clone --recurse-submodules https://github.com/ton-blockchain/ton.git
- 다음의 최신 버전을 설치하세요:
make
cmake
버전 3.0.2 이상g++
또는clang
(또는 운영 체제에 적합한 다른 C++14 호환 컴파일러)- OpenSSL(C 헤더 파일 포함) 버 전 1.1.1 이상
build-essential
,zlib1g-dev
,gperf
,libreadline-dev
,ccache
,libmicrohttpd-dev
,pkg-config
,libsodium-dev
,libsecp256k1-dev
,liblz4-dev
Ubuntu에서
apt update
sudo apt install build-essential cmake clang openssl libssl-dev zlib1g-dev gperf libreadline-dev ccache libmicrohttpd-dev pkg-config libsodium-dev libsecp256k1-dev liblz4-dev
- 소스 트리를 홈 디렉토리
~
의~/ton
디렉토리로 가져왔고, 빈 디렉토리~/ton-build
를 만들었다고 가정합니다:
mkdir ton-build
그런 다음 Linux나 MacOS 터미널에서 다음을 실행하세요:
cd ton-build
export CC=clang
export CXX=clang++
cmake -DCMAKE_BUILD_TYPE=Release ../ton && cmake --build . -j$(nproc)
MacOS에서
필요한 시스템 패키지를 설치하여 시스템 준비
brew install ninja libsodium libmicrohttpd pkg-config automake libtool autoconf gnutls
brew install llvm@16
새로 설치된 clang 사용
export CC=/opt/homebrew/opt/llvm@16/bin/clang
export CXX=/opt/homebrew/opt/llvm@16/bin/clang++
secp256k1 컴파일
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
그리고 lz4:
git clone https://github.com/lz4/lz4
cd lz4
lz4Path=`pwd`
git checkout v1.9.4
make -j12
그리고 OpenSSL 3.0 다시 링크
brew unlink openssl@1.1
brew install openssl@3
brew unlink openssl@3 && brew link --overwrite openssl@3
이제 TON을 컴파일할 수 있습니다
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
:::
팁
메모리가 적은 컴퓨터(예: 1GB)에서 컴파일하는 경우, 스왑 파티션 생성을 잊지 마세요.
전역 설정 다운로드
라이트 클라이언트와 같은 도구의 경우 전역 네트워크 설정을 다운로드해야 합니다.
메인넷의 경우 https://ton-blockchain.github.io/global.config.json 에서 최신 구성 파일을 다운로드하세요:
wget https://ton-blockchain.github.io/global.config.json
또는 테스트넷의 경우 https://ton-blockchain.github.io/testnet-global.config.json에서:
wget https://ton-blockchain.github.io/testnet-global.config.json