C++ HTTP API for The Open Network
8.5K
The HTTP API C++ for The Open Network is a real-time API to connect to TON blockchain lite servers via ADNL protocol and enable access to lite servers through HTTP requests.
This service is the improved version of original TON HTTP API, written entirely in C++ to achieve outstanding performance and effecient comnsuming of hardware resources.
TON HTTP API C++ provides following features:
There are two main ways to run TON HTTP API:
docker, docker-compose, curl.
scripts/setup.sh from the root of the repo.mkdir private
curl -sL https://ton-blockchain.github.io/global.config.json > private/mainnet.json
curl -sL https://ton-blockchain.github.io/testnet-global.config.json > private/testnet.json
cp config/config_vars.yaml private/config_vars.yaml
nano private/config_vars.yaml
export THACPP_GLOBAL_CONFIG_PATH=private/testnet.json
# or
echo "THACPP_GLOBAL_CONFIG_PATH=private/testnet.json" > .env
docker compose pull
# or
docker compose build
docker compose up -d
# or
docker compose up
docker compose logs http-api-cpp
# or
docker compose logs -n 100 http-api-cpp
# or
docker compose logs -f -n 100 http-api-cpp
Install dependencies:
apt update -y
apt install -y wget curl build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git ninja-build libsodium-dev libmicrohttpd-dev liblz4-dev pkg-config autoconf automake libtool libjemalloc-dev lsb-release software-properties-common gnupg libabsl-dev libbenchmark-dev libboost-context1.83-dev libboost-coroutine1.83-dev libboost-filesystem1.83-dev libboost-iostreams1.83-dev libboost-locale1.83-dev libboost-program-options1.83-dev libboost-regex1.83-dev libboost-stacktrace1.83-dev libboost1.83-dev libbson-dev libbz2-dev libc-ares-dev libcctz-dev libcrypto++-dev libcurl4-openssl-dev libdouble-conversion-dev libev-dev libfmt-dev libgflags-dev libgmock-dev libgtest-dev libhiredis-dev libidn11-dev libjemalloc2 libjemalloc-dev libkrb5-dev libldap2-dev liblz4-dev libnghttp2-dev libpugixml-dev libsnappy-dev libsasl2-dev libssl-dev libxxhash-dev libyaml-cpp0.8 libyaml-cpp-dev libzstd-dev libssh2-1-dev netbase python3-dev python3-jinja2 python3-venv python3-yaml ragel yasm zlib1g-dev liblzma-dev libre2-dev clang-format ccache gcc g++ gdb
# for ubuntu 22.04 check https://userver.tech/de/d9c/md_en_2deps_2ubuntu-22_804.html
brew install [email protected] c-ares ccache cctz clang-format clickhouse-cpp cmake coreutils cryptopp cyrus-sasl fmt gdb git google-benchmark googletest hiredis icu4c jemalloc krb5 libev librdkafka mariadb mongo-c-driver@1 nghttp2 ninja openldap openssl postgresql@16 pugixml rocksdb unixodbc yaml-cpp zlib sqlite pkg-config automake libtool autoconf texinfo lz4 openssl@3 libsodium zlib libmicrohttpd
Build:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc) ton-http-api-cpp
# optional
make install
Run:
./build/ton-http-api/ton-http-api-cpp --config ./config/static_config.yaml --config_vars ./private/config_vars.yaml
TON HTTP API C++ is licensed under the MIT License.
Content type
Image
Digest
sha256:2f37b0160…
Size
109.1 MB
Last updated
7 days ago
docker pull toncenter/ton-http-api-cpp:v2.1.15