Skip to content

Commit e91c633

Browse files
Merge pull request #3 from toncenter/develop
Enormous refactor
2 parents 781f0ff + 8a21198 commit e91c633

File tree

193 files changed

+26115
-9392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+26115
-9392
lines changed

.clang-format

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ BreakBeforeTernaryOperators: false
1717
BreakConstructorInitializers: AfterColon
1818
ColumnLimit: 120
1919
DeriveLineEnding: false
20+
IndentWidth: 2
21+
ContinuationIndentWidth: 2
2022
IndentCaseBlocks: false
2123
IndentExternBlock: AfterExternBlock
2224
InsertNewlineAtEOF: true

.github/workflows/build-docker.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- 'v*.*.*'
7+
- 'dev*'
78

89
jobs:
910
release:

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ celerybeat.pid
166166

167167
# Environments
168168
.env
169+
.env*
169170
.venv
170171
env/
171172
venv/
@@ -221,3 +222,7 @@ sandbox/
221222
.vscode/
222223
.idea/
223224
.DS_Store
225+
226+
# codegen schemas
227+
playground/schemas/
228+
ton-http-api/src/schemas/

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "external/ton"]
22
path = external/ton
3-
url = https://github.com/kdimentionaltree/ton
3+
url = https://github.com/ton-blockchain/ton
44
branch = testnet
55
[submodule "external/pybind11"]
66
path = external/pybind11

CMakeLists.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
66
set(CMAKE_CXX_EXTENSIONS FALSE)
77

88
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
9-
set(PY_TONLIB_MULTICLIENT FALSE CACHE BOOL "Build python bindings")
10-
set(TONLIB_MULTICLIENT_EXAMPLES FALSE CACHE BOOL "Build examples")
9+
set(PY_TONLIB_MULTICLIENT TRUE CACHE BOOL "Build python bindings")
10+
set(TONLIB_MULTICLIENT_EXAMPLES TRUE CACHE BOOL "Build examples")
1111
set(TON_HTTP_API_CPP TRUE CACHE BOOL "Build TON HTTP API")
12+
set(BUILD_TON_PLAYGROUND FALSE CACHE BOOL "Build TON playground")
1213

1314
add_subdirectory(external/ton EXCLUDE_FROM_ALL)
1415

@@ -23,15 +24,22 @@ if (PY_TONLIB_MULTICLIENT)
2324
add_subdirectory(py)
2425
endif()
2526

27+
2628
if (TON_HTTP_API_CPP)
2729
# userver config
2830
set(USERVER_FEATURE_REDIS TRUE)
2931
set(USERVER_FEATURE_UBOOST_CORO TRUE)
30-
set(USERVER_FEATURE_CHAOTIC FALSE)
31-
set(USERVER_FEATURE_CHAOTIC_EXPERIMENAL FALSE)
32+
set(USERVER_FEATURE_CHAOTIC TRUE)
33+
set(USERVER_FEATURE_CHAOTIC_EXPERIMENAL TRUE)
3234
set(USERVER_FEATURE_UTEST FALSE)
3335
set(USERVER_FEATURE_TESTSUITE FALSE)
3436
set(USERVER_USE_STATIC_LIBS TRUE)
3537
add_subdirectory(external/userver EXCLUDE_FROM_ALL)
3638
add_subdirectory(ton-http-api)
37-
endif()
39+
endif()
40+
41+
42+
if (BUILD_TON_PLAYGROUND)
43+
message("-- Building TON Playground binary")
44+
add_subdirectory(playground)
45+
endif()

Dockerfile

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:24.04
1+
FROM ubuntu:24.04 AS builder
22
RUN DEBIAN_FRONTEND=noninteractive apt update -y \
33
&& apt install -y wget curl build-essential cmake clang openssl \
44
libssl-dev zlib1g-dev gperf wget git ninja-build libsodium-dev libmicrohttpd-dev liblz4-dev \
@@ -10,33 +10,38 @@ RUN DEBIAN_FRONTEND=noninteractive apt update -y \
1010
libhiredis-dev libidn11-dev libjemalloc2 libjemalloc-dev libkrb5-dev libldap2-dev liblz4-dev \
1111
libnghttp2-dev libpugixml-dev libsnappy-dev libsasl2-dev libssl-dev libxxhash-dev libyaml-cpp0.8 libyaml-cpp-dev \
1212
libzstd-dev libssh2-1-dev netbase python3-dev python3-jinja2 python3-venv python3-yaml \
13-
ragel yasm zlib1g-dev liblzma-dev libre2-dev clang-format gcc g++ \
13+
ragel yasm zlib1g-dev liblzma-dev libre2-dev clang-format gcc g++ yq \
1414
&& rm -rf /var/lib/apt/lists/*
1515

16-
ENV CC=/usr/bin/gcc
17-
ENV CXX=/usr/bin/g++
16+
ENV CC=/usr/bin/clang
17+
ENV CXX=/usr/bin/clang++
1818
ENV CCACHE_DISABLE=1
19+
ENV USERVER_FEATURE_CRYPTOPP_BLAKE2=0
20+
ENV BUILD_TON_PLAYGROUND=1
1921

2022
COPY examples/ /app/examples/
2123
COPY py/ /app/py/
2224
COPY external/ /app/external/
2325
COPY tonlib-multiclient/ /app/tonlib-multiclient/
2426
COPY ton-http-api/ /app/ton-http-api/
27+
COPY playground/ /app/playground/
2528
COPY CMakeLists.txt /app/CMakeLists.txt
2629

2730
WORKDIR /app/build
2831
RUN cmake -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 .. && make -j$(nproc) && make install
32+
RUN apt update -y && apt install -y gdb && mkdir -p /root/.config/gdb && echo "set auto-load safe-path /" > /root/.config/gdb/gdbinit
33+
COPY ton-http-api/static/ /app/static/
2934
COPY config/static_config.yaml /app/static_config.yaml
30-
31-
RUN apt update && apt install -y gdb && mkdir -p /root/.config/gdb
32-
RUN echo "set auto-load safe-path /" > /root/.config/gdb/gdbinit
3335
ENTRYPOINT [ "ton-http-api-cpp" ]
36+
# end builder
37+
3438

35-
# FROM ubuntu:24.04
36-
# RUN DEBIAN_FRONTEND=noninteractive apt update -y \
37-
# && apt install -y wget curl dnsutils libsecp256k1-dev libsodium-dev libfmt-dev \
38-
# && rm -rf /var/lib/apt/lists/*
39-
# COPY --from=builder /app/build/ton-http-api/ton-http-api-cpp /usr/bin/
40-
# COPY --from=builder /app/build/tonlib-multiclient/libtonlib_multiclient_lib.so /usr/lib
41-
# COPY config/static_config_compose.yaml /app/static_config.yaml
42-
# ENTRYPOINT [ "ton-http-api-cpp" ]
39+
FROM ubuntu:24.04 AS http-api-cpp
40+
RUN DEBIAN_FRONTEND=noninteractive apt update -y \
41+
&& apt install -y curl dnsutils libcurl4 libfmt9 libsodium23 libcctz2 libatomic1 libicu74 \
42+
&& rm -rf /var/lib/apt/lists/*
43+
COPY --from=builder /app/build/ton-http-api/ton-http-api-cpp /usr/bin/
44+
COPY --from=builder /app/build/tonlib-multiclient/libtonlib_multiclient_lib.so /usr/lib
45+
COPY ton-http-api/static/ /app/static/
46+
COPY config/static_config.yaml /app/static_config.yaml
47+
ENTRYPOINT [ "ton-http-api-cpp" ]

config/config_vars.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@ log_path: "@stdout" # log destination, available options:
2222
# /path/to/file - log to file
2323
# Note: if you log into file,
2424
# logs will be deleted after deploying new container
25-
log_format: json # logs format, one of `tskv`, `ltsv`, `json`
2625
system_log_level: warning # userver system logs
27-
system_log_path: "@null"
26+
system_log_path: "@stdout"
27+
28+
jsonrpc_log_level: warning # jsonrpc endpoint logs
29+
# note that requests to jsonRPC endpoint will appear in both of api-v2 and jsonrpc loggers
30+
jsonrpc_log_path: "@stdout"
31+
32+
log_format: json # logs format, one of `tskv`, `ltsv`, `json`
2833

2934
http_worker_user_agent: empty # http user agent to set in request to boc endpoint
35+
36+
static_content_dir: "/static/" # directory for static content
37+
max_stack_entry_depth: 100 # max stack entry depth for runGetMethod

0 commit comments

Comments
 (0)