├── .cargo └── config.toml ├── .dockerignore ├── .github └── workflows │ └── docker.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── LICENSE ├── README.md └── src ├── liteserver.rs ├── main.rs ├── tracing_utils.rs ├── tvm.rs ├── utils.rs └── web.rs /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | rustflags = ["--cfg", "tokio_unstable"] 3 | rustdocflags = ["--cfg", "tokio_unstable"] -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /target -------------------------------------------------------------------------------- /.github/workflows/docker.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image Publish 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | # Publish semver tags as releases. 7 | tags: [ 'v*.*.*' ] 8 | pull_request: 9 | branches: [ "master" ] 10 | 11 | env: 12 | # Use docker.io for Docker Hub if empty 13 | REGISTRY: ghcr.io 14 | # github.repository as / 15 | IMAGE_NAME: ${{ github.repository }} 16 | 17 | 18 | jobs: 19 | build: 20 | 21 | runs-on: ubuntu-latest 22 | permissions: 23 | contents: read 24 | packages: write 25 | # This is used to complete the identity challenge 26 | # with sigstore/fulcio when running outside of PRs. 27 | id-token: write 28 | 29 | steps: 30 | - name: Checkout repository 31 | uses: actions/checkout@v3 32 | 33 | # Workaround: https://github.com/docker/build-push-action/issues/461 34 | - name: Setup Docker buildx 35 | uses: docker/setup-buildx-action@v2 36 | 37 | # Login against a Docker registry except on PR 38 | # https://github.com/docker/login-action 39 | - name: Log into registry ${{ env.REGISTRY }} 40 | if: github.event_name != 'pull_request' 41 | uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c 42 | with: 43 | registry: ${{ env.REGISTRY }} 44 | username: ${{ github.actor }} 45 | password: ${{ secrets.GITHUB_TOKEN }} 46 | 47 | # Extract metadata (tags, labels) for Docker 48 | # https://github.com/docker/metadata-action 49 | - name: Extract Docker metadata 50 | id: meta 51 | uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 52 | with: 53 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 54 | flavor: | 55 | latest=${{ github.ref == 'refs/heads/master' }} 56 | 57 | # Buildkit cache 58 | # https://github.com/reproducible-containers/buildkit-cache-dance 59 | - name: Cache 60 | uses: actions/cache@v3 61 | id: cache 62 | with: 63 | path: | 64 | var-cache-buildkit 65 | key: cache-${{ hashFiles('Dockerfile') }} 66 | 67 | - name: Inject cache into docker 68 | uses: reproducible-containers/buildkit-cache-dance@v3.1.0 69 | with: 70 | cache-map: | 71 | { 72 | "var-cache-buildkit": "/var/cache/buildkit" 73 | } 74 | skip-extraction: ${{ steps.cache.outputs.cache-hit }} 75 | 76 | # Build and push Docker image with Buildx (don't push on PR) 77 | # https://github.com/docker/build-push-action 78 | - name: Build and push Docker image 79 | id: build-and-push 80 | uses: docker/build-push-action@v4 81 | with: 82 | context: "{{defaultContext}}" 83 | push: ${{ github.event_name != 'pull_request' }} # Don't push on PR 84 | tags: ${{ steps.meta.outputs.tags }} 85 | labels: ${{ steps.meta.outputs.labels }} 86 | cache-from: type=gha 87 | cache-to: type=gha,mode=max -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /config/config.yml -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.22.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "adler2" 22 | version = "2.0.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 25 | 26 | [[package]] 27 | name = "adnl" 28 | version = "2.0.0" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "8b3cb50ffb09675285804083fc6283ad84a0857db567280959903b84c9ea3aac" 31 | dependencies = [ 32 | "aes", 33 | "ctr", 34 | "everscale-crypto", 35 | "futures", 36 | "hex", 37 | "log", 38 | "pin-project", 39 | "rand", 40 | "rand_core", 41 | "sha2 0.10.8", 42 | "thiserror", 43 | "tokio", 44 | "tokio-util", 45 | ] 46 | 47 | [[package]] 48 | name = "aes" 49 | version = "0.8.4" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" 52 | dependencies = [ 53 | "cfg-if", 54 | "cipher", 55 | "cpufeatures", 56 | ] 57 | 58 | [[package]] 59 | name = "ahash" 60 | version = "0.8.11" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 63 | dependencies = [ 64 | "cfg-if", 65 | "getrandom", 66 | "once_cell", 67 | "version_check", 68 | "zerocopy", 69 | ] 70 | 71 | [[package]] 72 | name = "aho-corasick" 73 | version = "1.1.3" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 76 | dependencies = [ 77 | "memchr", 78 | ] 79 | 80 | [[package]] 81 | name = "android-tzdata" 82 | version = "0.1.1" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 85 | 86 | [[package]] 87 | name = "android_system_properties" 88 | version = "0.1.5" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 91 | dependencies = [ 92 | "libc", 93 | ] 94 | 95 | [[package]] 96 | name = "anyhow" 97 | version = "1.0.86" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" 100 | 101 | [[package]] 102 | name = "arc-swap" 103 | version = "1.7.1" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" 106 | 107 | [[package]] 108 | name = "argh" 109 | version = "0.1.12" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "7af5ba06967ff7214ce4c7419c7d185be7ecd6cc4965a8f6e1d8ce0398aad219" 112 | dependencies = [ 113 | "argh_derive", 114 | "argh_shared", 115 | ] 116 | 117 | [[package]] 118 | name = "argh_derive" 119 | version = "0.1.12" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "56df0aeedf6b7a2fc67d06db35b09684c3e8da0c95f8f27685cb17e08413d87a" 122 | dependencies = [ 123 | "argh_shared", 124 | "proc-macro2", 125 | "quote", 126 | "syn 2.0.77", 127 | ] 128 | 129 | [[package]] 130 | name = "argh_shared" 131 | version = "0.1.12" 132 | source = "registry+https://github.com/rust-lang/crates.io-index" 133 | checksum = "5693f39141bda5760ecc4111ab08da40565d1771038c4a0250f03457ec707531" 134 | dependencies = [ 135 | "serde", 136 | ] 137 | 138 | [[package]] 139 | name = "async-trait" 140 | version = "0.1.82" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" 143 | dependencies = [ 144 | "proc-macro2", 145 | "quote", 146 | "syn 2.0.77", 147 | ] 148 | 149 | [[package]] 150 | name = "autocfg" 151 | version = "1.3.0" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 154 | 155 | [[package]] 156 | name = "axum" 157 | version = "0.7.5" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" 160 | dependencies = [ 161 | "async-trait", 162 | "axum-core", 163 | "bytes", 164 | "futures-util", 165 | "http 1.1.0", 166 | "http-body 1.0.1", 167 | "http-body-util", 168 | "hyper 1.4.1", 169 | "hyper-util", 170 | "itoa", 171 | "matchit", 172 | "memchr", 173 | "mime", 174 | "percent-encoding", 175 | "pin-project-lite", 176 | "rustversion", 177 | "serde", 178 | "serde_json", 179 | "serde_path_to_error", 180 | "serde_urlencoded", 181 | "sync_wrapper 1.0.1", 182 | "tokio", 183 | "tower", 184 | "tower-layer", 185 | "tower-service", 186 | "tracing", 187 | ] 188 | 189 | [[package]] 190 | name = "axum-core" 191 | version = "0.4.3" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" 194 | dependencies = [ 195 | "async-trait", 196 | "bytes", 197 | "futures-util", 198 | "http 1.1.0", 199 | "http-body 1.0.1", 200 | "http-body-util", 201 | "mime", 202 | "pin-project-lite", 203 | "rustversion", 204 | "sync_wrapper 0.1.2", 205 | "tower-layer", 206 | "tower-service", 207 | "tracing", 208 | ] 209 | 210 | [[package]] 211 | name = "backtrace" 212 | version = "0.3.73" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" 215 | dependencies = [ 216 | "addr2line", 217 | "cc", 218 | "cfg-if", 219 | "libc", 220 | "miniz_oxide 0.7.4", 221 | "object", 222 | "rustc-demangle", 223 | ] 224 | 225 | [[package]] 226 | name = "base64" 227 | version = "0.13.1" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 230 | 231 | [[package]] 232 | name = "base64" 233 | version = "0.22.1" 234 | source = "registry+https://github.com/rust-lang/crates.io-index" 235 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 236 | 237 | [[package]] 238 | name = "bindgen" 239 | version = "0.65.1" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" 242 | dependencies = [ 243 | "bitflags 1.3.2", 244 | "cexpr", 245 | "clang-sys", 246 | "lazy_static", 247 | "lazycell", 248 | "peeking_take_while", 249 | "prettyplease", 250 | "proc-macro2", 251 | "quote", 252 | "regex", 253 | "rustc-hash", 254 | "shlex", 255 | "syn 2.0.77", 256 | ] 257 | 258 | [[package]] 259 | name = "bitflags" 260 | version = "1.3.2" 261 | source = "registry+https://github.com/rust-lang/crates.io-index" 262 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 263 | 264 | [[package]] 265 | name = "bitflags" 266 | version = "2.6.0" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 269 | 270 | [[package]] 271 | name = "block-buffer" 272 | version = "0.9.0" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 275 | dependencies = [ 276 | "generic-array", 277 | ] 278 | 279 | [[package]] 280 | name = "block-buffer" 281 | version = "0.10.4" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 284 | dependencies = [ 285 | "generic-array", 286 | ] 287 | 288 | [[package]] 289 | name = "broxus-util" 290 | version = "0.2.7" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "6bed246b9cbc85608c996cc7077b4c70ae7a1445436e76087c507751e621ed7d" 293 | dependencies = [ 294 | "base64 0.13.1", 295 | "config", 296 | "errno", 297 | "futures-util", 298 | "hex", 299 | "libc", 300 | "log", 301 | "log4rs", 302 | "public-ip", 303 | "regex", 304 | "serde", 305 | "serde_yaml", 306 | "thiserror", 307 | "tikv-jemalloc-sys", 308 | "tikv-jemallocator", 309 | "tokio", 310 | "url", 311 | ] 312 | 313 | [[package]] 314 | name = "bumpalo" 315 | version = "3.16.0" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 318 | 319 | [[package]] 320 | name = "byteorder" 321 | version = "1.5.0" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 324 | 325 | [[package]] 326 | name = "bytes" 327 | version = "1.7.1" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" 330 | 331 | [[package]] 332 | name = "bytesize" 333 | version = "1.3.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" 336 | dependencies = [ 337 | "serde", 338 | ] 339 | 340 | [[package]] 341 | name = "bzip2-sys" 342 | version = "0.1.11+1.0.8" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" 345 | dependencies = [ 346 | "cc", 347 | "libc", 348 | "pkg-config", 349 | ] 350 | 351 | [[package]] 352 | name = "cc" 353 | version = "1.1.16" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" 356 | dependencies = [ 357 | "jobserver", 358 | "libc", 359 | "shlex", 360 | ] 361 | 362 | [[package]] 363 | name = "cexpr" 364 | version = "0.6.0" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" 367 | dependencies = [ 368 | "nom", 369 | ] 370 | 371 | [[package]] 372 | name = "cfg-if" 373 | version = "1.0.0" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 376 | 377 | [[package]] 378 | name = "chrono" 379 | version = "0.4.38" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" 382 | dependencies = [ 383 | "android-tzdata", 384 | "iana-time-zone", 385 | "num-traits", 386 | "windows-targets", 387 | ] 388 | 389 | [[package]] 390 | name = "cipher" 391 | version = "0.4.4" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" 394 | dependencies = [ 395 | "crypto-common", 396 | "inout", 397 | ] 398 | 399 | [[package]] 400 | name = "clang-sys" 401 | version = "1.8.1" 402 | source = "registry+https://github.com/rust-lang/crates.io-index" 403 | checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" 404 | dependencies = [ 405 | "glob", 406 | "libc", 407 | "libloading", 408 | ] 409 | 410 | [[package]] 411 | name = "cmake" 412 | version = "0.1.51" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" 415 | dependencies = [ 416 | "cc", 417 | ] 418 | 419 | [[package]] 420 | name = "config" 421 | version = "0.13.4" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "23738e11972c7643e4ec947840fc463b6a571afcd3e735bdfce7d03c7a784aca" 424 | dependencies = [ 425 | "async-trait", 426 | "lazy_static", 427 | "nom", 428 | "pathdiff", 429 | "serde", 430 | "serde_json", 431 | "yaml-rust", 432 | ] 433 | 434 | [[package]] 435 | name = "core-foundation-sys" 436 | version = "0.8.7" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 439 | 440 | [[package]] 441 | name = "countme" 442 | version = "3.0.1" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636" 445 | 446 | [[package]] 447 | name = "cpufeatures" 448 | version = "0.2.13" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" 451 | dependencies = [ 452 | "libc", 453 | ] 454 | 455 | [[package]] 456 | name = "crc" 457 | version = "3.2.1" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" 460 | dependencies = [ 461 | "crc-catalog", 462 | ] 463 | 464 | [[package]] 465 | name = "crc-catalog" 466 | version = "2.4.0" 467 | source = "registry+https://github.com/rust-lang/crates.io-index" 468 | checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" 469 | 470 | [[package]] 471 | name = "crc32fast" 472 | version = "1.4.2" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" 475 | dependencies = [ 476 | "cfg-if", 477 | ] 478 | 479 | [[package]] 480 | name = "crossbeam" 481 | version = "0.8.4" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" 484 | dependencies = [ 485 | "crossbeam-channel", 486 | "crossbeam-deque", 487 | "crossbeam-epoch", 488 | "crossbeam-queue", 489 | "crossbeam-utils", 490 | ] 491 | 492 | [[package]] 493 | name = "crossbeam-channel" 494 | version = "0.5.13" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" 497 | dependencies = [ 498 | "crossbeam-utils", 499 | ] 500 | 501 | [[package]] 502 | name = "crossbeam-deque" 503 | version = "0.8.5" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 506 | dependencies = [ 507 | "crossbeam-epoch", 508 | "crossbeam-utils", 509 | ] 510 | 511 | [[package]] 512 | name = "crossbeam-epoch" 513 | version = "0.9.18" 514 | source = "registry+https://github.com/rust-lang/crates.io-index" 515 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 516 | dependencies = [ 517 | "crossbeam-utils", 518 | ] 519 | 520 | [[package]] 521 | name = "crossbeam-queue" 522 | version = "0.3.11" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" 525 | dependencies = [ 526 | "crossbeam-utils", 527 | ] 528 | 529 | [[package]] 530 | name = "crossbeam-utils" 531 | version = "0.8.20" 532 | source = "registry+https://github.com/rust-lang/crates.io-index" 533 | checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" 534 | 535 | [[package]] 536 | name = "crypto-common" 537 | version = "0.1.6" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 540 | dependencies = [ 541 | "generic-array", 542 | "typenum", 543 | ] 544 | 545 | [[package]] 546 | name = "ctr" 547 | version = "0.9.2" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" 550 | dependencies = [ 551 | "cipher", 552 | ] 553 | 554 | [[package]] 555 | name = "curve25519-dalek" 556 | version = "4.1.3" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" 559 | dependencies = [ 560 | "cfg-if", 561 | "cpufeatures", 562 | "curve25519-dalek-derive", 563 | "fiat-crypto", 564 | "rustc_version", 565 | "subtle", 566 | "zeroize", 567 | ] 568 | 569 | [[package]] 570 | name = "curve25519-dalek-derive" 571 | version = "0.1.1" 572 | source = "registry+https://github.com/rust-lang/crates.io-index" 573 | checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" 574 | dependencies = [ 575 | "proc-macro2", 576 | "quote", 577 | "syn 2.0.77", 578 | ] 579 | 580 | [[package]] 581 | name = "curve25519-dalek-ng" 582 | version = "4.1.1" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" 585 | dependencies = [ 586 | "byteorder", 587 | "digest 0.9.0", 588 | "rand_core", 589 | "subtle-ng", 590 | "zeroize", 591 | ] 592 | 593 | [[package]] 594 | name = "darling" 595 | version = "0.10.2" 596 | source = "registry+https://github.com/rust-lang/crates.io-index" 597 | checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" 598 | dependencies = [ 599 | "darling_core", 600 | "darling_macro", 601 | ] 602 | 603 | [[package]] 604 | name = "darling_core" 605 | version = "0.10.2" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" 608 | dependencies = [ 609 | "fnv", 610 | "ident_case", 611 | "proc-macro2", 612 | "quote", 613 | "strsim", 614 | "syn 1.0.109", 615 | ] 616 | 617 | [[package]] 618 | name = "darling_macro" 619 | version = "0.10.2" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" 622 | dependencies = [ 623 | "darling_core", 624 | "quote", 625 | "syn 1.0.109", 626 | ] 627 | 628 | [[package]] 629 | name = "dashmap" 630 | version = "5.5.3" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" 633 | dependencies = [ 634 | "cfg-if", 635 | "hashbrown", 636 | "lock_api", 637 | "once_cell", 638 | "parking_lot_core", 639 | ] 640 | 641 | [[package]] 642 | name = "data-encoding" 643 | version = "2.6.0" 644 | source = "registry+https://github.com/rust-lang/crates.io-index" 645 | checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" 646 | 647 | [[package]] 648 | name = "deranged" 649 | version = "0.3.11" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" 652 | dependencies = [ 653 | "powerfmt", 654 | ] 655 | 656 | [[package]] 657 | name = "derivative" 658 | version = "2.2.0" 659 | source = "registry+https://github.com/rust-lang/crates.io-index" 660 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 661 | dependencies = [ 662 | "proc-macro2", 663 | "quote", 664 | "syn 1.0.109", 665 | ] 666 | 667 | [[package]] 668 | name = "derive_builder" 669 | version = "0.9.0" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" 672 | dependencies = [ 673 | "darling", 674 | "derive_builder_core", 675 | "proc-macro2", 676 | "quote", 677 | "syn 1.0.109", 678 | ] 679 | 680 | [[package]] 681 | name = "derive_builder_core" 682 | version = "0.9.0" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" 685 | dependencies = [ 686 | "darling", 687 | "proc-macro2", 688 | "quote", 689 | "syn 1.0.109", 690 | ] 691 | 692 | [[package]] 693 | name = "destructure_traitobject" 694 | version = "0.2.0" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7" 697 | 698 | [[package]] 699 | name = "digest" 700 | version = "0.9.0" 701 | source = "registry+https://github.com/rust-lang/crates.io-index" 702 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 703 | dependencies = [ 704 | "generic-array", 705 | ] 706 | 707 | [[package]] 708 | name = "digest" 709 | version = "0.10.7" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 712 | dependencies = [ 713 | "block-buffer 0.10.4", 714 | "crypto-common", 715 | ] 716 | 717 | [[package]] 718 | name = "dns-lookup" 719 | version = "1.0.8" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "53ecafc952c4528d9b51a458d1a8904b81783feff9fde08ab6ed2545ff396872" 722 | dependencies = [ 723 | "cfg-if", 724 | "libc", 725 | "socket2 0.4.10", 726 | "winapi", 727 | ] 728 | 729 | [[package]] 730 | name = "ed25519" 731 | version = "1.5.3" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" 734 | dependencies = [ 735 | "signature", 736 | ] 737 | 738 | [[package]] 739 | name = "ed25519-dalek" 740 | version = "1.0.1" 741 | source = "git+https://github.com/broxus/ed25519-dalek.git#e5d68fd1490a7f6a0d473c6c1b1acef868960471" 742 | dependencies = [ 743 | "curve25519-dalek-ng", 744 | "ed25519", 745 | "rand", 746 | "serde", 747 | "sha2 0.9.9", 748 | "zeroize", 749 | ] 750 | 751 | [[package]] 752 | name = "endian-type" 753 | version = "0.1.2" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" 756 | 757 | [[package]] 758 | name = "enum-as-inner" 759 | version = "0.3.4" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "570d109b813e904becc80d8d5da38376818a143348413f7149f1340fe04754d4" 762 | dependencies = [ 763 | "heck", 764 | "proc-macro2", 765 | "quote", 766 | "syn 1.0.109", 767 | ] 768 | 769 | [[package]] 770 | name = "equivalent" 771 | version = "1.0.1" 772 | source = "registry+https://github.com/rust-lang/crates.io-index" 773 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 774 | 775 | [[package]] 776 | name = "errno" 777 | version = "0.3.9" 778 | source = "registry+https://github.com/rust-lang/crates.io-index" 779 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 780 | dependencies = [ 781 | "libc", 782 | "windows-sys", 783 | ] 784 | 785 | [[package]] 786 | name = "everscale-crypto" 787 | version = "0.2.1" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "0b0304a55e328ca4f354e59e6816bccb43b03f681b85b31c6bd10ea7233d62b5" 790 | dependencies = [ 791 | "curve25519-dalek", 792 | "generic-array", 793 | "hex", 794 | "rand", 795 | "sha2 0.10.8", 796 | "tl-proto", 797 | ] 798 | 799 | [[package]] 800 | name = "everscale-network" 801 | version = "0.5.5" 802 | source = "git+https://github.com/broxus/everscale-network#ca84e8b9cb66a3ab462a664f5edb0bcbc8512a31" 803 | dependencies = [ 804 | "aes", 805 | "ahash", 806 | "anyhow", 807 | "async-trait", 808 | "bytes", 809 | "crossbeam-queue", 810 | "ctr", 811 | "dashmap", 812 | "everscale-crypto", 813 | "everscale-raptorq", 814 | "frunk_core", 815 | "futures-util", 816 | "generic-array", 817 | "hex", 818 | "libc", 819 | "once_cell", 820 | "parking_lot", 821 | "rand", 822 | "serde", 823 | "sha2 0.10.8", 824 | "smallvec", 825 | "thiserror", 826 | "tl-proto", 827 | "tokio", 828 | "tokio-util", 829 | "tracing", 830 | "zstd", 831 | ] 832 | 833 | [[package]] 834 | name = "everscale-raptorq" 835 | version = "1.7.0" 836 | source = "registry+https://github.com/rust-lang/crates.io-index" 837 | checksum = "719e7eca52068b4712789379ef850e5c08b3316bccab5be12d1cb9fcb323a57c" 838 | 839 | [[package]] 840 | name = "fdlimit" 841 | version = "0.2.1" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" 844 | dependencies = [ 845 | "libc", 846 | ] 847 | 848 | [[package]] 849 | name = "fiat-crypto" 850 | version = "0.2.9" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" 853 | 854 | [[package]] 855 | name = "flate2" 856 | version = "1.0.33" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" 859 | dependencies = [ 860 | "crc32fast", 861 | "miniz_oxide 0.8.0", 862 | ] 863 | 864 | [[package]] 865 | name = "fnv" 866 | version = "1.0.7" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 869 | 870 | [[package]] 871 | name = "form_urlencoded" 872 | version = "1.2.1" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 875 | dependencies = [ 876 | "percent-encoding", 877 | ] 878 | 879 | [[package]] 880 | name = "frunk_core" 881 | version = "0.4.3" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "3529a07095650187788833d585c219761114005d5976185760cf794d265b6a5c" 884 | dependencies = [ 885 | "serde", 886 | ] 887 | 888 | [[package]] 889 | name = "fs_extra" 890 | version = "1.3.0" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" 893 | 894 | [[package]] 895 | name = "futures" 896 | version = "0.3.30" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" 899 | dependencies = [ 900 | "futures-channel", 901 | "futures-core", 902 | "futures-executor", 903 | "futures-io", 904 | "futures-sink", 905 | "futures-task", 906 | "futures-util", 907 | ] 908 | 909 | [[package]] 910 | name = "futures-channel" 911 | version = "0.3.30" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 914 | dependencies = [ 915 | "futures-core", 916 | "futures-sink", 917 | ] 918 | 919 | [[package]] 920 | name = "futures-core" 921 | version = "0.3.30" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 924 | 925 | [[package]] 926 | name = "futures-executor" 927 | version = "0.3.30" 928 | source = "registry+https://github.com/rust-lang/crates.io-index" 929 | checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" 930 | dependencies = [ 931 | "futures-core", 932 | "futures-task", 933 | "futures-util", 934 | ] 935 | 936 | [[package]] 937 | name = "futures-io" 938 | version = "0.3.30" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" 941 | 942 | [[package]] 943 | name = "futures-macro" 944 | version = "0.3.30" 945 | source = "registry+https://github.com/rust-lang/crates.io-index" 946 | checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" 947 | dependencies = [ 948 | "proc-macro2", 949 | "quote", 950 | "syn 2.0.77", 951 | ] 952 | 953 | [[package]] 954 | name = "futures-sink" 955 | version = "0.3.30" 956 | source = "registry+https://github.com/rust-lang/crates.io-index" 957 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 958 | 959 | [[package]] 960 | name = "futures-task" 961 | version = "0.3.30" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 964 | 965 | [[package]] 966 | name = "futures-util" 967 | version = "0.3.30" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 970 | dependencies = [ 971 | "futures-channel", 972 | "futures-core", 973 | "futures-io", 974 | "futures-macro", 975 | "futures-sink", 976 | "futures-task", 977 | "memchr", 978 | "pin-project-lite", 979 | "pin-utils", 980 | "slab", 981 | ] 982 | 983 | [[package]] 984 | name = "generic-array" 985 | version = "0.14.7" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 988 | dependencies = [ 989 | "typenum", 990 | "version_check", 991 | ] 992 | 993 | [[package]] 994 | name = "getrandom" 995 | version = "0.2.15" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 998 | dependencies = [ 999 | "cfg-if", 1000 | "libc", 1001 | "wasi", 1002 | ] 1003 | 1004 | [[package]] 1005 | name = "gimli" 1006 | version = "0.29.0" 1007 | source = "registry+https://github.com/rust-lang/crates.io-index" 1008 | checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" 1009 | 1010 | [[package]] 1011 | name = "glob" 1012 | version = "0.3.1" 1013 | source = "registry+https://github.com/rust-lang/crates.io-index" 1014 | checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" 1015 | 1016 | [[package]] 1017 | name = "global-config" 1018 | version = "0.1.0" 1019 | source = "git+https://github.com/hacker-volodya/ton-indexer#4a623123eb2c6c59854afaa0e1cbe130f5efb462" 1020 | dependencies = [ 1021 | "anyhow", 1022 | "base64 0.13.1", 1023 | "everscale-crypto", 1024 | "everscale-network", 1025 | "serde", 1026 | "serde_json", 1027 | "ton_block", 1028 | ] 1029 | 1030 | [[package]] 1031 | name = "hashbrown" 1032 | version = "0.14.5" 1033 | source = "registry+https://github.com/rust-lang/crates.io-index" 1034 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 1035 | dependencies = [ 1036 | "ahash", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "heck" 1041 | version = "0.4.1" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 1044 | 1045 | [[package]] 1046 | name = "hermit-abi" 1047 | version = "0.3.9" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 1050 | 1051 | [[package]] 1052 | name = "hex" 1053 | version = "0.4.3" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 1056 | 1057 | [[package]] 1058 | name = "http" 1059 | version = "0.2.12" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" 1062 | dependencies = [ 1063 | "bytes", 1064 | "fnv", 1065 | "itoa", 1066 | ] 1067 | 1068 | [[package]] 1069 | name = "http" 1070 | version = "1.1.0" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 1073 | dependencies = [ 1074 | "bytes", 1075 | "fnv", 1076 | "itoa", 1077 | ] 1078 | 1079 | [[package]] 1080 | name = "http-body" 1081 | version = "0.4.6" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" 1084 | dependencies = [ 1085 | "bytes", 1086 | "http 0.2.12", 1087 | "pin-project-lite", 1088 | ] 1089 | 1090 | [[package]] 1091 | name = "http-body" 1092 | version = "1.0.1" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 1095 | dependencies = [ 1096 | "bytes", 1097 | "http 1.1.0", 1098 | ] 1099 | 1100 | [[package]] 1101 | name = "http-body-util" 1102 | version = "0.1.2" 1103 | source = "registry+https://github.com/rust-lang/crates.io-index" 1104 | checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" 1105 | dependencies = [ 1106 | "bytes", 1107 | "futures-util", 1108 | "http 1.1.0", 1109 | "http-body 1.0.1", 1110 | "pin-project-lite", 1111 | ] 1112 | 1113 | [[package]] 1114 | name = "httparse" 1115 | version = "1.9.4" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" 1118 | 1119 | [[package]] 1120 | name = "httpdate" 1121 | version = "1.0.3" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 1124 | 1125 | [[package]] 1126 | name = "humantime" 1127 | version = "2.1.0" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 1130 | 1131 | [[package]] 1132 | name = "hyper" 1133 | version = "0.14.30" 1134 | source = "registry+https://github.com/rust-lang/crates.io-index" 1135 | checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" 1136 | dependencies = [ 1137 | "bytes", 1138 | "futures-channel", 1139 | "futures-core", 1140 | "futures-util", 1141 | "http 0.2.12", 1142 | "http-body 0.4.6", 1143 | "httparse", 1144 | "httpdate", 1145 | "itoa", 1146 | "pin-project-lite", 1147 | "socket2 0.5.7", 1148 | "tokio", 1149 | "tower-service", 1150 | "tracing", 1151 | "want", 1152 | ] 1153 | 1154 | [[package]] 1155 | name = "hyper" 1156 | version = "1.4.1" 1157 | source = "registry+https://github.com/rust-lang/crates.io-index" 1158 | checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" 1159 | dependencies = [ 1160 | "bytes", 1161 | "futures-channel", 1162 | "futures-util", 1163 | "http 1.1.0", 1164 | "http-body 1.0.1", 1165 | "httparse", 1166 | "httpdate", 1167 | "itoa", 1168 | "pin-project-lite", 1169 | "smallvec", 1170 | "tokio", 1171 | ] 1172 | 1173 | [[package]] 1174 | name = "hyper-system-resolver" 1175 | version = "0.5.0" 1176 | source = "registry+https://github.com/rust-lang/crates.io-index" 1177 | checksum = "6eea26c5d0b6ab9d72219f65000af310f042a740926f7b2fa3553e774036e2e7" 1178 | dependencies = [ 1179 | "derive_builder", 1180 | "dns-lookup", 1181 | "hyper 0.14.30", 1182 | "tokio", 1183 | "tower-service", 1184 | "tracing", 1185 | ] 1186 | 1187 | [[package]] 1188 | name = "hyper-util" 1189 | version = "0.1.7" 1190 | source = "registry+https://github.com/rust-lang/crates.io-index" 1191 | checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" 1192 | dependencies = [ 1193 | "bytes", 1194 | "futures-util", 1195 | "http 1.1.0", 1196 | "http-body 1.0.1", 1197 | "hyper 1.4.1", 1198 | "pin-project-lite", 1199 | "tokio", 1200 | ] 1201 | 1202 | [[package]] 1203 | name = "iana-time-zone" 1204 | version = "0.1.60" 1205 | source = "registry+https://github.com/rust-lang/crates.io-index" 1206 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 1207 | dependencies = [ 1208 | "android_system_properties", 1209 | "core-foundation-sys", 1210 | "iana-time-zone-haiku", 1211 | "js-sys", 1212 | "wasm-bindgen", 1213 | "windows-core", 1214 | ] 1215 | 1216 | [[package]] 1217 | name = "iana-time-zone-haiku" 1218 | version = "0.1.2" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 1221 | dependencies = [ 1222 | "cc", 1223 | ] 1224 | 1225 | [[package]] 1226 | name = "ident_case" 1227 | version = "1.0.1" 1228 | source = "registry+https://github.com/rust-lang/crates.io-index" 1229 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 1230 | 1231 | [[package]] 1232 | name = "idna" 1233 | version = "0.2.3" 1234 | source = "registry+https://github.com/rust-lang/crates.io-index" 1235 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 1236 | dependencies = [ 1237 | "matches", 1238 | "unicode-bidi", 1239 | "unicode-normalization", 1240 | ] 1241 | 1242 | [[package]] 1243 | name = "idna" 1244 | version = "0.5.0" 1245 | source = "registry+https://github.com/rust-lang/crates.io-index" 1246 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 1247 | dependencies = [ 1248 | "unicode-bidi", 1249 | "unicode-normalization", 1250 | ] 1251 | 1252 | [[package]] 1253 | name = "indexmap" 1254 | version = "2.5.0" 1255 | source = "registry+https://github.com/rust-lang/crates.io-index" 1256 | checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" 1257 | dependencies = [ 1258 | "equivalent", 1259 | "hashbrown", 1260 | ] 1261 | 1262 | [[package]] 1263 | name = "inout" 1264 | version = "0.1.3" 1265 | source = "registry+https://github.com/rust-lang/crates.io-index" 1266 | checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" 1267 | dependencies = [ 1268 | "generic-array", 1269 | ] 1270 | 1271 | [[package]] 1272 | name = "integer-encoding" 1273 | version = "1.1.7" 1274 | source = "registry+https://github.com/rust-lang/crates.io-index" 1275 | checksum = "48dc51180a9b377fd75814d0cc02199c20f8e99433d6762f650d39cdbbd3b56f" 1276 | 1277 | [[package]] 1278 | name = "ipnet" 1279 | version = "2.9.0" 1280 | source = "registry+https://github.com/rust-lang/crates.io-index" 1281 | checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" 1282 | 1283 | [[package]] 1284 | name = "itoa" 1285 | version = "1.0.11" 1286 | source = "registry+https://github.com/rust-lang/crates.io-index" 1287 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 1288 | 1289 | [[package]] 1290 | name = "jobserver" 1291 | version = "0.1.32" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" 1294 | dependencies = [ 1295 | "libc", 1296 | ] 1297 | 1298 | [[package]] 1299 | name = "js-sys" 1300 | version = "0.3.70" 1301 | source = "registry+https://github.com/rust-lang/crates.io-index" 1302 | checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" 1303 | dependencies = [ 1304 | "wasm-bindgen", 1305 | ] 1306 | 1307 | [[package]] 1308 | name = "lazy_static" 1309 | version = "1.5.0" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" 1312 | 1313 | [[package]] 1314 | name = "lazycell" 1315 | version = "1.3.0" 1316 | source = "registry+https://github.com/rust-lang/crates.io-index" 1317 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 1318 | 1319 | [[package]] 1320 | name = "libc" 1321 | version = "0.2.158" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" 1324 | 1325 | [[package]] 1326 | name = "libloading" 1327 | version = "0.8.5" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" 1330 | dependencies = [ 1331 | "cfg-if", 1332 | "windows-targets", 1333 | ] 1334 | 1335 | [[package]] 1336 | name = "librocksdb-sys" 1337 | version = "0.11.0+8.1.1" 1338 | source = "registry+https://github.com/rust-lang/crates.io-index" 1339 | checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" 1340 | dependencies = [ 1341 | "bindgen", 1342 | "bzip2-sys", 1343 | "cc", 1344 | "glob", 1345 | "libc", 1346 | "libz-sys", 1347 | "lz4-sys", 1348 | "tikv-jemalloc-sys", 1349 | "zstd-sys", 1350 | ] 1351 | 1352 | [[package]] 1353 | name = "libz-sys" 1354 | version = "1.1.20" 1355 | source = "registry+https://github.com/rust-lang/crates.io-index" 1356 | checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" 1357 | dependencies = [ 1358 | "cc", 1359 | "pkg-config", 1360 | "vcpkg", 1361 | ] 1362 | 1363 | [[package]] 1364 | name = "linked-hash-map" 1365 | version = "0.5.6" 1366 | source = "registry+https://github.com/rust-lang/crates.io-index" 1367 | checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" 1368 | 1369 | [[package]] 1370 | name = "linux-raw-sys" 1371 | version = "0.4.14" 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" 1373 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 1374 | 1375 | [[package]] 1376 | name = "lock_api" 1377 | version = "0.4.12" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 1380 | dependencies = [ 1381 | "autocfg", 1382 | "scopeguard", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "log" 1387 | version = "0.4.22" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 1390 | dependencies = [ 1391 | "serde", 1392 | ] 1393 | 1394 | [[package]] 1395 | name = "log-mdc" 1396 | version = "0.1.0" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7" 1399 | 1400 | [[package]] 1401 | name = "log4rs" 1402 | version = "1.3.0" 1403 | source = "registry+https://github.com/rust-lang/crates.io-index" 1404 | checksum = "0816135ae15bd0391cf284eab37e6e3ee0a6ee63d2ceeb659862bd8d0a984ca6" 1405 | dependencies = [ 1406 | "anyhow", 1407 | "arc-swap", 1408 | "chrono", 1409 | "derivative", 1410 | "fnv", 1411 | "humantime", 1412 | "libc", 1413 | "log", 1414 | "log-mdc", 1415 | "once_cell", 1416 | "parking_lot", 1417 | "rand", 1418 | "serde", 1419 | "serde-value", 1420 | "serde_json", 1421 | "serde_yaml", 1422 | "thiserror", 1423 | "thread-id", 1424 | "typemap-ors", 1425 | "winapi", 1426 | ] 1427 | 1428 | [[package]] 1429 | name = "lz4-sys" 1430 | version = "1.10.0" 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" 1432 | checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" 1433 | dependencies = [ 1434 | "cc", 1435 | "libc", 1436 | ] 1437 | 1438 | [[package]] 1439 | name = "matchers" 1440 | version = "0.1.0" 1441 | source = "registry+https://github.com/rust-lang/crates.io-index" 1442 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 1443 | dependencies = [ 1444 | "regex-automata 0.1.10", 1445 | ] 1446 | 1447 | [[package]] 1448 | name = "matches" 1449 | version = "0.1.10" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" 1452 | 1453 | [[package]] 1454 | name = "matchit" 1455 | version = "0.7.3" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 1458 | 1459 | [[package]] 1460 | name = "memchr" 1461 | version = "2.7.4" 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" 1463 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 1464 | 1465 | [[package]] 1466 | name = "metrics" 1467 | version = "0.22.3" 1468 | source = "registry+https://github.com/rust-lang/crates.io-index" 1469 | checksum = "2be3cbd384d4e955b231c895ce10685e3d8260c5ccffae898c96c723b0772835" 1470 | dependencies = [ 1471 | "ahash", 1472 | "portable-atomic", 1473 | ] 1474 | 1475 | [[package]] 1476 | name = "metrics-exporter-prometheus" 1477 | version = "0.14.0" 1478 | source = "registry+https://github.com/rust-lang/crates.io-index" 1479 | checksum = "5d58e362dc7206e9456ddbcdbd53c71ba441020e62104703075a69151e38d85f" 1480 | dependencies = [ 1481 | "base64 0.22.1", 1482 | "indexmap", 1483 | "metrics", 1484 | "metrics-util", 1485 | "quanta", 1486 | "thiserror", 1487 | ] 1488 | 1489 | [[package]] 1490 | name = "metrics-util" 1491 | version = "0.16.3" 1492 | source = "registry+https://github.com/rust-lang/crates.io-index" 1493 | checksum = "8b07a5eb561b8cbc16be2d216faf7757f9baf3bfb94dbb0fae3df8387a5bb47f" 1494 | dependencies = [ 1495 | "crossbeam-epoch", 1496 | "crossbeam-utils", 1497 | "hashbrown", 1498 | "metrics", 1499 | "num_cpus", 1500 | "quanta", 1501 | "sketches-ddsketch", 1502 | ] 1503 | 1504 | [[package]] 1505 | name = "mime" 1506 | version = "0.3.17" 1507 | source = "registry+https://github.com/rust-lang/crates.io-index" 1508 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 1509 | 1510 | [[package]] 1511 | name = "minimal-lexical" 1512 | version = "0.2.1" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1515 | 1516 | [[package]] 1517 | name = "miniz_oxide" 1518 | version = "0.7.4" 1519 | source = "registry+https://github.com/rust-lang/crates.io-index" 1520 | checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" 1521 | dependencies = [ 1522 | "adler", 1523 | ] 1524 | 1525 | [[package]] 1526 | name = "miniz_oxide" 1527 | version = "0.8.0" 1528 | source = "registry+https://github.com/rust-lang/crates.io-index" 1529 | checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" 1530 | dependencies = [ 1531 | "adler2", 1532 | ] 1533 | 1534 | [[package]] 1535 | name = "mio" 1536 | version = "1.0.2" 1537 | source = "registry+https://github.com/rust-lang/crates.io-index" 1538 | checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" 1539 | dependencies = [ 1540 | "hermit-abi", 1541 | "libc", 1542 | "wasi", 1543 | "windows-sys", 1544 | ] 1545 | 1546 | [[package]] 1547 | name = "nibble_vec" 1548 | version = "0.1.0" 1549 | source = "registry+https://github.com/rust-lang/crates.io-index" 1550 | checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" 1551 | dependencies = [ 1552 | "smallvec", 1553 | ] 1554 | 1555 | [[package]] 1556 | name = "nom" 1557 | version = "7.1.3" 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" 1559 | checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" 1560 | dependencies = [ 1561 | "memchr", 1562 | "minimal-lexical", 1563 | ] 1564 | 1565 | [[package]] 1566 | name = "ntapi" 1567 | version = "0.4.1" 1568 | source = "registry+https://github.com/rust-lang/crates.io-index" 1569 | checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" 1570 | dependencies = [ 1571 | "winapi", 1572 | ] 1573 | 1574 | [[package]] 1575 | name = "nu-ansi-term" 1576 | version = "0.46.0" 1577 | source = "registry+https://github.com/rust-lang/crates.io-index" 1578 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 1579 | dependencies = [ 1580 | "overload", 1581 | "winapi", 1582 | ] 1583 | 1584 | [[package]] 1585 | name = "num" 1586 | version = "0.4.3" 1587 | source = "registry+https://github.com/rust-lang/crates.io-index" 1588 | checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" 1589 | dependencies = [ 1590 | "num-bigint", 1591 | "num-complex", 1592 | "num-integer", 1593 | "num-iter", 1594 | "num-rational", 1595 | "num-traits", 1596 | ] 1597 | 1598 | [[package]] 1599 | name = "num-bigint" 1600 | version = "0.4.6" 1601 | source = "registry+https://github.com/rust-lang/crates.io-index" 1602 | checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" 1603 | dependencies = [ 1604 | "num-integer", 1605 | "num-traits", 1606 | ] 1607 | 1608 | [[package]] 1609 | name = "num-complex" 1610 | version = "0.4.6" 1611 | source = "registry+https://github.com/rust-lang/crates.io-index" 1612 | checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" 1613 | dependencies = [ 1614 | "num-traits", 1615 | ] 1616 | 1617 | [[package]] 1618 | name = "num-conv" 1619 | version = "0.1.0" 1620 | source = "registry+https://github.com/rust-lang/crates.io-index" 1621 | checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" 1622 | 1623 | [[package]] 1624 | name = "num-derive" 1625 | version = "0.3.3" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" 1628 | dependencies = [ 1629 | "proc-macro2", 1630 | "quote", 1631 | "syn 1.0.109", 1632 | ] 1633 | 1634 | [[package]] 1635 | name = "num-integer" 1636 | version = "0.1.46" 1637 | source = "registry+https://github.com/rust-lang/crates.io-index" 1638 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 1639 | dependencies = [ 1640 | "num-traits", 1641 | ] 1642 | 1643 | [[package]] 1644 | name = "num-iter" 1645 | version = "0.1.45" 1646 | source = "registry+https://github.com/rust-lang/crates.io-index" 1647 | checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" 1648 | dependencies = [ 1649 | "autocfg", 1650 | "num-integer", 1651 | "num-traits", 1652 | ] 1653 | 1654 | [[package]] 1655 | name = "num-rational" 1656 | version = "0.4.2" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" 1659 | dependencies = [ 1660 | "num-bigint", 1661 | "num-integer", 1662 | "num-traits", 1663 | ] 1664 | 1665 | [[package]] 1666 | name = "num-traits" 1667 | version = "0.2.19" 1668 | source = "registry+https://github.com/rust-lang/crates.io-index" 1669 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 1670 | dependencies = [ 1671 | "autocfg", 1672 | ] 1673 | 1674 | [[package]] 1675 | name = "num_cpus" 1676 | version = "1.16.0" 1677 | source = "registry+https://github.com/rust-lang/crates.io-index" 1678 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 1679 | dependencies = [ 1680 | "hermit-abi", 1681 | "libc", 1682 | ] 1683 | 1684 | [[package]] 1685 | name = "object" 1686 | version = "0.36.4" 1687 | source = "registry+https://github.com/rust-lang/crates.io-index" 1688 | checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" 1689 | dependencies = [ 1690 | "memchr", 1691 | ] 1692 | 1693 | [[package]] 1694 | name = "once_cell" 1695 | version = "1.19.0" 1696 | source = "registry+https://github.com/rust-lang/crates.io-index" 1697 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 1698 | 1699 | [[package]] 1700 | name = "opaque-debug" 1701 | version = "0.3.1" 1702 | source = "registry+https://github.com/rust-lang/crates.io-index" 1703 | checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" 1704 | 1705 | [[package]] 1706 | name = "opentelemetry" 1707 | version = "0.16.0" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "e1cf9b1c4e9a6c4de793c632496fa490bdc0e1eea73f0c91394f7b6990935d22" 1710 | dependencies = [ 1711 | "async-trait", 1712 | "crossbeam-channel", 1713 | "futures", 1714 | "js-sys", 1715 | "lazy_static", 1716 | "percent-encoding", 1717 | "pin-project", 1718 | "rand", 1719 | "thiserror", 1720 | ] 1721 | 1722 | [[package]] 1723 | name = "opentelemetry-jaeger" 1724 | version = "0.15.0" 1725 | source = "registry+https://github.com/rust-lang/crates.io-index" 1726 | checksum = "db22f492873ea037bc267b35a0e8e4fb846340058cb7c864efe3d0bf23684593" 1727 | dependencies = [ 1728 | "async-trait", 1729 | "lazy_static", 1730 | "opentelemetry", 1731 | "opentelemetry-semantic-conventions", 1732 | "thiserror", 1733 | "thrift", 1734 | ] 1735 | 1736 | [[package]] 1737 | name = "opentelemetry-semantic-conventions" 1738 | version = "0.8.0" 1739 | source = "registry+https://github.com/rust-lang/crates.io-index" 1740 | checksum = "ffeac823339e8b0f27b961f4385057bf9f97f2863bc745bd015fd6091f2270e9" 1741 | dependencies = [ 1742 | "opentelemetry", 1743 | ] 1744 | 1745 | [[package]] 1746 | name = "ordered-float" 1747 | version = "1.1.1" 1748 | source = "registry+https://github.com/rust-lang/crates.io-index" 1749 | checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" 1750 | dependencies = [ 1751 | "num-traits", 1752 | ] 1753 | 1754 | [[package]] 1755 | name = "ordered-float" 1756 | version = "2.10.1" 1757 | source = "registry+https://github.com/rust-lang/crates.io-index" 1758 | checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" 1759 | dependencies = [ 1760 | "num-traits", 1761 | ] 1762 | 1763 | [[package]] 1764 | name = "overload" 1765 | version = "0.1.1" 1766 | source = "registry+https://github.com/rust-lang/crates.io-index" 1767 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 1768 | 1769 | [[package]] 1770 | name = "parking_lot" 1771 | version = "0.12.3" 1772 | source = "registry+https://github.com/rust-lang/crates.io-index" 1773 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 1774 | dependencies = [ 1775 | "lock_api", 1776 | "parking_lot_core", 1777 | ] 1778 | 1779 | [[package]] 1780 | name = "parking_lot_core" 1781 | version = "0.9.10" 1782 | source = "registry+https://github.com/rust-lang/crates.io-index" 1783 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 1784 | dependencies = [ 1785 | "cfg-if", 1786 | "libc", 1787 | "redox_syscall", 1788 | "smallvec", 1789 | "windows-targets", 1790 | ] 1791 | 1792 | [[package]] 1793 | name = "pathdiff" 1794 | version = "0.2.1" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" 1797 | 1798 | [[package]] 1799 | name = "peeking_take_while" 1800 | version = "0.1.2" 1801 | source = "registry+https://github.com/rust-lang/crates.io-index" 1802 | checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" 1803 | 1804 | [[package]] 1805 | name = "percent-encoding" 1806 | version = "2.3.1" 1807 | source = "registry+https://github.com/rust-lang/crates.io-index" 1808 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 1809 | 1810 | [[package]] 1811 | name = "pest" 1812 | version = "2.7.11" 1813 | source = "registry+https://github.com/rust-lang/crates.io-index" 1814 | checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" 1815 | dependencies = [ 1816 | "memchr", 1817 | "thiserror", 1818 | "ucd-trie", 1819 | ] 1820 | 1821 | [[package]] 1822 | name = "pest_derive" 1823 | version = "2.7.11" 1824 | source = "registry+https://github.com/rust-lang/crates.io-index" 1825 | checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" 1826 | dependencies = [ 1827 | "pest", 1828 | "pest_generator", 1829 | ] 1830 | 1831 | [[package]] 1832 | name = "pest_generator" 1833 | version = "2.7.11" 1834 | source = "registry+https://github.com/rust-lang/crates.io-index" 1835 | checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" 1836 | dependencies = [ 1837 | "pest", 1838 | "pest_meta", 1839 | "proc-macro2", 1840 | "quote", 1841 | "syn 2.0.77", 1842 | ] 1843 | 1844 | [[package]] 1845 | name = "pest_meta" 1846 | version = "2.7.11" 1847 | source = "registry+https://github.com/rust-lang/crates.io-index" 1848 | checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" 1849 | dependencies = [ 1850 | "once_cell", 1851 | "pest", 1852 | "sha2 0.10.8", 1853 | ] 1854 | 1855 | [[package]] 1856 | name = "pin-project" 1857 | version = "1.1.5" 1858 | source = "registry+https://github.com/rust-lang/crates.io-index" 1859 | checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" 1860 | dependencies = [ 1861 | "pin-project-internal", 1862 | ] 1863 | 1864 | [[package]] 1865 | name = "pin-project-internal" 1866 | version = "1.1.5" 1867 | source = "registry+https://github.com/rust-lang/crates.io-index" 1868 | checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" 1869 | dependencies = [ 1870 | "proc-macro2", 1871 | "quote", 1872 | "syn 2.0.77", 1873 | ] 1874 | 1875 | [[package]] 1876 | name = "pin-project-lite" 1877 | version = "0.2.14" 1878 | source = "registry+https://github.com/rust-lang/crates.io-index" 1879 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 1880 | 1881 | [[package]] 1882 | name = "pin-utils" 1883 | version = "0.1.0" 1884 | source = "registry+https://github.com/rust-lang/crates.io-index" 1885 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1886 | 1887 | [[package]] 1888 | name = "pkg-config" 1889 | version = "0.3.30" 1890 | source = "registry+https://github.com/rust-lang/crates.io-index" 1891 | checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" 1892 | 1893 | [[package]] 1894 | name = "portable-atomic" 1895 | version = "1.7.0" 1896 | source = "registry+https://github.com/rust-lang/crates.io-index" 1897 | checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" 1898 | 1899 | [[package]] 1900 | name = "powerfmt" 1901 | version = "0.2.0" 1902 | source = "registry+https://github.com/rust-lang/crates.io-index" 1903 | checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" 1904 | 1905 | [[package]] 1906 | name = "ppv-lite86" 1907 | version = "0.2.20" 1908 | source = "registry+https://github.com/rust-lang/crates.io-index" 1909 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 1910 | dependencies = [ 1911 | "zerocopy", 1912 | ] 1913 | 1914 | [[package]] 1915 | name = "prettyplease" 1916 | version = "0.2.22" 1917 | source = "registry+https://github.com/rust-lang/crates.io-index" 1918 | checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" 1919 | dependencies = [ 1920 | "proc-macro2", 1921 | "syn 2.0.77", 1922 | ] 1923 | 1924 | [[package]] 1925 | name = "proc-macro2" 1926 | version = "1.0.86" 1927 | source = "registry+https://github.com/rust-lang/crates.io-index" 1928 | checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 1929 | dependencies = [ 1930 | "unicode-ident", 1931 | ] 1932 | 1933 | [[package]] 1934 | name = "procfs" 1935 | version = "0.16.0" 1936 | source = "registry+https://github.com/rust-lang/crates.io-index" 1937 | checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" 1938 | dependencies = [ 1939 | "bitflags 2.6.0", 1940 | "hex", 1941 | "lazy_static", 1942 | "procfs-core", 1943 | "rustix", 1944 | ] 1945 | 1946 | [[package]] 1947 | name = "procfs-core" 1948 | version = "0.16.0" 1949 | source = "registry+https://github.com/rust-lang/crates.io-index" 1950 | checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" 1951 | dependencies = [ 1952 | "bitflags 2.6.0", 1953 | "hex", 1954 | ] 1955 | 1956 | [[package]] 1957 | name = "prometheus" 1958 | version = "0.13.4" 1959 | source = "registry+https://github.com/rust-lang/crates.io-index" 1960 | checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" 1961 | dependencies = [ 1962 | "cfg-if", 1963 | "fnv", 1964 | "lazy_static", 1965 | "libc", 1966 | "memchr", 1967 | "parking_lot", 1968 | "procfs", 1969 | "protobuf", 1970 | "thiserror", 1971 | ] 1972 | 1973 | [[package]] 1974 | name = "protobuf" 1975 | version = "2.28.0" 1976 | source = "registry+https://github.com/rust-lang/crates.io-index" 1977 | checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" 1978 | 1979 | [[package]] 1980 | name = "public-ip" 1981 | version = "0.2.2" 1982 | source = "registry+https://github.com/rust-lang/crates.io-index" 1983 | checksum = "7b4c40db5262d93298c363a299f8bc1b3a956a78eecddba3bc0e58b76e2f419a" 1984 | dependencies = [ 1985 | "dns-lookup", 1986 | "futures-core", 1987 | "futures-util", 1988 | "http 0.2.12", 1989 | "hyper 0.14.30", 1990 | "hyper-system-resolver", 1991 | "pin-project-lite", 1992 | "thiserror", 1993 | "tokio", 1994 | "tracing", 1995 | "tracing-futures", 1996 | "trust-dns-client", 1997 | "trust-dns-proto", 1998 | ] 1999 | 2000 | [[package]] 2001 | name = "quanta" 2002 | version = "0.12.3" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" 2005 | dependencies = [ 2006 | "crossbeam-utils", 2007 | "libc", 2008 | "once_cell", 2009 | "raw-cpuid", 2010 | "wasi", 2011 | "web-sys", 2012 | "winapi", 2013 | ] 2014 | 2015 | [[package]] 2016 | name = "quick_cache" 2017 | version = "0.4.3" 2018 | source = "registry+https://github.com/rust-lang/crates.io-index" 2019 | checksum = "4a4b807ec70346b4fac3c13ae967634237847d49871f623fe0d455403346bad4" 2020 | dependencies = [ 2021 | "ahash", 2022 | "equivalent", 2023 | "hashbrown", 2024 | "parking_lot", 2025 | ] 2026 | 2027 | [[package]] 2028 | name = "quote" 2029 | version = "1.0.37" 2030 | source = "registry+https://github.com/rust-lang/crates.io-index" 2031 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 2032 | dependencies = [ 2033 | "proc-macro2", 2034 | ] 2035 | 2036 | [[package]] 2037 | name = "radix_trie" 2038 | version = "0.2.1" 2039 | source = "registry+https://github.com/rust-lang/crates.io-index" 2040 | checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" 2041 | dependencies = [ 2042 | "endian-type", 2043 | "nibble_vec", 2044 | ] 2045 | 2046 | [[package]] 2047 | name = "rand" 2048 | version = "0.8.5" 2049 | source = "registry+https://github.com/rust-lang/crates.io-index" 2050 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 2051 | dependencies = [ 2052 | "libc", 2053 | "rand_chacha", 2054 | "rand_core", 2055 | ] 2056 | 2057 | [[package]] 2058 | name = "rand_chacha" 2059 | version = "0.3.1" 2060 | source = "registry+https://github.com/rust-lang/crates.io-index" 2061 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 2062 | dependencies = [ 2063 | "ppv-lite86", 2064 | "rand_core", 2065 | ] 2066 | 2067 | [[package]] 2068 | name = "rand_core" 2069 | version = "0.6.4" 2070 | source = "registry+https://github.com/rust-lang/crates.io-index" 2071 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 2072 | dependencies = [ 2073 | "getrandom", 2074 | ] 2075 | 2076 | [[package]] 2077 | name = "raw-cpuid" 2078 | version = "11.1.0" 2079 | source = "registry+https://github.com/rust-lang/crates.io-index" 2080 | checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" 2081 | dependencies = [ 2082 | "bitflags 2.6.0", 2083 | ] 2084 | 2085 | [[package]] 2086 | name = "redox_syscall" 2087 | version = "0.5.3" 2088 | source = "registry+https://github.com/rust-lang/crates.io-index" 2089 | checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" 2090 | dependencies = [ 2091 | "bitflags 2.6.0", 2092 | ] 2093 | 2094 | [[package]] 2095 | name = "regex" 2096 | version = "1.10.6" 2097 | source = "registry+https://github.com/rust-lang/crates.io-index" 2098 | checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" 2099 | dependencies = [ 2100 | "aho-corasick", 2101 | "memchr", 2102 | "regex-automata 0.4.7", 2103 | "regex-syntax 0.8.4", 2104 | ] 2105 | 2106 | [[package]] 2107 | name = "regex-automata" 2108 | version = "0.1.10" 2109 | source = "registry+https://github.com/rust-lang/crates.io-index" 2110 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 2111 | dependencies = [ 2112 | "regex-syntax 0.6.29", 2113 | ] 2114 | 2115 | [[package]] 2116 | name = "regex-automata" 2117 | version = "0.4.7" 2118 | source = "registry+https://github.com/rust-lang/crates.io-index" 2119 | checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" 2120 | dependencies = [ 2121 | "aho-corasick", 2122 | "memchr", 2123 | "regex-syntax 0.8.4", 2124 | ] 2125 | 2126 | [[package]] 2127 | name = "regex-syntax" 2128 | version = "0.6.29" 2129 | source = "registry+https://github.com/rust-lang/crates.io-index" 2130 | checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" 2131 | 2132 | [[package]] 2133 | name = "regex-syntax" 2134 | version = "0.8.4" 2135 | source = "registry+https://github.com/rust-lang/crates.io-index" 2136 | checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" 2137 | 2138 | [[package]] 2139 | name = "ring" 2140 | version = "0.17.8" 2141 | source = "registry+https://github.com/rust-lang/crates.io-index" 2142 | checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" 2143 | dependencies = [ 2144 | "cc", 2145 | "cfg-if", 2146 | "getrandom", 2147 | "libc", 2148 | "spin", 2149 | "untrusted", 2150 | "windows-sys", 2151 | ] 2152 | 2153 | [[package]] 2154 | name = "rlimit" 2155 | version = "0.9.1" 2156 | source = "registry+https://github.com/rust-lang/crates.io-index" 2157 | checksum = "f8a29d87a652dc4d43c586328706bb5cdff211f3f39a530f240b53f7221dab8e" 2158 | dependencies = [ 2159 | "libc", 2160 | ] 2161 | 2162 | [[package]] 2163 | name = "rocksdb" 2164 | version = "0.21.0" 2165 | source = "registry+https://github.com/rust-lang/crates.io-index" 2166 | checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" 2167 | dependencies = [ 2168 | "libc", 2169 | "librocksdb-sys", 2170 | ] 2171 | 2172 | [[package]] 2173 | name = "rustc-demangle" 2174 | version = "0.1.24" 2175 | source = "registry+https://github.com/rust-lang/crates.io-index" 2176 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 2177 | 2178 | [[package]] 2179 | name = "rustc-hash" 2180 | version = "1.1.0" 2181 | source = "registry+https://github.com/rust-lang/crates.io-index" 2182 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 2183 | 2184 | [[package]] 2185 | name = "rustc_version" 2186 | version = "0.4.1" 2187 | source = "registry+https://github.com/rust-lang/crates.io-index" 2188 | checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" 2189 | dependencies = [ 2190 | "semver", 2191 | ] 2192 | 2193 | [[package]] 2194 | name = "rustix" 2195 | version = "0.38.35" 2196 | source = "registry+https://github.com/rust-lang/crates.io-index" 2197 | checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" 2198 | dependencies = [ 2199 | "bitflags 2.6.0", 2200 | "errno", 2201 | "libc", 2202 | "linux-raw-sys", 2203 | "windows-sys", 2204 | ] 2205 | 2206 | [[package]] 2207 | name = "rustls" 2208 | version = "0.23.12" 2209 | source = "registry+https://github.com/rust-lang/crates.io-index" 2210 | checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" 2211 | dependencies = [ 2212 | "log", 2213 | "once_cell", 2214 | "ring", 2215 | "rustls-pki-types", 2216 | "rustls-webpki", 2217 | "subtle", 2218 | "zeroize", 2219 | ] 2220 | 2221 | [[package]] 2222 | name = "rustls-pki-types" 2223 | version = "1.8.0" 2224 | source = "registry+https://github.com/rust-lang/crates.io-index" 2225 | checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" 2226 | 2227 | [[package]] 2228 | name = "rustls-webpki" 2229 | version = "0.102.7" 2230 | source = "registry+https://github.com/rust-lang/crates.io-index" 2231 | checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" 2232 | dependencies = [ 2233 | "ring", 2234 | "rustls-pki-types", 2235 | "untrusted", 2236 | ] 2237 | 2238 | [[package]] 2239 | name = "rustversion" 2240 | version = "1.0.17" 2241 | source = "registry+https://github.com/rust-lang/crates.io-index" 2242 | checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" 2243 | 2244 | [[package]] 2245 | name = "ryu" 2246 | version = "1.0.18" 2247 | source = "registry+https://github.com/rust-lang/crates.io-index" 2248 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 2249 | 2250 | [[package]] 2251 | name = "scopeguard" 2252 | version = "1.2.0" 2253 | source = "registry+https://github.com/rust-lang/crates.io-index" 2254 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 2255 | 2256 | [[package]] 2257 | name = "semver" 2258 | version = "1.0.23" 2259 | source = "registry+https://github.com/rust-lang/crates.io-index" 2260 | checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" 2261 | 2262 | [[package]] 2263 | name = "serde" 2264 | version = "1.0.209" 2265 | source = "registry+https://github.com/rust-lang/crates.io-index" 2266 | checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" 2267 | dependencies = [ 2268 | "serde_derive", 2269 | ] 2270 | 2271 | [[package]] 2272 | name = "serde-value" 2273 | version = "0.7.0" 2274 | source = "registry+https://github.com/rust-lang/crates.io-index" 2275 | checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" 2276 | dependencies = [ 2277 | "ordered-float 2.10.1", 2278 | "serde", 2279 | ] 2280 | 2281 | [[package]] 2282 | name = "serde_derive" 2283 | version = "1.0.209" 2284 | source = "registry+https://github.com/rust-lang/crates.io-index" 2285 | checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" 2286 | dependencies = [ 2287 | "proc-macro2", 2288 | "quote", 2289 | "syn 2.0.77", 2290 | ] 2291 | 2292 | [[package]] 2293 | name = "serde_json" 2294 | version = "1.0.128" 2295 | source = "registry+https://github.com/rust-lang/crates.io-index" 2296 | checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" 2297 | dependencies = [ 2298 | "itoa", 2299 | "memchr", 2300 | "ryu", 2301 | "serde", 2302 | ] 2303 | 2304 | [[package]] 2305 | name = "serde_path_to_error" 2306 | version = "0.1.16" 2307 | source = "registry+https://github.com/rust-lang/crates.io-index" 2308 | checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" 2309 | dependencies = [ 2310 | "itoa", 2311 | "serde", 2312 | ] 2313 | 2314 | [[package]] 2315 | name = "serde_urlencoded" 2316 | version = "0.7.1" 2317 | source = "registry+https://github.com/rust-lang/crates.io-index" 2318 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 2319 | dependencies = [ 2320 | "form_urlencoded", 2321 | "itoa", 2322 | "ryu", 2323 | "serde", 2324 | ] 2325 | 2326 | [[package]] 2327 | name = "serde_yaml" 2328 | version = "0.9.34+deprecated" 2329 | source = "registry+https://github.com/rust-lang/crates.io-index" 2330 | checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" 2331 | dependencies = [ 2332 | "indexmap", 2333 | "itoa", 2334 | "ryu", 2335 | "serde", 2336 | "unsafe-libyaml", 2337 | ] 2338 | 2339 | [[package]] 2340 | name = "sha2" 2341 | version = "0.9.9" 2342 | source = "registry+https://github.com/rust-lang/crates.io-index" 2343 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 2344 | dependencies = [ 2345 | "block-buffer 0.9.0", 2346 | "cfg-if", 2347 | "cpufeatures", 2348 | "digest 0.9.0", 2349 | "opaque-debug", 2350 | ] 2351 | 2352 | [[package]] 2353 | name = "sha2" 2354 | version = "0.10.8" 2355 | source = "registry+https://github.com/rust-lang/crates.io-index" 2356 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 2357 | dependencies = [ 2358 | "cfg-if", 2359 | "cpufeatures", 2360 | "digest 0.10.7", 2361 | ] 2362 | 2363 | [[package]] 2364 | name = "sharded-slab" 2365 | version = "0.1.7" 2366 | source = "registry+https://github.com/rust-lang/crates.io-index" 2367 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 2368 | dependencies = [ 2369 | "lazy_static", 2370 | ] 2371 | 2372 | [[package]] 2373 | name = "shlex" 2374 | version = "1.3.0" 2375 | source = "registry+https://github.com/rust-lang/crates.io-index" 2376 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 2377 | 2378 | [[package]] 2379 | name = "signal-hook-registry" 2380 | version = "1.4.2" 2381 | source = "registry+https://github.com/rust-lang/crates.io-index" 2382 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 2383 | dependencies = [ 2384 | "libc", 2385 | ] 2386 | 2387 | [[package]] 2388 | name = "signature" 2389 | version = "1.6.4" 2390 | source = "registry+https://github.com/rust-lang/crates.io-index" 2391 | checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" 2392 | 2393 | [[package]] 2394 | name = "sketches-ddsketch" 2395 | version = "0.2.2" 2396 | source = "registry+https://github.com/rust-lang/crates.io-index" 2397 | checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c" 2398 | 2399 | [[package]] 2400 | name = "slab" 2401 | version = "0.4.9" 2402 | source = "registry+https://github.com/rust-lang/crates.io-index" 2403 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 2404 | dependencies = [ 2405 | "autocfg", 2406 | ] 2407 | 2408 | [[package]] 2409 | name = "smallvec" 2410 | version = "1.13.2" 2411 | source = "registry+https://github.com/rust-lang/crates.io-index" 2412 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 2413 | dependencies = [ 2414 | "serde", 2415 | ] 2416 | 2417 | [[package]] 2418 | name = "socket2" 2419 | version = "0.4.10" 2420 | source = "registry+https://github.com/rust-lang/crates.io-index" 2421 | checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" 2422 | dependencies = [ 2423 | "libc", 2424 | "winapi", 2425 | ] 2426 | 2427 | [[package]] 2428 | name = "socket2" 2429 | version = "0.5.7" 2430 | source = "registry+https://github.com/rust-lang/crates.io-index" 2431 | checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 2432 | dependencies = [ 2433 | "libc", 2434 | "windows-sys", 2435 | ] 2436 | 2437 | [[package]] 2438 | name = "spin" 2439 | version = "0.9.8" 2440 | source = "registry+https://github.com/rust-lang/crates.io-index" 2441 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 2442 | 2443 | [[package]] 2444 | name = "strsim" 2445 | version = "0.9.3" 2446 | source = "registry+https://github.com/rust-lang/crates.io-index" 2447 | checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 2448 | 2449 | [[package]] 2450 | name = "subtle" 2451 | version = "2.6.1" 2452 | source = "registry+https://github.com/rust-lang/crates.io-index" 2453 | checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" 2454 | 2455 | [[package]] 2456 | name = "subtle-ng" 2457 | version = "2.5.0" 2458 | source = "registry+https://github.com/rust-lang/crates.io-index" 2459 | checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" 2460 | 2461 | [[package]] 2462 | name = "syn" 2463 | version = "1.0.109" 2464 | source = "registry+https://github.com/rust-lang/crates.io-index" 2465 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 2466 | dependencies = [ 2467 | "proc-macro2", 2468 | "quote", 2469 | "unicode-ident", 2470 | ] 2471 | 2472 | [[package]] 2473 | name = "syn" 2474 | version = "2.0.77" 2475 | source = "registry+https://github.com/rust-lang/crates.io-index" 2476 | checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" 2477 | dependencies = [ 2478 | "proc-macro2", 2479 | "quote", 2480 | "unicode-ident", 2481 | ] 2482 | 2483 | [[package]] 2484 | name = "sync_wrapper" 2485 | version = "0.1.2" 2486 | source = "registry+https://github.com/rust-lang/crates.io-index" 2487 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 2488 | 2489 | [[package]] 2490 | name = "sync_wrapper" 2491 | version = "1.0.1" 2492 | source = "registry+https://github.com/rust-lang/crates.io-index" 2493 | checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" 2494 | 2495 | [[package]] 2496 | name = "sysinfo" 2497 | version = "0.29.11" 2498 | source = "registry+https://github.com/rust-lang/crates.io-index" 2499 | checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" 2500 | dependencies = [ 2501 | "cfg-if", 2502 | "core-foundation-sys", 2503 | "libc", 2504 | "ntapi", 2505 | "once_cell", 2506 | "winapi", 2507 | ] 2508 | 2509 | [[package]] 2510 | name = "thiserror" 2511 | version = "1.0.63" 2512 | source = "registry+https://github.com/rust-lang/crates.io-index" 2513 | checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" 2514 | dependencies = [ 2515 | "thiserror-impl", 2516 | ] 2517 | 2518 | [[package]] 2519 | name = "thiserror-impl" 2520 | version = "1.0.63" 2521 | source = "registry+https://github.com/rust-lang/crates.io-index" 2522 | checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" 2523 | dependencies = [ 2524 | "proc-macro2", 2525 | "quote", 2526 | "syn 2.0.77", 2527 | ] 2528 | 2529 | [[package]] 2530 | name = "thread-id" 2531 | version = "4.2.2" 2532 | source = "registry+https://github.com/rust-lang/crates.io-index" 2533 | checksum = "cfe8f25bbdd100db7e1d34acf7fd2dc59c4bf8f7483f505eaa7d4f12f76cc0ea" 2534 | dependencies = [ 2535 | "libc", 2536 | "winapi", 2537 | ] 2538 | 2539 | [[package]] 2540 | name = "thread_local" 2541 | version = "1.1.8" 2542 | source = "registry+https://github.com/rust-lang/crates.io-index" 2543 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 2544 | dependencies = [ 2545 | "cfg-if", 2546 | "once_cell", 2547 | ] 2548 | 2549 | [[package]] 2550 | name = "threadpool" 2551 | version = "1.8.1" 2552 | source = "registry+https://github.com/rust-lang/crates.io-index" 2553 | checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" 2554 | dependencies = [ 2555 | "num_cpus", 2556 | ] 2557 | 2558 | [[package]] 2559 | name = "thrift" 2560 | version = "0.13.0" 2561 | source = "registry+https://github.com/rust-lang/crates.io-index" 2562 | checksum = "0c6d965454947cc7266d22716ebfd07b18d84ebaf35eec558586bbb2a8cb6b5b" 2563 | dependencies = [ 2564 | "byteorder", 2565 | "integer-encoding", 2566 | "log", 2567 | "ordered-float 1.1.1", 2568 | "threadpool", 2569 | ] 2570 | 2571 | [[package]] 2572 | name = "tikv-jemalloc-sys" 2573 | version = "0.5.4+5.3.0-patched" 2574 | source = "registry+https://github.com/rust-lang/crates.io-index" 2575 | checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" 2576 | dependencies = [ 2577 | "cc", 2578 | "libc", 2579 | ] 2580 | 2581 | [[package]] 2582 | name = "tikv-jemallocator" 2583 | version = "0.5.4" 2584 | source = "registry+https://github.com/rust-lang/crates.io-index" 2585 | checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca" 2586 | dependencies = [ 2587 | "libc", 2588 | "tikv-jemalloc-sys", 2589 | ] 2590 | 2591 | [[package]] 2592 | name = "time" 2593 | version = "0.3.36" 2594 | source = "registry+https://github.com/rust-lang/crates.io-index" 2595 | checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" 2596 | dependencies = [ 2597 | "deranged", 2598 | "num-conv", 2599 | "powerfmt", 2600 | "serde", 2601 | "time-core", 2602 | ] 2603 | 2604 | [[package]] 2605 | name = "time-core" 2606 | version = "0.1.2" 2607 | source = "registry+https://github.com/rust-lang/crates.io-index" 2608 | checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" 2609 | 2610 | [[package]] 2611 | name = "tinyvec" 2612 | version = "1.8.0" 2613 | source = "registry+https://github.com/rust-lang/crates.io-index" 2614 | checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" 2615 | dependencies = [ 2616 | "tinyvec_macros", 2617 | ] 2618 | 2619 | [[package]] 2620 | name = "tinyvec_macros" 2621 | version = "0.1.1" 2622 | source = "registry+https://github.com/rust-lang/crates.io-index" 2623 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 2624 | 2625 | [[package]] 2626 | name = "tl-proto" 2627 | version = "0.4.7" 2628 | source = "registry+https://github.com/rust-lang/crates.io-index" 2629 | checksum = "6711faca0e884c1ac5b0b24e8eb878546019cc52a0db4e99bddab5fab8eb4a45" 2630 | dependencies = [ 2631 | "bytes", 2632 | "digest 0.10.7", 2633 | "sha2 0.10.8", 2634 | "smallvec", 2635 | "thiserror", 2636 | "tl-proto-proc", 2637 | ] 2638 | 2639 | [[package]] 2640 | name = "tl-proto-proc" 2641 | version = "0.4.7" 2642 | source = "registry+https://github.com/rust-lang/crates.io-index" 2643 | checksum = "140da3028e6bc0a46b168845e3f5252e906d0fbdcc6074f96424fe830c86b9ae" 2644 | dependencies = [ 2645 | "proc-macro2", 2646 | "quote", 2647 | "rustc-hash", 2648 | "syn 2.0.77", 2649 | "tl-scheme", 2650 | ] 2651 | 2652 | [[package]] 2653 | name = "tl-scheme" 2654 | version = "0.2.1" 2655 | source = "registry+https://github.com/rust-lang/crates.io-index" 2656 | checksum = "c495d2f03b113ab2ac9eab55168855ef43c04e0097b58f3eb1287a5da73e51b8" 2657 | dependencies = [ 2658 | "crc", 2659 | "pest", 2660 | "pest_derive", 2661 | "rustc-hash", 2662 | "thiserror", 2663 | ] 2664 | 2665 | [[package]] 2666 | name = "tokio" 2667 | version = "1.40.0" 2668 | source = "registry+https://github.com/rust-lang/crates.io-index" 2669 | checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" 2670 | dependencies = [ 2671 | "backtrace", 2672 | "bytes", 2673 | "libc", 2674 | "mio", 2675 | "parking_lot", 2676 | "pin-project-lite", 2677 | "signal-hook-registry", 2678 | "socket2 0.5.7", 2679 | "tokio-macros", 2680 | "windows-sys", 2681 | ] 2682 | 2683 | [[package]] 2684 | name = "tokio-macros" 2685 | version = "2.4.0" 2686 | source = "registry+https://github.com/rust-lang/crates.io-index" 2687 | checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" 2688 | dependencies = [ 2689 | "proc-macro2", 2690 | "quote", 2691 | "syn 2.0.77", 2692 | ] 2693 | 2694 | [[package]] 2695 | name = "tokio-metrics" 2696 | version = "0.3.1" 2697 | source = "registry+https://github.com/rust-lang/crates.io-index" 2698 | checksum = "eace09241d62c98b7eeb1107d4c5c64ca3bd7da92e8c218c153ab3a78f9be112" 2699 | dependencies = [ 2700 | "futures-util", 2701 | "pin-project-lite", 2702 | "tokio", 2703 | "tokio-stream", 2704 | ] 2705 | 2706 | [[package]] 2707 | name = "tokio-metrics-collector" 2708 | version = "0.2.2" 2709 | source = "registry+https://github.com/rust-lang/crates.io-index" 2710 | checksum = "db29b219a9b30347d896588baf5c85184b137aed52c37a80cab5ba68ee3a7c7e" 2711 | dependencies = [ 2712 | "lazy_static", 2713 | "parking_lot", 2714 | "prometheus", 2715 | "tokio", 2716 | "tokio-metrics", 2717 | ] 2718 | 2719 | [[package]] 2720 | name = "tokio-stream" 2721 | version = "0.1.16" 2722 | source = "registry+https://github.com/rust-lang/crates.io-index" 2723 | checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" 2724 | dependencies = [ 2725 | "futures-core", 2726 | "pin-project-lite", 2727 | "tokio", 2728 | ] 2729 | 2730 | [[package]] 2731 | name = "tokio-tower" 2732 | version = "0.6.0" 2733 | source = "registry+https://github.com/rust-lang/crates.io-index" 2734 | checksum = "f4322b6e2ebfd3be4082c16df4341505ef333683158b55f22afaf3f61565d728" 2735 | dependencies = [ 2736 | "crossbeam", 2737 | "futures-core", 2738 | "futures-sink", 2739 | "futures-util", 2740 | "pin-project", 2741 | "tokio", 2742 | "tower", 2743 | "tower-service", 2744 | "tracing", 2745 | ] 2746 | 2747 | [[package]] 2748 | name = "tokio-util" 2749 | version = "0.7.12" 2750 | source = "registry+https://github.com/rust-lang/crates.io-index" 2751 | checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" 2752 | dependencies = [ 2753 | "bytes", 2754 | "futures-core", 2755 | "futures-sink", 2756 | "pin-project-lite", 2757 | "tokio", 2758 | ] 2759 | 2760 | [[package]] 2761 | name = "ton-indexer" 2762 | version = "0.3.2" 2763 | source = "git+https://github.com/hacker-volodya/ton-indexer#4a623123eb2c6c59854afaa0e1cbe130f5efb462" 2764 | dependencies = [ 2765 | "ahash", 2766 | "anyhow", 2767 | "arc-swap", 2768 | "async-trait", 2769 | "base64 0.13.1", 2770 | "broxus-util", 2771 | "bumpalo", 2772 | "bytes", 2773 | "bytesize", 2774 | "countme", 2775 | "crc", 2776 | "dashmap", 2777 | "everscale-network", 2778 | "fdlimit", 2779 | "futures-util", 2780 | "global-config", 2781 | "hex", 2782 | "humantime", 2783 | "libc", 2784 | "metrics", 2785 | "num-traits", 2786 | "once_cell", 2787 | "parking_lot", 2788 | "quick_cache", 2789 | "rand", 2790 | "rlimit", 2791 | "serde", 2792 | "serde_json", 2793 | "sha2 0.10.8", 2794 | "smallvec", 2795 | "sysinfo", 2796 | "thiserror", 2797 | "tl-proto", 2798 | "tokio", 2799 | "tokio-util", 2800 | "ton_block", 2801 | "ton_types", 2802 | "tracing", 2803 | "weedb", 2804 | ] 2805 | 2806 | [[package]] 2807 | name = "ton-node" 2808 | version = "0.1.0" 2809 | dependencies = [ 2810 | "adnl", 2811 | "anyhow", 2812 | "argh", 2813 | "async-trait", 2814 | "axum", 2815 | "base64 0.22.1", 2816 | "broxus-util", 2817 | "fs_extra", 2818 | "futures-util", 2819 | "hex", 2820 | "metrics", 2821 | "metrics-exporter-prometheus", 2822 | "opentelemetry", 2823 | "opentelemetry-jaeger", 2824 | "prometheus", 2825 | "serde", 2826 | "serde_json", 2827 | "tokio", 2828 | "tokio-metrics-collector", 2829 | "ton-indexer", 2830 | "ton_block", 2831 | "ton_liteapi", 2832 | "ton_types", 2833 | "tonlib-sys", 2834 | "tower", 2835 | "tracing", 2836 | "tracing-opentelemetry", 2837 | "tracing-subscriber", 2838 | "ureq", 2839 | "x25519-dalek", 2840 | ] 2841 | 2842 | [[package]] 2843 | name = "ton_block" 2844 | version = "1.9.73" 2845 | source = "git+https://github.com/broxus/ton-labs-block.git#5c4e4f84cebaf34254fd97523d1fc83d7fbe2d91" 2846 | dependencies = [ 2847 | "anyhow", 2848 | "base64 0.13.1", 2849 | "crc", 2850 | "ed25519", 2851 | "ed25519-dalek", 2852 | "hex", 2853 | "log", 2854 | "num", 2855 | "num-traits", 2856 | "rand", 2857 | "rustc-hash", 2858 | "sha2 0.9.9", 2859 | "smallvec", 2860 | "thiserror", 2861 | "ton_types", 2862 | ] 2863 | 2864 | [[package]] 2865 | name = "ton_liteapi" 2866 | version = "0.2.0" 2867 | source = "registry+https://github.com/rust-lang/crates.io-index" 2868 | checksum = "ad8041476f7c8cfd56fb9f60b25b0a01e8ef6ffb8822ba2387f4a62152f79591" 2869 | dependencies = [ 2870 | "adnl", 2871 | "derivative", 2872 | "futures", 2873 | "hex", 2874 | "log", 2875 | "pin-project", 2876 | "rand", 2877 | "thiserror", 2878 | "tl-proto", 2879 | "tokio", 2880 | "tokio-tower", 2881 | "tokio-util", 2882 | "tower", 2883 | ] 2884 | 2885 | [[package]] 2886 | name = "ton_types" 2887 | version = "1.10.2" 2888 | source = "git+https://github.com/broxus/ton-labs-types.git#3324562d7ff1ebec66d996128573966c1b53862b" 2889 | dependencies = [ 2890 | "anyhow", 2891 | "base64 0.13.1", 2892 | "countme", 2893 | "crc", 2894 | "dashmap", 2895 | "hex", 2896 | "log", 2897 | "num", 2898 | "num-derive", 2899 | "num-traits", 2900 | "rand", 2901 | "rustc-hash", 2902 | "sha2 0.9.9", 2903 | "smallvec", 2904 | "thiserror", 2905 | ] 2906 | 2907 | [[package]] 2908 | name = "tonlib-sys" 2909 | version = "2024.8.0" 2910 | source = "registry+https://github.com/rust-lang/crates.io-index" 2911 | checksum = "0530d481d912e3f0a5f478a31e6eeea598d728b69cb6d201bc4473de1ffa4656" 2912 | dependencies = [ 2913 | "cmake", 2914 | ] 2915 | 2916 | [[package]] 2917 | name = "tower" 2918 | version = "0.4.13" 2919 | source = "registry+https://github.com/rust-lang/crates.io-index" 2920 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 2921 | dependencies = [ 2922 | "futures-core", 2923 | "futures-util", 2924 | "pin-project", 2925 | "pin-project-lite", 2926 | "tokio", 2927 | "tokio-util", 2928 | "tower-layer", 2929 | "tower-service", 2930 | "tracing", 2931 | ] 2932 | 2933 | [[package]] 2934 | name = "tower-layer" 2935 | version = "0.3.3" 2936 | source = "registry+https://github.com/rust-lang/crates.io-index" 2937 | checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" 2938 | 2939 | [[package]] 2940 | name = "tower-service" 2941 | version = "0.3.3" 2942 | source = "registry+https://github.com/rust-lang/crates.io-index" 2943 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 2944 | 2945 | [[package]] 2946 | name = "tracing" 2947 | version = "0.1.40" 2948 | source = "registry+https://github.com/rust-lang/crates.io-index" 2949 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 2950 | dependencies = [ 2951 | "log", 2952 | "pin-project-lite", 2953 | "tracing-attributes", 2954 | "tracing-core", 2955 | ] 2956 | 2957 | [[package]] 2958 | name = "tracing-attributes" 2959 | version = "0.1.27" 2960 | source = "registry+https://github.com/rust-lang/crates.io-index" 2961 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 2962 | dependencies = [ 2963 | "proc-macro2", 2964 | "quote", 2965 | "syn 2.0.77", 2966 | ] 2967 | 2968 | [[package]] 2969 | name = "tracing-core" 2970 | version = "0.1.32" 2971 | source = "registry+https://github.com/rust-lang/crates.io-index" 2972 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 2973 | dependencies = [ 2974 | "once_cell", 2975 | "valuable", 2976 | ] 2977 | 2978 | [[package]] 2979 | name = "tracing-futures" 2980 | version = "0.2.5" 2981 | source = "registry+https://github.com/rust-lang/crates.io-index" 2982 | checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" 2983 | dependencies = [ 2984 | "futures", 2985 | "futures-task", 2986 | "pin-project", 2987 | "tracing", 2988 | ] 2989 | 2990 | [[package]] 2991 | name = "tracing-log" 2992 | version = "0.1.4" 2993 | source = "registry+https://github.com/rust-lang/crates.io-index" 2994 | checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" 2995 | dependencies = [ 2996 | "log", 2997 | "once_cell", 2998 | "tracing-core", 2999 | ] 3000 | 3001 | [[package]] 3002 | name = "tracing-log" 3003 | version = "0.2.0" 3004 | source = "registry+https://github.com/rust-lang/crates.io-index" 3005 | checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" 3006 | dependencies = [ 3007 | "log", 3008 | "once_cell", 3009 | "tracing-core", 3010 | ] 3011 | 3012 | [[package]] 3013 | name = "tracing-opentelemetry" 3014 | version = "0.16.0" 3015 | source = "registry+https://github.com/rust-lang/crates.io-index" 3016 | checksum = "3ffbf13a0f8b054a4e59df3a173b818e9c6177c02789871f2073977fd0062076" 3017 | dependencies = [ 3018 | "opentelemetry", 3019 | "tracing", 3020 | "tracing-core", 3021 | "tracing-log 0.1.4", 3022 | "tracing-subscriber", 3023 | ] 3024 | 3025 | [[package]] 3026 | name = "tracing-subscriber" 3027 | version = "0.3.18" 3028 | source = "registry+https://github.com/rust-lang/crates.io-index" 3029 | checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 3030 | dependencies = [ 3031 | "matchers", 3032 | "nu-ansi-term", 3033 | "once_cell", 3034 | "regex", 3035 | "sharded-slab", 3036 | "smallvec", 3037 | "thread_local", 3038 | "tracing", 3039 | "tracing-core", 3040 | "tracing-log 0.2.0", 3041 | ] 3042 | 3043 | [[package]] 3044 | name = "trust-dns-client" 3045 | version = "0.20.4" 3046 | source = "registry+https://github.com/rust-lang/crates.io-index" 3047 | checksum = "5b4ef9b9bde0559b78a4abb00339143750085f05e5a453efb7b8bef1061f09dc" 3048 | dependencies = [ 3049 | "cfg-if", 3050 | "data-encoding", 3051 | "futures-channel", 3052 | "futures-util", 3053 | "lazy_static", 3054 | "log", 3055 | "radix_trie", 3056 | "rand", 3057 | "thiserror", 3058 | "time", 3059 | "tokio", 3060 | "trust-dns-proto", 3061 | ] 3062 | 3063 | [[package]] 3064 | name = "trust-dns-proto" 3065 | version = "0.20.4" 3066 | source = "registry+https://github.com/rust-lang/crates.io-index" 3067 | checksum = "ca94d4e9feb6a181c690c4040d7a24ef34018d8313ac5044a61d21222ae24e31" 3068 | dependencies = [ 3069 | "async-trait", 3070 | "cfg-if", 3071 | "data-encoding", 3072 | "enum-as-inner", 3073 | "futures-channel", 3074 | "futures-io", 3075 | "futures-util", 3076 | "idna 0.2.3", 3077 | "ipnet", 3078 | "lazy_static", 3079 | "log", 3080 | "rand", 3081 | "smallvec", 3082 | "thiserror", 3083 | "tinyvec", 3084 | "tokio", 3085 | "url", 3086 | ] 3087 | 3088 | [[package]] 3089 | name = "try-lock" 3090 | version = "0.2.5" 3091 | source = "registry+https://github.com/rust-lang/crates.io-index" 3092 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 3093 | 3094 | [[package]] 3095 | name = "typemap-ors" 3096 | version = "1.0.0" 3097 | source = "registry+https://github.com/rust-lang/crates.io-index" 3098 | checksum = "a68c24b707f02dd18f1e4ccceb9d49f2058c2fb86384ef9972592904d7a28867" 3099 | dependencies = [ 3100 | "unsafe-any-ors", 3101 | ] 3102 | 3103 | [[package]] 3104 | name = "typenum" 3105 | version = "1.17.0" 3106 | source = "registry+https://github.com/rust-lang/crates.io-index" 3107 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 3108 | 3109 | [[package]] 3110 | name = "ucd-trie" 3111 | version = "0.1.6" 3112 | source = "registry+https://github.com/rust-lang/crates.io-index" 3113 | checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" 3114 | 3115 | [[package]] 3116 | name = "unicode-bidi" 3117 | version = "0.3.15" 3118 | source = "registry+https://github.com/rust-lang/crates.io-index" 3119 | checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" 3120 | 3121 | [[package]] 3122 | name = "unicode-ident" 3123 | version = "1.0.12" 3124 | source = "registry+https://github.com/rust-lang/crates.io-index" 3125 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 3126 | 3127 | [[package]] 3128 | name = "unicode-normalization" 3129 | version = "0.1.23" 3130 | source = "registry+https://github.com/rust-lang/crates.io-index" 3131 | checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" 3132 | dependencies = [ 3133 | "tinyvec", 3134 | ] 3135 | 3136 | [[package]] 3137 | name = "unsafe-any-ors" 3138 | version = "1.0.0" 3139 | source = "registry+https://github.com/rust-lang/crates.io-index" 3140 | checksum = "e0a303d30665362d9680d7d91d78b23f5f899504d4f08b3c4cf08d055d87c0ad" 3141 | dependencies = [ 3142 | "destructure_traitobject", 3143 | ] 3144 | 3145 | [[package]] 3146 | name = "unsafe-libyaml" 3147 | version = "0.2.11" 3148 | source = "registry+https://github.com/rust-lang/crates.io-index" 3149 | checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" 3150 | 3151 | [[package]] 3152 | name = "untrusted" 3153 | version = "0.9.0" 3154 | source = "registry+https://github.com/rust-lang/crates.io-index" 3155 | checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 3156 | 3157 | [[package]] 3158 | name = "ureq" 3159 | version = "2.10.1" 3160 | source = "registry+https://github.com/rust-lang/crates.io-index" 3161 | checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" 3162 | dependencies = [ 3163 | "base64 0.22.1", 3164 | "flate2", 3165 | "log", 3166 | "once_cell", 3167 | "rustls", 3168 | "rustls-pki-types", 3169 | "url", 3170 | "webpki-roots", 3171 | ] 3172 | 3173 | [[package]] 3174 | name = "url" 3175 | version = "2.5.2" 3176 | source = "registry+https://github.com/rust-lang/crates.io-index" 3177 | checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" 3178 | dependencies = [ 3179 | "form_urlencoded", 3180 | "idna 0.5.0", 3181 | "percent-encoding", 3182 | "serde", 3183 | ] 3184 | 3185 | [[package]] 3186 | name = "valuable" 3187 | version = "0.1.0" 3188 | source = "registry+https://github.com/rust-lang/crates.io-index" 3189 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 3190 | 3191 | [[package]] 3192 | name = "vcpkg" 3193 | version = "0.2.15" 3194 | source = "registry+https://github.com/rust-lang/crates.io-index" 3195 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 3196 | 3197 | [[package]] 3198 | name = "version_check" 3199 | version = "0.9.5" 3200 | source = "registry+https://github.com/rust-lang/crates.io-index" 3201 | checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" 3202 | 3203 | [[package]] 3204 | name = "want" 3205 | version = "0.3.1" 3206 | source = "registry+https://github.com/rust-lang/crates.io-index" 3207 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 3208 | dependencies = [ 3209 | "try-lock", 3210 | ] 3211 | 3212 | [[package]] 3213 | name = "wasi" 3214 | version = "0.11.0+wasi-snapshot-preview1" 3215 | source = "registry+https://github.com/rust-lang/crates.io-index" 3216 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 3217 | 3218 | [[package]] 3219 | name = "wasm-bindgen" 3220 | version = "0.2.93" 3221 | source = "registry+https://github.com/rust-lang/crates.io-index" 3222 | checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" 3223 | dependencies = [ 3224 | "cfg-if", 3225 | "once_cell", 3226 | "wasm-bindgen-macro", 3227 | ] 3228 | 3229 | [[package]] 3230 | name = "wasm-bindgen-backend" 3231 | version = "0.2.93" 3232 | source = "registry+https://github.com/rust-lang/crates.io-index" 3233 | checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" 3234 | dependencies = [ 3235 | "bumpalo", 3236 | "log", 3237 | "once_cell", 3238 | "proc-macro2", 3239 | "quote", 3240 | "syn 2.0.77", 3241 | "wasm-bindgen-shared", 3242 | ] 3243 | 3244 | [[package]] 3245 | name = "wasm-bindgen-macro" 3246 | version = "0.2.93" 3247 | source = "registry+https://github.com/rust-lang/crates.io-index" 3248 | checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" 3249 | dependencies = [ 3250 | "quote", 3251 | "wasm-bindgen-macro-support", 3252 | ] 3253 | 3254 | [[package]] 3255 | name = "wasm-bindgen-macro-support" 3256 | version = "0.2.93" 3257 | source = "registry+https://github.com/rust-lang/crates.io-index" 3258 | checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" 3259 | dependencies = [ 3260 | "proc-macro2", 3261 | "quote", 3262 | "syn 2.0.77", 3263 | "wasm-bindgen-backend", 3264 | "wasm-bindgen-shared", 3265 | ] 3266 | 3267 | [[package]] 3268 | name = "wasm-bindgen-shared" 3269 | version = "0.2.93" 3270 | source = "registry+https://github.com/rust-lang/crates.io-index" 3271 | checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" 3272 | 3273 | [[package]] 3274 | name = "web-sys" 3275 | version = "0.3.70" 3276 | source = "registry+https://github.com/rust-lang/crates.io-index" 3277 | checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" 3278 | dependencies = [ 3279 | "js-sys", 3280 | "wasm-bindgen", 3281 | ] 3282 | 3283 | [[package]] 3284 | name = "webpki-roots" 3285 | version = "0.26.5" 3286 | source = "registry+https://github.com/rust-lang/crates.io-index" 3287 | checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" 3288 | dependencies = [ 3289 | "rustls-pki-types", 3290 | ] 3291 | 3292 | [[package]] 3293 | name = "weedb" 3294 | version = "0.1.1" 3295 | source = "registry+https://github.com/rust-lang/crates.io-index" 3296 | checksum = "de8f9c5dfe31e92c6374e25086363a0dccf15cf9b0923ea8a4a2a105d662428e" 3297 | dependencies = [ 3298 | "librocksdb-sys", 3299 | "rocksdb", 3300 | "thiserror", 3301 | "tracing", 3302 | ] 3303 | 3304 | [[package]] 3305 | name = "winapi" 3306 | version = "0.3.9" 3307 | source = "registry+https://github.com/rust-lang/crates.io-index" 3308 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 3309 | dependencies = [ 3310 | "winapi-i686-pc-windows-gnu", 3311 | "winapi-x86_64-pc-windows-gnu", 3312 | ] 3313 | 3314 | [[package]] 3315 | name = "winapi-i686-pc-windows-gnu" 3316 | version = "0.4.0" 3317 | source = "registry+https://github.com/rust-lang/crates.io-index" 3318 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 3319 | 3320 | [[package]] 3321 | name = "winapi-x86_64-pc-windows-gnu" 3322 | version = "0.4.0" 3323 | source = "registry+https://github.com/rust-lang/crates.io-index" 3324 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 3325 | 3326 | [[package]] 3327 | name = "windows-core" 3328 | version = "0.52.0" 3329 | source = "registry+https://github.com/rust-lang/crates.io-index" 3330 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 3331 | dependencies = [ 3332 | "windows-targets", 3333 | ] 3334 | 3335 | [[package]] 3336 | name = "windows-sys" 3337 | version = "0.52.0" 3338 | source = "registry+https://github.com/rust-lang/crates.io-index" 3339 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 3340 | dependencies = [ 3341 | "windows-targets", 3342 | ] 3343 | 3344 | [[package]] 3345 | name = "windows-targets" 3346 | version = "0.52.6" 3347 | source = "registry+https://github.com/rust-lang/crates.io-index" 3348 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 3349 | dependencies = [ 3350 | "windows_aarch64_gnullvm", 3351 | "windows_aarch64_msvc", 3352 | "windows_i686_gnu", 3353 | "windows_i686_gnullvm", 3354 | "windows_i686_msvc", 3355 | "windows_x86_64_gnu", 3356 | "windows_x86_64_gnullvm", 3357 | "windows_x86_64_msvc", 3358 | ] 3359 | 3360 | [[package]] 3361 | name = "windows_aarch64_gnullvm" 3362 | version = "0.52.6" 3363 | source = "registry+https://github.com/rust-lang/crates.io-index" 3364 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 3365 | 3366 | [[package]] 3367 | name = "windows_aarch64_msvc" 3368 | version = "0.52.6" 3369 | source = "registry+https://github.com/rust-lang/crates.io-index" 3370 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 3371 | 3372 | [[package]] 3373 | name = "windows_i686_gnu" 3374 | version = "0.52.6" 3375 | source = "registry+https://github.com/rust-lang/crates.io-index" 3376 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 3377 | 3378 | [[package]] 3379 | name = "windows_i686_gnullvm" 3380 | version = "0.52.6" 3381 | source = "registry+https://github.com/rust-lang/crates.io-index" 3382 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 3383 | 3384 | [[package]] 3385 | name = "windows_i686_msvc" 3386 | version = "0.52.6" 3387 | source = "registry+https://github.com/rust-lang/crates.io-index" 3388 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 3389 | 3390 | [[package]] 3391 | name = "windows_x86_64_gnu" 3392 | version = "0.52.6" 3393 | source = "registry+https://github.com/rust-lang/crates.io-index" 3394 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 3395 | 3396 | [[package]] 3397 | name = "windows_x86_64_gnullvm" 3398 | version = "0.52.6" 3399 | source = "registry+https://github.com/rust-lang/crates.io-index" 3400 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 3401 | 3402 | [[package]] 3403 | name = "windows_x86_64_msvc" 3404 | version = "0.52.6" 3405 | source = "registry+https://github.com/rust-lang/crates.io-index" 3406 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 3407 | 3408 | [[package]] 3409 | name = "x25519-dalek" 3410 | version = "2.0.1" 3411 | source = "registry+https://github.com/rust-lang/crates.io-index" 3412 | checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" 3413 | dependencies = [ 3414 | "curve25519-dalek", 3415 | "rand_core", 3416 | "serde", 3417 | "zeroize", 3418 | ] 3419 | 3420 | [[package]] 3421 | name = "yaml-rust" 3422 | version = "0.4.5" 3423 | source = "registry+https://github.com/rust-lang/crates.io-index" 3424 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 3425 | dependencies = [ 3426 | "linked-hash-map", 3427 | ] 3428 | 3429 | [[package]] 3430 | name = "zerocopy" 3431 | version = "0.7.35" 3432 | source = "registry+https://github.com/rust-lang/crates.io-index" 3433 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 3434 | dependencies = [ 3435 | "byteorder", 3436 | "zerocopy-derive", 3437 | ] 3438 | 3439 | [[package]] 3440 | name = "zerocopy-derive" 3441 | version = "0.7.35" 3442 | source = "registry+https://github.com/rust-lang/crates.io-index" 3443 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 3444 | dependencies = [ 3445 | "proc-macro2", 3446 | "quote", 3447 | "syn 2.0.77", 3448 | ] 3449 | 3450 | [[package]] 3451 | name = "zeroize" 3452 | version = "1.8.1" 3453 | source = "registry+https://github.com/rust-lang/crates.io-index" 3454 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 3455 | dependencies = [ 3456 | "zeroize_derive", 3457 | ] 3458 | 3459 | [[package]] 3460 | name = "zeroize_derive" 3461 | version = "1.4.2" 3462 | source = "registry+https://github.com/rust-lang/crates.io-index" 3463 | checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" 3464 | dependencies = [ 3465 | "proc-macro2", 3466 | "quote", 3467 | "syn 2.0.77", 3468 | ] 3469 | 3470 | [[package]] 3471 | name = "zstd" 3472 | version = "0.12.4" 3473 | source = "registry+https://github.com/rust-lang/crates.io-index" 3474 | checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" 3475 | dependencies = [ 3476 | "zstd-safe", 3477 | ] 3478 | 3479 | [[package]] 3480 | name = "zstd-safe" 3481 | version = "6.0.6" 3482 | source = "registry+https://github.com/rust-lang/crates.io-index" 3483 | checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" 3484 | dependencies = [ 3485 | "libc", 3486 | "zstd-sys", 3487 | ] 3488 | 3489 | [[package]] 3490 | name = "zstd-sys" 3491 | version = "2.0.13+zstd.1.5.6" 3492 | source = "registry+https://github.com/rust-lang/crates.io-index" 3493 | checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" 3494 | dependencies = [ 3495 | "cc", 3496 | "pkg-config", 3497 | ] 3498 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "ton-node" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1.0" 8 | argh = "0.1" 9 | tracing-subscriber = { version = "0.3", features = ["env-filter"] } 10 | serde = { version = "1.0", features = ["derive"] } 11 | serde_json = "1.0" 12 | broxus-util = { version = "0.2", features = ["signal", "public-ip"] } 13 | ton-indexer = { git = "https://github.com/hacker-volodya/ton-indexer", features = ["ton"] } 14 | tokio = "1" 15 | async-trait = "0.1" 16 | tracing = "0.1" 17 | futures-util = "0.3" 18 | axum = "0.7.2" 19 | ton_block = { git = "https://github.com/broxus/ton-labs-block.git", features = ["ton"] } 20 | prometheus = { version = "0.13.3", features = ["process"] } 21 | ton_liteapi = "0.2.0" 22 | adnl = "2.0.0" 23 | ton_types = { git = "https://github.com/broxus/ton-labs-types.git" } 24 | tower = { version = "0.4.13" } 25 | hex = "0.4" 26 | x25519-dalek = { version = "2.0.1", features = ["static_secrets"] } 27 | metrics = "0.22.3" 28 | metrics-exporter-prometheus = { version = "0.14.0", default-features = false } 29 | tokio-metrics-collector = { version = "0.2.1", features = ["rt"] } 30 | ureq = "2.9.7" 31 | fs_extra = "1.3.0" 32 | tracing-opentelemetry = "0.16.0" 33 | opentelemetry-jaeger = "0.15.0" 34 | opentelemetry = "0.16" 35 | tonlib-sys = "2024.6" 36 | base64 = "0.22.1" -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:1.77.2-bookworm AS builder 2 | WORKDIR /app 3 | RUN apt update && apt install -y cmake libclang-dev clang build-essential libsodium-dev libsecp256k1-dev lz4 liblz4-dev libssl-dev zlib1g-dev libreadline-dev libssl3 4 | COPY . . 5 | RUN --mount=type=cache,target=/var/cache/buildkit \ 6 | CARGO_HOME=/var/cache/buildkit/cargo \ 7 | CARGO_TARGET_DIR=/var/cache/buildkit/target \ 8 | cargo build --release --locked && \ 9 | cp /var/cache/buildkit/target/release/ton-node / 10 | 11 | FROM debian:bookworm-slim AS runtime 12 | RUN apt update && apt install -y lz4 libssl3 libsodium-dev libsecp256k1-dev 13 | WORKDIR /app 14 | COPY --from=builder /ton-node /usr/local/bin 15 | VOLUME /data 16 | ENTRYPOINT ["/usr/local/bin/ton-node"] 17 | 18 | # http 19 | EXPOSE 3000/tcp 20 | 21 | # liteapi 22 | EXPOSE 3333/tcp 23 | 24 | # nodes p2p 25 | EXPOSE 30303/udp 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Vladimir Lebedev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TON Liteserver in Rust 2 | 3 | > :warning: **WARNING:** experimental software, not yet ready for production use 4 | 5 | ## Usage 6 | 7 | ### Docker CLI 8 | ```bash 9 | # use mainnet config 10 | docker run -d -it -P ghcr.io/hacker-volodya/liteserver 11 | 12 | # use testnet config 13 | docker run -d -it -P ghcr.io/hacker-volodya/liteserver --testnet 14 | 15 | # use custom config from url 16 | docker run -d -it -P ghcr.io/hacker-volodya/liteserver --global-config-url https://example.com/global.config.json 17 | 18 | # use local config 19 | docker run -d -it -P -v $PWD/global.config.json:/global.config.json ghcr.io/hacker-volodya/liteserver --global-config-path /global.config.json 20 | 21 | # specify custom node config (examples below) 22 | docker run -d -it -P -v $PWD/config.yml:/config.yml ghcr.io/hacker-volodya/liteserver --config /config.yml 23 | ``` 24 | 25 | ### Docker Compose 26 | ```yaml 27 | version: '2' 28 | services: 29 | liteserver: 30 | image: ghcr.io/hacker-volodya/liteserver 31 | ports: 32 | - 30303:30303/udp # nodes p2p (host port and container port must be equal, container port is specified in config.yml) 33 | - 3000:3000/tcp # web interface 34 | - 3333:3333/tcp # liteapi 35 | restart: always 36 | ``` 37 | 38 | ## Method support 39 | | Status | Method | Description | 40 | |--------|--------|-------------| 41 | | | **impemented** 42 | | ✅ | WaitMasterchainSeqno 43 | | ✅ | GetMasterchainInfo 44 | | ✅ | GetMasterchainInfoExt 45 | | ✅ | GetBlockHeader 46 | | ✅ | GetAllShardsInfo 47 | | ✅ | ListBlockTransactions 48 | | ✅ | GetBlock 49 | | ✅ | GetAccountState 50 | | ✅ | GetTransactions 51 | | ✅ | LookupBlock 52 | | ✅ | GetConfigAll 53 | | ✅ | GetMasterchainInfoExt 54 | | ✅ | GetConfigParams 55 | | ✅ | GetBlockProof 56 | | ✅ | SendMessage 57 | | ✅ | RunSmcMethod | no proofs 58 | | ✅ | GetLibraries 59 | | | **high priority** (toncenter) 60 | | ⚠️ | GetShardBlockProof | block proof research in progress 61 | | | **medium priority** 62 | | 🔜 | GetOneTransaction 63 | | 🔜 | GetShardInfo 64 | | 🔜 | GetAccountStatePrunned 65 | | 🔜 | ListBlockTransactionsExt 66 | | 🔜 | GetLibrariesWithProof 67 | | ⚠️ | LookupBlockWithProof | block proof research in progress 68 | | | **low priority** 69 | | 🔜 | GetTime 70 | | 🔜 | GetVersion 71 | | 🔜 | GetValidatorStats 72 | | 🔜 | GetState 73 | | 🔜 | GetOutMsgQueueSizes 74 | | 🔜 | GetValidatorGroups 75 | | 🔜 | GetCandidate 76 | 77 | ## Node config example 78 | ```yaml 79 | indexer: 80 | ip_address: 0.0.0.0:30303 81 | rocks_db_path: /data/rocksdb 82 | file_db_path: /data/file 83 | state_gc_options: null 84 | blocks_gc_options: 85 | # - `before_previous_key_block` - on each new key block delete all blocks before the previous one 86 | # - `before_previous_persistent_state` - on each new key block delete all blocks before the previous key block with persistent state 87 | kind: before_previous_key_block 88 | enable_for_sync: true # Whether to enable blocks GC during sync. 89 | max_blocks_per_batch: 100000 # Max `WriteBatch` entries before apply 90 | shard_state_cache_options: 91 | ttl_sec: 120 # LRU cache item duration. 92 | db_options: 93 | rocksdb_lru_capacity: 1 GB 94 | cells_cache_size: 2 GB 95 | low_thread_pool_size: 8 96 | high_thread_pool_size: 8 97 | max_subcompactions: 8 98 | archive_options: 99 | gc_interval: 100 | # - `manual` - Do not perform archives GC 101 | # - `persistent_states` - Archives GC triggers on each persistent state 102 | type: persistent_states 103 | offset_sec: 300 # Remove archives after this interval after the new persistent state 104 | sync_options: 105 | old_blocks_policy: # Whether to sync very old blocks 106 | type: ignore 107 | # type: sync 108 | # from_seqno: 100 109 | parallel_archive_downloads: 16 110 | save_to_disk_threshold: 1073741824 111 | max_block_applier_depth: 32 112 | force_use_get_next_block: false # Ignore archives 113 | persistent_state_options: 114 | prepare_persistent_states: false 115 | persistent_state_parallelism: 1 116 | remove_old_states: true 117 | adnl_options: 118 | query_min_timeout_ms: 500 # Minimal ADNL query timeout. Will override the used timeout if it is less. 119 | query_default_timeout_ms: 5000 # Default ADNL query timeout. Will be used if no timeout is specified. 120 | transfer_timeout_sec: 3 # ADNL multipart transfer timeout. It will drop the transfer if it is not completed within this timeout. 121 | clock_tolerance_sec: 60 # Permissible time difference between remote and local clocks. 122 | channel_reset_timeout_sec: 30 # Drop channels which had no response for this amount of time. 123 | address_list_timeout_sec: 1000 # How much time address lists from packets should be valid. 124 | packet_history_enabled: false # Whether to add additional duplicated packets check. 125 | packet_signature_required: true # Whether handshake packets signature is mandatory. 126 | force_use_priority_channels: false # Whether to use priority channels for queries. 127 | use_loopback_for_neighbours: false # Whether to use loopback ip to communicate with nodes on the same ip 128 | version: null # ADNL protocol version 129 | rldp_options: 130 | max_answer_size: 10485760 # Max allowed RLDP answer size in bytes. Query will be rejected if answer is bigger. 131 | max_peer_queries: 16 # Max parallel RLDP queries per peer. 132 | query_min_timeout_ms: 500 # Min RLDP query timeout. 133 | query_max_timeout_ms: 10000 # Max RLDP query timeout 134 | query_wave_len: 10 # Number of FEC messages to send in group. There will be a short delay between them. 135 | query_wave_interval_ms: 10 # Interval between FEC broadcast waves. 136 | force_compression: false # Whether requests will be compressed. 137 | dht_options: 138 | value_ttl_sec: 3600 # Default stored value timeout used for [`Node::store_overlay_node`] and [`Node::store_address`] 139 | query_timeout_ms: 1000 # ADNL query timeout 140 | default_value_batch_len: 5 # Amount of DHT peers, used for values search 141 | bad_peer_threshold: 5 # Max peer penalty points. On each unsuccessful query every peer gains 2 points, and then they are reduced by one on each good action. 142 | max_allowed_k: 20 # Max allowed `k` value for DHT `FindValue` query. 143 | max_key_name_len: 127 # Max allowed key name length (in bytes). See [`everscale_network::proto::dht::Key`] 144 | max_key_index: 15 # Max allowed key index 145 | storage_gc_interval_ms: 10000 # Storage GC interval. Will remove all outdated entries 146 | overlay_shard_options: 147 | max_neighbours: 200 # More persistent list of peers. Used to distribute broadcasts. 148 | max_broadcast_log: 1000 # Max simultaneous broadcasts. 149 | broadcast_gc_interval_ms: 1000 # Broadcasts GC interval. Will leave at most `max_broadcast_log` each iteration. 150 | overlay_peers_timeout_ms: 60000 # Neighbours or random peers update interval. 151 | max_ordinary_broadcast_len: 768 # Packets with length bigger than this will be sent using FEC broadcast. 152 | broadcast_target_count: 5 # Max number of peers to distribute broadcast to. 153 | secondary_broadcast_target_count: 3 # Max number of peers to redistribute ordinary broadcast to. 154 | secondary_fec_broadcast_target_count: 3 # Max number of peers to redistribute FEC broadcast to. 155 | fec_broadcast_wave_len: 20 # Number of FEC messages to send in group. There will be a short delay between them. 156 | fec_broadcast_wave_interval_ms: 10 # Interval between FEC broadcast waves. 157 | broadcast_timeout_sec: 60 # Overlay broadcast timeout. It will be forcefully dropped if not received in this time. 158 | force_compression: false # Whether requests will be compressed. 159 | neighbours_options: 160 | max_neighbours: 16 161 | reloading_min_interval_sec: 10 162 | reloading_max_interval_sec: 30 163 | ping_interval_ms: 500 164 | search_interval_ms: 1000 165 | ping_min_timeout_ms: 10 166 | ping_max_timeout_ms: 1000 167 | default_rldp_roundtrip_ms: 2000 168 | max_ping_tasks: 6 169 | max_exchange_tasks: 6 170 | ``` 171 | -------------------------------------------------------------------------------- /src/liteserver.rs: -------------------------------------------------------------------------------- 1 | use std::{sync::Arc, task::Poll, time::Duration}; 2 | 3 | use adnl::crypto::{KeyPair, SecretKey}; 4 | use anyhow::{anyhow, Result}; 5 | use base64::Engine as _; 6 | use broxus_util::now; 7 | use futures_util::future::BoxFuture; 8 | use ton_block::{AccountIdPrefixFull, Block, CommonMsgInfo, ConfigParams, CryptoSignaturePair, Deserializable, GetRepresentationHash, HashmapAugType, InRefValue, McShardRecord, MerkleProof, Message, MsgAddrStd, Serializable, ShardIdent, ShardStateUnsplit, Transaction, TraverseNextStep, SHARD_FULL}; 9 | use ton_indexer::{utils::{BlockProofStuff, BlockProofStuffAug, ShardStateStuff}, Engine, GlobalConfig}; 10 | use ton_liteapi::{ 11 | layers::{UnwrapMessagesLayer, WrapErrorLayer}, 12 | server::serve, 13 | tl::{ 14 | common::{AccountId, BlockIdExt, BlockLink, Int256, LibraryEntry, Signature, SignatureSet, ZeroStateIdExt}, 15 | request::{ 16 | GetAccountState, GetAllShardsInfo, GetBlock, GetBlockHeader, GetBlockProof, GetConfigAll, GetConfigParams, GetLibraries, GetMasterchainInfoExt, GetTransactions, ListBlockTransactions, LookupBlock, LookupBlockWithProof, Request, RunSmcMethod, SendMessage, WaitMasterchainSeqno, WrappedRequest 17 | }, 18 | response::{AccountState, AllShardsInfo, BlockData, BlockHeader, BlockTransactions, ConfigInfo, LibraryResult, LookupBlockResult, MasterchainInfo, MasterchainInfoExt, PartialBlockProof, Response, RunMethodResult, SendMsgStatus, TransactionId, TransactionList}, 19 | }, 20 | types::LiteError, 21 | }; 22 | use ton_types::{deserialize_tree_of_cells, serialize_toc, BagOfCells, Cell, HashmapType, SliceData, UInt256, UsageTree}; 23 | use tower::{make::Shared, Service, ServiceBuilder}; 24 | use x25519_dalek::StaticSecret; 25 | 26 | use crate::{tvm::EmulatorBuilder, utils::HashmapAugIterator}; 27 | 28 | #[derive(Clone)] 29 | pub struct LiteServer { 30 | engine: Arc, 31 | config: GlobalConfig, 32 | } 33 | 34 | impl LiteServer { 35 | pub async fn get_masterchain_info(&self) -> Result { 36 | let last = self.engine.load_shards_client_mc_block_id()?; 37 | let root_hash = self.engine.load_state(&last).await?.root_cell().repr_hash(); 38 | Ok(MasterchainInfo { 39 | last: last.as_liteapi(), 40 | state_root_hash: Int256(root_hash.into()), 41 | init: ZeroStateIdExt { 42 | workchain: self.config.zero_state.shard_id.workchain_id(), 43 | root_hash: Int256(self.config.zero_state.root_hash.into()), 44 | file_hash: Int256(self.config.zero_state.file_hash.into()), 45 | }, 46 | }) 47 | } 48 | 49 | pub async fn get_masterchain_info_ext(&self, req: GetMasterchainInfoExt) -> Result { 50 | if req.mode != 0 { 51 | return Err(anyhow!("Unsupported mode")); 52 | } 53 | let last = self.engine.load_shards_client_mc_block_id()?; 54 | let state = self.engine.load_state(&last).await?; 55 | let root_hash = state.root_cell().repr_hash(); 56 | Ok(MasterchainInfoExt { 57 | last: last.as_liteapi(), 58 | state_root_hash: Int256(root_hash.into()), 59 | init: ZeroStateIdExt { 60 | workchain: self.config.zero_state.shard_id.workchain_id(), 61 | root_hash: Int256(self.config.zero_state.root_hash.into()), 62 | file_hash: Int256(self.config.zero_state.file_hash.into()), 63 | }, 64 | mode: (), 65 | version: 0x101, 66 | capabilities: 7, 67 | last_utime: state.state().gen_time(), 68 | now: now(), 69 | }) 70 | } 71 | 72 | fn make_block_proof( 73 | block_root: Cell, 74 | with_state_update: bool, 75 | with_value_flow: bool, 76 | with_extra: bool, 77 | with_shard_hashes: bool, 78 | with_config: bool, 79 | config_params: Option<&[i32]> 80 | ) -> Result { 81 | let usage_tree = UsageTree::with_root(block_root.clone()); 82 | let block = Block::construct_from_cell(usage_tree.root_cell())?; 83 | 84 | // add data to proof 85 | let info = block.read_info()?; 86 | let _prev_ref = info.read_prev_ref()?; 87 | let _prev_vert_ref = info.read_prev_vert_ref()?; 88 | let _master_ref = info.read_master_ref()?; 89 | if with_state_update { 90 | let _state_update = block.read_state_update()?; 91 | } 92 | if with_value_flow { 93 | block.read_value_flow()?.read_in_full_depth()?; 94 | } 95 | if with_extra { 96 | let mc_block_extra = block.read_extra()?.read_custom()?; 97 | if let Some(extra) = mc_block_extra { 98 | if with_shard_hashes { 99 | extra.shards().root().ok_or(anyhow!("no shard hashes"))?.preload_with_depth_hint::<128>()?; 100 | } 101 | if with_config { 102 | Self::touch_config(extra.config().ok_or(anyhow!("no config"))?, config_params)?; 103 | } 104 | } 105 | } 106 | MerkleProof::create_by_usage_tree(&block_root, usage_tree) 107 | } 108 | 109 | async fn load_block(&self, block_id: &BlockIdExt) -> Result> { 110 | self.load_block_by_tonlabs_id(&block_id.as_tonlabs()?).await 111 | } 112 | 113 | async fn load_block_by_tonlabs_id(&self, tonlabs_block_id: &ton_block::BlockIdExt) -> Result> { 114 | let block_handle_storage = self.engine.storage().block_handle_storage(); 115 | let block_storage = self.engine.storage().block_storage(); 116 | if let Some(handle) = block_handle_storage.load_handle(&tonlabs_block_id)? { 117 | if handle.meta().has_data() { 118 | let block = block_storage.load_block_data_raw_ref(&handle).await?; 119 | let block_root = ton_types::deserialize_tree_of_cells(&mut block.as_ref())?; 120 | return Ok(Some(block_root)) 121 | } 122 | } 123 | Ok(None) 124 | } 125 | 126 | async fn load_block_proof(&self, block_id: &ton_block::BlockIdExt) -> Result { 127 | let block_handle_storage = self.engine.storage().block_handle_storage(); 128 | let block_storage = self.engine.storage().block_storage(); 129 | if let Some(handle) = block_handle_storage.load_handle(&block_id)? { 130 | if handle.meta().has_proof() { 131 | return Ok(block_storage.load_block_proof(&handle, false).await?); 132 | } 133 | } 134 | Err(anyhow!("no such proof in db")) 135 | } 136 | 137 | async fn load_state(&self, block_id: &BlockIdExt) -> Result> { 138 | self.load_state_by_tonlabs_id(&block_id.as_tonlabs()?).await 139 | } 140 | 141 | async fn load_state_by_tonlabs_id(&self, block_id: &ton_block::BlockIdExt) -> Result> { 142 | self.engine.load_state(block_id).await 143 | } 144 | 145 | pub async fn get_block(&self, request: GetBlock) -> Result { 146 | let block = self.load_block(&request.id).await?.ok_or(anyhow!("no such block in db"))?; 147 | Ok(BlockData { id: request.id, data: serialize_toc(&block)? }) 148 | } 149 | 150 | pub async fn get_block_header(&self, request: GetBlockHeader) -> Result { 151 | let block_root = self.load_block(&request.id).await?.ok_or(anyhow!("no such block in db"))?; 152 | let merkle_proof = Self::make_block_proof( 153 | block_root, 154 | request.with_state_update.is_some(), 155 | request.with_value_flow.is_some(), 156 | request.with_extra.is_some(), 157 | false, 158 | false, 159 | None, 160 | )?; 161 | 162 | Ok(BlockHeader { 163 | id: request.id, 164 | mode: (), 165 | header_proof: merkle_proof.write_to_bytes()?, 166 | with_state_update: request.with_state_update, 167 | with_value_flow: request.with_value_flow, 168 | with_extra: request.with_extra, 169 | with_shard_hashes: request.with_shard_hashes, 170 | with_prev_blk_signatures: request.with_prev_blk_signatures, 171 | }) 172 | } 173 | 174 | fn get_shard_with_proof(mc_state: Cell, for_account: &AccountIdPrefixFull) -> Result<(McShardRecord, MerkleProof)> { 175 | let usage_tree = UsageTree::with_root(mc_state.clone()); 176 | let state = ShardStateUnsplit::construct_from_cell(usage_tree.root_cell())?; 177 | let extra = state 178 | .read_custom()? 179 | .ok_or_else(|| anyhow!("block must contain McStateExtra"))?; 180 | let shard = extra.shards().find_shard_by_prefix(for_account)?.ok_or(anyhow!("no such shard"))?; 181 | let proof = MerkleProof::create_by_usage_tree(&mc_state, usage_tree)?; 182 | Ok((shard, proof)) 183 | } 184 | 185 | pub async fn get_all_shards_info(&self, request: GetAllShardsInfo) -> Result { 186 | let block_root = self.load_block(&request.id).await?.ok_or(anyhow!("no such block in db"))?; 187 | let block = Block::construct_from_cell(block_root.clone())?; 188 | let custom = block.read_extra()?.read_custom()?.ok_or(anyhow!("no custom in mc block"))?; 189 | let shards = custom.shards(); 190 | 191 | Ok(AllShardsInfo { 192 | id: request.id, 193 | proof: Self::make_block_proof(block_root, false, false, true, true, false, None)?.write_to_bytes()?, 194 | data: shards.write_to_bytes()?, 195 | }) 196 | } 197 | 198 | pub async fn list_block_transactions( 199 | &self, 200 | req: ListBlockTransactions, 201 | ) -> Result { 202 | let block_root = self.load_block(&req.id).await?.ok_or(anyhow!("no such block in db"))?; 203 | let usage_tree = UsageTree::with_root(block_root.clone()); 204 | let block = Block::construct_from_cell(usage_tree.root_cell())?; 205 | let account_blocks = block.read_extra()?.read_account_blocks()?; 206 | let reverse = req.reverse_order.is_some(); 207 | let after = req.after.as_ref().map(|txid| (UInt256::from_slice(&txid.account.0), txid.lt as u64)); 208 | 209 | let mut ids = Vec::new(); 210 | 211 | let mut add_tx = |_, InRefValue::(tx)| { 212 | ids.push(TransactionId { 213 | mode: (), 214 | account: Some(Int256(tx.account_addr.to_owned().get_next_bytes(32)?.try_into().unwrap())), 215 | lt: Some(tx.lt), 216 | hash: Some(Int256(*tx.hash()?.as_array())), 217 | metadata: None, 218 | }); 219 | let should_continue = ids.len() < req.count as usize; 220 | Ok(should_continue) 221 | }; 222 | 223 | let mut is_complete = true; 224 | if let Some((after_account, after_lt)) = after { 225 | if let Some(account) = account_blocks.get(&after_account)? { 226 | is_complete = account.transactions().iterate_ext(reverse, Some(after_lt), &mut add_tx)?; 227 | } 228 | } 229 | if is_complete { 230 | is_complete = account_blocks.iterate_ext(reverse, after.map(|x| x.0), |_, account_block| { 231 | let is_complete = account_block.transactions().iterate_ext(reverse, None, &mut add_tx)?; 232 | Ok(is_complete) 233 | })?; 234 | } 235 | 236 | Ok(BlockTransactions { 237 | id: req.id, 238 | req_count: req.count, 239 | incomplete: !is_complete, 240 | ids, 241 | proof: if req.want_proof.is_some() { 242 | MerkleProof::create_by_usage_tree(&block_root, usage_tree)?.serialize()?.write_to_bytes()? 243 | } else { 244 | Vec::new() 245 | }, 246 | }) 247 | } 248 | 249 | async fn get_block_for_account(&self, account: &AccountId, reference_block: &ton_block::BlockIdExt) -> Result { 250 | if !reference_block.shard().is_masterchain() || account.workchain == -1 { 251 | return Ok(reference_block.clone()) 252 | } 253 | let mc_block_root = self.load_block_by_tonlabs_id(&reference_block).await?.ok_or(anyhow!("no such block in db"))?; 254 | let mc_block = Block::construct_from_cell(mc_block_root)?; 255 | let mc_shard_record = mc_block 256 | .read_extra()? 257 | .read_custom()?.ok_or(anyhow!("bug: mc block must contain McBlockExtra"))? 258 | .hashes().find_shard_by_prefix(&account.prefix_full()?)?.ok_or(anyhow!("no such shard"))?; 259 | let shard_block = mc_shard_record.blk_id(); 260 | Ok(shard_block.clone()) 261 | } 262 | 263 | async fn get_block_for_account_with_proof(&self, account: &AccountId, reference_block: &ton_block::BlockIdExt) -> Result<(ton_block::BlockIdExt, Option)> { 264 | if !reference_block.shard().is_masterchain() || account.workchain == -1 { 265 | return Ok((reference_block.clone(), None)) 266 | } 267 | let mc_state = self.load_state_by_tonlabs_id(&reference_block).await?; 268 | let (shard, proof) = Self::get_shard_with_proof(mc_state.root_cell().clone(), &account.prefix_full()?)?; 269 | Ok((shard.block_id, Some(proof))) 270 | } 271 | 272 | pub async fn get_account_state(&self, req: GetAccountState) -> Result { 273 | let reference_id = if req.id.seqno != 0xffff_ffff { 274 | req.id.as_tonlabs()? 275 | } else { 276 | self.engine.load_shards_client_mc_block_id()? 277 | }; 278 | let (shard_id, shard_proof_) = self.get_block_for_account_with_proof(&req.account, &reference_id).await?; 279 | let shard_block = self.load_block_by_tonlabs_id(&shard_id).await?.ok_or(anyhow!("no such block in db"))?; 280 | let state_stuff = self.engine.load_state(&shard_id).await?; 281 | let usage_tree_p2 = UsageTree::with_root(state_stuff.root_cell().clone()); 282 | let state = ShardStateUnsplit::construct_from_cell(usage_tree_p2.root_cell())?; 283 | let account = state 284 | .read_accounts()? 285 | .account(&req.account.id())? 286 | .ok_or(anyhow!("no such account"))?; 287 | let proof1 = Self::make_block_proof(shard_block, true, false, false, false, false, None)?; 288 | let proof2 = MerkleProof::create_by_usage_tree(state_stuff.root_cell(), usage_tree_p2)?; 289 | let mut proof = Vec::new(); 290 | BagOfCells::with_roots(&[proof1.serialize()?, proof2.serialize()?]).write_to(&mut proof, false)?; 291 | let mut shard_proof = Vec::new(); 292 | if let Some(proof4) = shard_proof_ { 293 | let mc_block = self.load_block_by_tonlabs_id(&reference_id).await?.ok_or(anyhow!("no such block in db"))?; 294 | let proof3 = Self::make_block_proof(mc_block, true, false, false, false, false, None)?; 295 | BagOfCells::with_roots(&[proof3.serialize()?, proof4.serialize()?]).write_to(&mut shard_proof, false)?; 296 | } 297 | Ok(AccountState { id: reference_id.as_liteapi(), shardblk: shard_id.as_liteapi(), shard_proof, proof, state: serialize_toc(&account.account_cell())? }) 298 | } 299 | 300 | async fn search_mc_block_by_lt(&self, ltime: u64) -> Result> { 301 | let last = self.engine.load_last_applied_mc_block_id()?; 302 | let mc_state = self.engine.load_state(&last).await?; 303 | let extra = mc_state.shard_state_extra()?; 304 | let result = extra.prev_blocks.traverse(|_, _, aug, value_opt| { 305 | if aug.max_end_lt < ltime { 306 | return Ok(TraverseNextStep::Stop) 307 | } 308 | if let Some(block_id) = value_opt { 309 | println!("found {block_id:?}"); 310 | return Ok(TraverseNextStep::End(block_id)) 311 | } 312 | Ok(TraverseNextStep::VisitZeroOne) 313 | })?; 314 | Ok(result.map(|id| id.master_block_id().1)) 315 | } 316 | 317 | async fn search_mc_block_by_seqno(&self, seqno: u32) -> Result> { 318 | let last = self.engine.load_last_applied_mc_block_id()?; 319 | if seqno == last.seq_no { 320 | return Ok(Some(last)) 321 | } 322 | let mc_state = self.engine.load_state(&last).await?; 323 | let extra = mc_state.shard_state_extra()?; 324 | let result = extra.prev_blocks.get(&seqno)?; 325 | Ok(result.map(|id| id.master_block_id().1)) 326 | } 327 | 328 | #[tracing::instrument(skip(self), level = "debug", err)] 329 | async fn search_shard_block_by_lt(&self, prefix: &AccountIdPrefixFull, ltime: u64) -> Result>> { 330 | let full_shard = prefix.shard_ident()?; 331 | let raw_prefix = full_shard.shard_prefix_with_tag(); 332 | // iterate through all possible shard prefixes (max_split = 4 for TON) 333 | for prefix_len in 0..5 { 334 | let shard = ShardIdent::with_prefix_len(prefix_len, prefix.workchain_id(), raw_prefix)?; 335 | if let Some(block) = self.engine.storage().block_storage().search_block_by_lt(&shard, ltime)? { 336 | return Ok(Some(block)) 337 | } 338 | } 339 | Ok(None) 340 | } 341 | 342 | #[tracing::instrument(skip(self), level = "debug", err)] 343 | async fn search_transactions(&self, account: &AccountId, mut lt: u64, count: Option) -> Result<(Vec, Vec)> { 344 | let mut transactions = Vec::new(); 345 | let mut block_ids = Vec::new(); 346 | while let Some(block_raw) = self.search_shard_block_by_lt(&account.prefix_full()?, lt).await? { 347 | let block_root = ton_types::deserialize_tree_of_cells(&mut block_raw.as_slice())?; 348 | let block = Block::construct_from_cell(block_root.clone())?; 349 | let block_info = block.read_info()?; 350 | let block_id = BlockIdExt { 351 | workchain: block_info.shard().workchain_id(), 352 | shard: block_info.shard().shard_prefix_with_tag(), 353 | seqno: block_info.seq_no(), 354 | root_hash: Int256(*block_root.repr_hash().as_array()), 355 | file_hash: Int256(*UInt256::calc_file_hash(&block_raw).as_array()), 356 | }; 357 | if let Some(account_block) = block.read_extra()?.read_account_blocks()?.get(&account.raw_id())? { 358 | let complete = account_block.transactions().iterate_ext(true, None, |_, InRefValue(tx)| { 359 | if tx.lt != lt { 360 | return Ok(true) 361 | } 362 | lt = tx.prev_trans_lt; 363 | block_ids.push(block_id.clone()); 364 | transactions.push(tx); 365 | Ok(if let Some(count) = count { transactions.len() < count } else { true }) 366 | })?; 367 | if !complete { 368 | break 369 | } 370 | } else { 371 | break 372 | } 373 | } 374 | Ok((block_ids, transactions)) 375 | } 376 | 377 | pub async fn get_transactions(&self, req: GetTransactions) -> Result { 378 | let (ids, transactions) = self.search_transactions(&req.account, req.lt, Some(req.count as usize)).await?; 379 | let mut boc = Vec::new(); 380 | BagOfCells::with_roots(transactions.iter().map(|tx| tx.serialize()).collect::>>()?.as_slice()).write_to(&mut boc, false)?; 381 | Ok(TransactionList { 382 | ids, 383 | transactions: boc, 384 | }) 385 | } 386 | 387 | pub async fn lookup_block(&self, req: LookupBlock) -> Result { 388 | let shard = ShardIdent::with_tagged_prefix(req.id.workchain, req.id.shard)?; 389 | let block = if let Some(utime) = req.utime { 390 | self.engine.storage().block_storage().search_block_by_utime(&shard, utime)? 391 | } else if let Some(lt) = req.lt { 392 | self.engine.storage().block_storage().search_block_by_lt(&shard, lt)? 393 | } else if req.seqno.is_some() { 394 | self.engine.storage().block_storage().search_block_by_seqno(&shard, req.id.seqno)? 395 | } else { 396 | return Err(anyhow!("exactly one of utime, lt or seqno must be specified")) 397 | }.ok_or(anyhow!("no such block in db"))?; 398 | 399 | let block_root = ton_types::deserialize_tree_of_cells(&mut block.as_ref())?; 400 | let merkle_proof = Self::make_block_proof( 401 | block_root.clone(), 402 | req.with_state_update.is_some(), 403 | req.with_value_flow.is_some(), 404 | req.with_extra.is_some(), 405 | false, 406 | false, 407 | None, 408 | )?; 409 | 410 | let seqno = Block::construct_from_cell(block_root.clone())?.read_info()?.seq_no(); 411 | 412 | Ok(BlockHeader { 413 | id: BlockIdExt { 414 | workchain: shard.workchain_id(), 415 | shard: shard.shard_prefix_with_tag(), 416 | seqno, 417 | root_hash: Int256(*block_root.repr_hash().as_array()), 418 | file_hash: Int256(*UInt256::calc_file_hash(&block).as_array()), 419 | }, 420 | mode: (), 421 | header_proof: merkle_proof.write_to_bytes()?, 422 | with_state_update: req.with_state_update, 423 | with_value_flow: req.with_value_flow, 424 | with_extra: req.with_extra, 425 | with_shard_hashes: req.with_shard_hashes, 426 | with_prev_blk_signatures: req.with_prev_blk_signatures, 427 | }) 428 | } 429 | 430 | fn update_config_params(params: &mut Vec, with_validator_set: bool, with_special_smc: bool, with_workchain_info: bool, with_capabilities: bool) -> Result<()> { 431 | if with_validator_set { 432 | params.push(34); 433 | } 434 | if with_special_smc { 435 | params.push(31); 436 | } 437 | if with_workchain_info { 438 | params.push(12); 439 | } 440 | if with_capabilities { 441 | params.push(8); 442 | } 443 | Ok(()) 444 | } 445 | 446 | fn touch_config(config: &ConfigParams, with_params: Option<&[i32]>) -> Result<()> { 447 | fn preload_param(config: &ConfigParams, param: i32) -> Result<()> { 448 | let key = SliceData::load_builder(param.write_to_new_cell()?)?; 449 | let slice = config.config_params.get(key)?.ok_or(anyhow!("no such param {param}"))?; 450 | let cell = slice.reference_opt(0).ok_or(anyhow!("no such reference in param {param}"))?; 451 | cell.preload_with_depth_hint::<32>()?; 452 | Ok(()) 453 | } 454 | if let Some(with_params) = with_params { 455 | for i in with_params { 456 | preload_param(config, *i)?; 457 | } 458 | } else { 459 | config.config_params.data().ok_or(anyhow!("no config"))?.preload_with_depth_hint::<128>()?; 460 | } 461 | Ok(()) 462 | } 463 | 464 | fn make_state_proof(state_root: Cell, params: Option<&[i32]>, with_accounts: bool, with_prev_blocks: bool, with_shard_hashes: bool) -> Result { 465 | let usage_tree = UsageTree::with_root(state_root.clone()); 466 | let state = ShardStateUnsplit::construct_from_cell(usage_tree.root_cell())?; 467 | if with_accounts { 468 | state.read_accounts()?; 469 | } 470 | let custom = state.read_custom()?.ok_or(anyhow!("no custom data in state"))?; 471 | if with_prev_blocks { 472 | let mut counter = 0; 473 | let _ = custom.prev_blocks.iterate_ext(true, None, |_, _| { counter += 1; Ok(counter < 16) })?; 474 | } 475 | if with_shard_hashes { 476 | let _ = custom.shards.root().ok_or(anyhow!("no shards in state"))?.preload_with_depth_hint::<32>()?; 477 | } 478 | Self::touch_config(custom.config(), params)?; 479 | Ok(MerkleProof::create_by_usage_tree(&state_root, usage_tree)?) 480 | } 481 | 482 | pub async fn get_config_params(&self, mut req: GetConfigParams) -> Result { 483 | if req.id.workchain != -1 { 484 | return Err(anyhow!("requested block is not in masterchain")) 485 | } 486 | Self::update_config_params(&mut req.param_list, req.with_validator_set.is_some(), req.with_special_smc.is_some(), req.with_workchain_info.is_some(), req.with_capabilities.is_some())?; 487 | let block_root = self.load_block_by_tonlabs_id(&req.id.as_tonlabs()?).await?.ok_or(anyhow!("no such block in db"))?; 488 | let block = Block::construct_from_cell(block_root.clone())?; 489 | if req.extract_from_key_block.is_some() { 490 | let key_seqno = block.read_info()?.prev_key_block_seqno(); 491 | let key_id = self.search_mc_block_by_seqno(key_seqno).await?.ok_or(anyhow!("no such key block in masterchain state"))?; 492 | let key_root = self.load_block_by_tonlabs_id(&key_id).await?.ok_or(anyhow!("no such key block in db"))?; 493 | Ok(ConfigInfo { 494 | mode: (), 495 | id: key_id.as_liteapi(), 496 | state_proof: Vec::new(), 497 | config_proof: Self::make_block_proof( 498 | key_root, 499 | false, 500 | false, 501 | true, 502 | req.with_shard_hashes.is_some(), 503 | true, 504 | Some(req.param_list.as_slice()), 505 | )?.write_to_bytes()?, 506 | with_state_root: req.with_state_root, 507 | with_libraries: req.with_libraries, 508 | with_state_extra_root: req.with_state_extra_root, 509 | with_shard_hashes: req.with_shard_hashes, 510 | with_accounts_root: req.with_accounts_root, 511 | with_prev_blocks: req.with_prev_blocks, 512 | extract_from_key_block: req.extract_from_key_block, 513 | with_validator_set: req.with_validator_set, 514 | with_special_smc: req.with_special_smc, 515 | with_workchain_info: req.with_workchain_info, 516 | with_capabilities: req.with_capabilities, 517 | }) 518 | } else { 519 | let state_root = self.load_state(&req.id).await?.root_cell().clone(); 520 | Ok(ConfigInfo { 521 | mode: (), 522 | id: req.id, 523 | state_proof: Self::make_block_proof(block_root, true, false, false, false, false, None)?.write_to_bytes()?, 524 | config_proof: Self::make_state_proof( 525 | state_root, 526 | Some(req.param_list.as_slice()), 527 | req.with_accounts_root.is_some(), 528 | req.with_prev_blocks.is_some(), 529 | req.with_shard_hashes.is_some() 530 | )?.write_to_bytes()?, 531 | with_state_root: req.with_state_root, 532 | with_libraries: req.with_libraries, 533 | with_state_extra_root: req.with_state_extra_root, 534 | with_shard_hashes: req.with_shard_hashes, 535 | with_accounts_root: req.with_accounts_root, 536 | with_prev_blocks: req.with_accounts_root, 537 | extract_from_key_block: req.extract_from_key_block, 538 | with_validator_set: req.with_validator_set, 539 | with_special_smc: req.with_special_smc, 540 | with_workchain_info: req.with_workchain_info, 541 | with_capabilities: req.with_capabilities, 542 | }) 543 | } 544 | 545 | } 546 | 547 | pub async fn get_config_all(&self, req: GetConfigAll) -> Result { 548 | if req.id.workchain != -1 { 549 | return Err(anyhow!("requested block is not in masterchain")) 550 | } 551 | let block_root = self.load_block_by_tonlabs_id(&req.id.as_tonlabs()?).await?.ok_or(anyhow!("no such block in db"))?; 552 | let block = Block::construct_from_cell(block_root.clone())?; 553 | if req.extract_from_key_block.is_some() { 554 | let key_seqno = block.read_info()?.prev_key_block_seqno(); 555 | let key_id = self.search_mc_block_by_seqno(key_seqno).await?.ok_or(anyhow!("no such key block in masterchain state"))?; 556 | let key_root = self.load_block_by_tonlabs_id(&key_id).await?.ok_or(anyhow!("no such key block in db"))?; 557 | Ok(ConfigInfo { 558 | mode: (), 559 | id: key_id.as_liteapi(), 560 | state_proof: Vec::new(), 561 | config_proof: Self::make_block_proof( 562 | key_root, 563 | false, 564 | false, 565 | true, 566 | req.with_shard_hashes.is_some(), 567 | true, 568 | None, 569 | )?.write_to_bytes()?, 570 | with_state_root: req.with_state_root, 571 | with_libraries: req.with_libraries, 572 | with_state_extra_root: req.with_state_extra_root, 573 | with_shard_hashes: req.with_shard_hashes, 574 | with_accounts_root: req.with_accounts_root, 575 | with_prev_blocks: req.with_prev_blocks, 576 | extract_from_key_block: req.extract_from_key_block, 577 | with_validator_set: req.with_validator_set, 578 | with_special_smc: req.with_special_smc, 579 | with_workchain_info: req.with_workchain_info, 580 | with_capabilities: req.with_capabilities, 581 | }) 582 | } else { 583 | let state_root = self.load_state(&req.id).await?.root_cell().clone(); 584 | Ok(ConfigInfo { 585 | mode: (), 586 | id: req.id, 587 | state_proof: Self::make_block_proof(block_root, true, false, false, false, false, None)?.write_to_bytes()?, 588 | config_proof: Self::make_state_proof( 589 | state_root, 590 | None, 591 | req.with_accounts_root.is_some(), 592 | req.with_prev_blocks.is_some(), 593 | req.with_shard_hashes.is_some() 594 | )?.write_to_bytes()?, 595 | with_state_root: req.with_state_root, 596 | with_libraries: req.with_libraries, 597 | with_state_extra_root: req.with_state_extra_root, 598 | with_shard_hashes: req.with_shard_hashes, 599 | with_accounts_root: req.with_accounts_root, 600 | with_prev_blocks: req.with_accounts_root, 601 | extract_from_key_block: req.extract_from_key_block, 602 | with_validator_set: req.with_validator_set, 603 | with_special_smc: req.with_special_smc, 604 | with_workchain_info: req.with_workchain_info, 605 | with_capabilities: req.with_capabilities, 606 | }) 607 | } 608 | } 609 | 610 | fn construct_proof(root: &Cell, mut visitor: F) -> Result where T: Deserializable, F: FnMut(&T) -> Result<()> { 611 | let usage_tree = UsageTree::with_root(root.clone()); 612 | visitor(&T::construct_from_cell(usage_tree.root_cell())?)?; 613 | Ok(MerkleProof::create_by_usage_tree(root, usage_tree)?) 614 | } 615 | 616 | fn construct_signatures(block_root: Cell, proof: &BlockProofStuff) -> Result { 617 | let block = Block::construct_from_cell(block_root)?; 618 | let info = block.read_info()?; 619 | let mut signatures = SignatureSet { 620 | validator_set_hash: info.gen_validator_list_hash_short(), 621 | catchain_seqno: info.gen_catchain_seqno(), 622 | signatures: Vec::new(), 623 | }; 624 | proof.proof().clone().signatures.ok_or(anyhow!("no signatures"))?.pure_signatures.signatures().iterate_slices(|ref mut _key, ref mut slice| { 625 | let sign = CryptoSignaturePair::construct_from(slice)?; 626 | signatures.signatures.push(Signature { 627 | signature: sign.sign.signature().to_bytes().to_vec(), 628 | node_id_short: Int256(*sign.node_id_short.as_array()), 629 | }); 630 | Ok(true) 631 | })?; 632 | Ok(signatures) 633 | } 634 | 635 | pub async fn get_block_proof(&self, req: GetBlockProof) -> Result { 636 | if req.known_block.workchain != -1 || req.known_block.shard != SHARD_FULL { 637 | return Err(anyhow!("known_block must be in masterchain")) 638 | } 639 | let target_block = if let Some(target_block) = &req.target_block { 640 | if target_block.workchain != -1 || target_block.shard != SHARD_FULL { 641 | return Err(anyhow!("target_block must be in masterchain")) 642 | } 643 | target_block.as_tonlabs()? 644 | } else if req.allow_weak_target.is_some() { 645 | self.engine.load_last_applied_mc_block_id()? 646 | } else { 647 | self.engine.load_shards_client_mc_block_id()? 648 | }; 649 | let base_block = if req.target_block.is_some() && req.base_block_from_request.is_some() || req.target_block.is_none() && req.allow_weak_target.is_none() { 650 | if req.known_block.seqno > target_block.seq_no { 651 | req.known_block.as_tonlabs()? 652 | } else { 653 | target_block.clone() 654 | } 655 | } else { 656 | self.engine.load_last_applied_mc_block_id()? 657 | }; 658 | let known_block = req.known_block.as_tonlabs()?; 659 | if target_block.seq_no < known_block.seq_no { 660 | let known_block_root = self.load_block_by_tonlabs_id(&known_block).await?.ok_or(anyhow!("no such known_block"))?; 661 | let known_state = self.load_state(&req.known_block).await?; 662 | let known_state_root = known_state.root_cell(); 663 | let mut to_key_block = false; 664 | let proof = Self::construct_proof::(known_state_root, |state| { 665 | let target_ref = state.read_custom()?.ok_or(anyhow!("no custom in mc state"))?.prev_blocks.get(&target_block.seq_no)?.ok_or(anyhow!("no such target block"))?; 666 | to_key_block = target_ref.key; 667 | Ok(()) 668 | })?; 669 | Ok(PartialBlockProof { 670 | complete: true, 671 | from: req.known_block.clone(), 672 | to: target_block.as_liteapi(), 673 | steps: [ 674 | BlockLink::BlockLinkBack { 675 | to_key_block, 676 | from: req.known_block, 677 | to: target_block.as_liteapi(), 678 | dest_proof: Vec::new(), 679 | proof: proof.write_to_bytes()?, 680 | state_proof: Self::make_block_proof(known_block_root, true, false, false, false, false, None)?.write_to_bytes()?, 681 | } 682 | ].to_vec(), 683 | }) 684 | } else if target_block.seq_no > known_block.seq_no { 685 | let mut steps = Vec::new(); 686 | let base_state = self.load_state(&base_block.as_liteapi()).await?; 687 | let extra = base_state.shard_state_extra()?; 688 | let prev_blocks = &extra.prev_blocks; 689 | let mut current = known_block; 690 | let mut current_proof = self.load_block_proof(¤t).await?; 691 | let mut complete = false; 692 | let mut to = current.clone(); 693 | while steps.len() < 16 { 694 | // there is key blocks between current block and target block, make link current -> key block 695 | if let Some(next_key_block) = prev_blocks.get_next_key_block(current.seq_no + 1)? { 696 | if next_key_block.seq_no <= target_block.seq_no { 697 | let next = next_key_block.clone().master_block_id().1; 698 | let proof = self.load_block_proof(&next).await?; 699 | steps.push(BlockLink::BlockLinkForward { 700 | to_key_block: true, 701 | from: current.as_liteapi(), 702 | to: next.as_liteapi(), 703 | dest_proof: MerkleProof::construct_from_cell(proof.proof().root.clone())?.write_to_bytes()?, 704 | config_proof: MerkleProof::construct_from_cell(current_proof.proof().root.clone())?.write_to_bytes()?, 705 | signatures: Self::construct_signatures(proof.virtualize_block_root()?, &proof)?, 706 | }); 707 | to = next.clone(); 708 | if next_key_block.seq_no == target_block.seq_no { 709 | break 710 | } 711 | current = next; 712 | current_proof = proof; 713 | continue 714 | } 715 | } 716 | // last link between last key block and target block 717 | let proof = self.load_block_proof(&target_block).await?; 718 | steps.push(BlockLink::BlockLinkForward { 719 | to_key_block: false, 720 | from: current.as_liteapi(), 721 | to: target_block.as_liteapi(), 722 | dest_proof: MerkleProof::construct_from_cell(proof.proof().root.clone())?.write_to_bytes()?, 723 | config_proof: MerkleProof::construct_from_cell(current_proof.proof().root.clone())?.write_to_bytes()?, 724 | signatures: Self::construct_signatures(proof.virtualize_block_root()?, &proof)?, 725 | }); 726 | to = target_block; 727 | complete = true; 728 | break 729 | } 730 | Ok(PartialBlockProof { 731 | complete, 732 | from: req.known_block, 733 | to: to.as_liteapi(), 734 | steps, 735 | }) 736 | } else { 737 | Ok(PartialBlockProof { 738 | complete: true, 739 | from: req.known_block, 740 | to: target_block.as_liteapi(), 741 | steps: Vec::new(), 742 | }) 743 | } 744 | } 745 | 746 | pub async fn run_smc_method(&self, req: RunSmcMethod) -> Result { 747 | let reference_id = if req.id.seqno != 0xffff_ffff { 748 | req.id.as_tonlabs()? 749 | } else { 750 | self.engine.load_shards_client_mc_block_id()? 751 | }; 752 | let shard_id = self.get_block_for_account(&req.account, &reference_id).await?; 753 | let state_stuff = self.engine.load_state(&shard_id).await?; 754 | let usage_tree_p2 = UsageTree::with_root(state_stuff.root_cell().clone()); 755 | let state = ShardStateUnsplit::construct_from_cell(usage_tree_p2.root_cell())?; 756 | let account = state 757 | .read_accounts()? 758 | .account(&req.account.id())? 759 | .ok_or(anyhow!("no such account"))? 760 | .read_account()?; 761 | let state_init = if let ton_block::AccountState::AccountActive { state_init } = account.state().ok_or(anyhow!("no state for account"))? { 762 | state_init 763 | } else { 764 | return Err(anyhow!("account is not active")) 765 | }; 766 | let code = serialize_toc(state_init.code().ok_or(anyhow!("no code in state"))?)?; 767 | let data = serialize_toc(state_init.data().ok_or(anyhow!("no data in state"))?)?; 768 | let libs = state_stuff.state().libraries().write_to_bytes()?; 769 | let mc_state = self.engine.load_state(&reference_id).await?; 770 | let config = mc_state.shard_state_extra()?.config.config_params.write_to_bytes()?; 771 | let balance = account.balance().and_then(|x| x.grams.as_u64()).unwrap_or(0); 772 | let empty_stack = vec![181, 238, 156, 114, 65, 1, 1, 1, 0, 5, 0, 0, 6, 0, 0, 0, 208, 9, 95, 69]; 773 | let stack = if req.params.len() > 0 { 774 | &req.params 775 | } else { 776 | &empty_stack 777 | }; 778 | let result = EmulatorBuilder::new(&code, &data) 779 | .with_gas_limit(1000000) 780 | .with_c7(&req.account, now(), balance, &[0u8; 32], &config) 781 | .with_libs(&libs) 782 | .run_get_method(req.method_id as i32, stack); 783 | let result = match result { 784 | crate::tvm::TvmEmulatorRunGetMethodResult::Error(e) => return Err(anyhow!("tvm error: {:?}", e)), 785 | crate::tvm::TvmEmulatorRunGetMethodResult::Success(r) => r, 786 | }; 787 | Ok(RunMethodResult { 788 | mode: (), 789 | id: reference_id.as_liteapi(), 790 | shardblk: shard_id.as_liteapi(), 791 | shard_proof: None, 792 | proof: None, 793 | state_proof: None, 794 | init_c7: None, 795 | lib_extras: None, 796 | exit_code: result.vm_exit_code, 797 | result: Some(base64::engine::general_purpose::STANDARD.decode(result.stack)?), 798 | }) 799 | } 800 | 801 | pub async fn send_message(&self, req: SendMessage) -> Result { 802 | let message = Message::construct_from_bytes(req.body.as_slice())?; 803 | let message_info = if let CommonMsgInfo::ExtInMsgInfo(info) = message.header() { 804 | info 805 | } else { 806 | return Err(anyhow!("message is not inbound external")) 807 | }; 808 | let reference_id = self.engine.load_shards_client_mc_block_id()?; 809 | let (wc, account_id) = message_info.dst.extract_std_address(true)?; 810 | let acc_id = AccountId { 811 | workchain: wc, 812 | id: Int256(account_id.get_bytestring(0).try_into().unwrap()), 813 | }; 814 | let shard_id = self.get_block_for_account(&acc_id, &reference_id).await?; 815 | let state_stuff = self.engine.load_state(&shard_id).await?; 816 | let acc = state_stuff.state().read_accounts()?.account(&account_id)?.ok_or(anyhow!("no such account"))?.read_account()?; 817 | let state_init = if let ton_block::AccountState::AccountActive { state_init } = acc.state().ok_or(anyhow!("no state for account"))? { 818 | state_init 819 | } else { 820 | return Err(anyhow!("account is not active")) 821 | }; 822 | let code = serialize_toc(state_init.code().ok_or(anyhow!("no code in state"))?)?; 823 | let data = serialize_toc(state_init.data().ok_or(anyhow!("no data in state"))?)?; 824 | let libs = state_stuff.state().libraries().write_to_bytes()?; 825 | let mc_state = self.engine.load_state(&reference_id).await?; 826 | let config = mc_state.shard_state_extra()?.config.config_params.write_to_bytes()?; 827 | let balance = acc.balance().and_then(|x| x.grams.as_u64()).unwrap_or(0); 828 | let result = EmulatorBuilder::new(&code, &data) 829 | .with_gas_limit(1000000) 830 | .with_c7(&acc_id, now(), balance, &[0u8; 32], &config) 831 | .with_libs(&libs) 832 | .run_external(&req.body); 833 | let result = match result { 834 | crate::tvm::TvmEmulatorSendExternalMessageResult::Error(e) => return Err(anyhow!("tvm error: {:?}", e)), 835 | crate::tvm::TvmEmulatorSendExternalMessageResult::Success(r) => r, 836 | }; 837 | if !result.accepted { 838 | return Err(anyhow!("message was not accepted")) 839 | } 840 | self.engine.broadcast_external_message(-1, &req.body)?; 841 | Ok(SendMsgStatus { status: 1 }) 842 | } 843 | 844 | pub async fn get_libraries(&self, req: GetLibraries) -> Result { 845 | let mut result = Vec::new(); 846 | let state = self.load_state_by_tonlabs_id(&self.engine.load_last_applied_mc_block_id()?).await?; 847 | for hash in req.library_list { 848 | let library = state.state().libraries().get(&UInt256::from_slice(&hash.0))?.ok_or(anyhow!("no such library: {:?}", hash))?; 849 | result.push(LibraryEntry { hash, data: library.lib().write_to_bytes()? }); 850 | } 851 | Ok(LibraryResult { result }) 852 | } 853 | 854 | pub async fn lookup_block_with_proof(&self, req: LookupBlockWithProof) -> Result { 855 | let shard = ShardIdent::with_tagged_prefix(req.id.workchain, req.id.shard)?; 856 | let block = if let Some(utime) = req.utime { 857 | self.engine.storage().block_storage().search_block_by_utime(&shard, utime)? 858 | } else if let Some(lt) = req.lt { 859 | self.engine.storage().block_storage().search_block_by_lt(&shard, lt)? 860 | } else if req.seqno.is_some() { 861 | self.engine.storage().block_storage().search_block_by_seqno(&shard, req.id.seqno)? 862 | } else { 863 | return Err(anyhow!("exactly one of utime, lt or seqno must be specified")) 864 | }.ok_or(anyhow!("no such block in db"))?; 865 | 866 | let block_root = ton_types::deserialize_tree_of_cells(&mut block.as_ref())?; 867 | let header = Self::make_block_proof( 868 | block_root.clone(), 869 | req.with_state_update.is_some(), 870 | req.with_value_flow.is_some(), 871 | req.with_extra.is_some(), 872 | false, 873 | false, 874 | None, 875 | )?; 876 | let seqno = Block::construct_from_cell(block_root.clone())?.read_info()?.seq_no(); 877 | let id = BlockIdExt { 878 | workchain: shard.workchain_id(), 879 | shard: shard.shard_prefix_with_tag(), 880 | seqno, 881 | root_hash: Int256(*block_root.repr_hash().as_array()), 882 | file_hash: Int256(*UInt256::calc_file_hash(&block).as_array()), 883 | }; 884 | Ok(LookupBlockResult { 885 | id: id.clone(), 886 | mode: (), 887 | mc_block_id: id, 888 | client_mc_state_proof: Vec::new(), 889 | mc_block_proof: Vec::new(), 890 | shard_links: Vec::new(), 891 | header: header.write_to_bytes()?, 892 | prev_header: Vec::new(), 893 | }) 894 | } 895 | 896 | pub async fn wait_masterchain_seqno(&self, req: WaitMasterchainSeqno) -> Result<()> { 897 | tokio::select! { 898 | _ = tokio::time::sleep(Duration::from_millis(req.timeout_ms as u64)) => Err(anyhow!("Timeout")), 899 | r = async { 900 | loop { 901 | // load_last_applied_mc_block_id uses sync mutex, may be very slow 902 | let last_seqno = self.engine.load_last_applied_mc_block_id()?.seq_no; 903 | if req.seqno <= last_seqno { 904 | return Ok(()) 905 | } 906 | tokio::time::sleep(Duration::from_millis(100)).await; 907 | } 908 | } => r 909 | } 910 | } 911 | 912 | #[tracing::instrument(skip(self), level = "debug", fields(prefix=req.wait_masterchain_seqno.is_some(), method=format!("{:?}", req.request).split('(').next().unwrap()), err(level = tracing::Level::DEBUG))] 913 | async fn call_impl(&self, req: WrappedRequest) -> Result { 914 | if let Some(wait_req) = req.wait_masterchain_seqno { 915 | self.wait_masterchain_seqno(wait_req).await?; 916 | } 917 | match req.request { 918 | Request::GetMasterchainInfo => Ok(Response::MasterchainInfo( 919 | self.get_masterchain_info().await?, 920 | )), 921 | Request::GetMasterchainInfoExt(req) => Ok(Response::MasterchainInfoExt( 922 | self.get_masterchain_info_ext(req).await?, 923 | )), 924 | Request::GetBlockHeader(req) => { 925 | Ok(Response::BlockHeader(self.get_block_header(req).await?)) 926 | } 927 | Request::GetAllShardsInfo(req) => Ok(Response::AllShardsInfo( 928 | self.get_all_shards_info(req).await?, 929 | )), 930 | Request::ListBlockTransactions(req) => Ok(Response::BlockTransactions( 931 | self.list_block_transactions(req).await?, 932 | )), 933 | Request::GetAccountState(req) => Ok(Response::AccountState( 934 | self.get_account_state(req).await?, 935 | )), 936 | Request::GetBlock(req) => Ok(Response::BlockData( 937 | self.get_block(req).await?, 938 | )), 939 | Request::GetTransactions(req) => Ok(Response::TransactionList( 940 | self.get_transactions(req).await?, 941 | )), 942 | Request::LookupBlock(req) => Ok(Response::BlockHeader( 943 | self.lookup_block(req).await?, 944 | )), 945 | Request::GetConfigParams(req) => Ok(Response::ConfigInfo( 946 | self.get_config_params(req).await?, 947 | )), 948 | Request::GetConfigAll(req) => Ok(Response::ConfigInfo( 949 | self.get_config_all(req).await?, 950 | )), 951 | Request::GetBlockProof(req) => Ok(Response::PartialBlockProof( 952 | self.get_block_proof(req).await?, 953 | )), 954 | Request::RunSmcMethod(req) => Ok(Response::RunMethodResult( 955 | self.run_smc_method(req).await?, 956 | )), 957 | Request::SendMessage(req) => Ok(Response::SendMsgStatus( 958 | self.send_message(req).await?, 959 | )), 960 | Request::GetLibraries(req) => Ok(Response::LibraryResult( 961 | self.get_libraries(req).await?, 962 | )), 963 | Request::LookupBlockWithProof(req) => Ok(Response::LookupBlockResult( 964 | self.lookup_block_with_proof(req).await?, 965 | )), 966 | _ => Err(anyhow!("unimplemented method: {:?}", req.request)), 967 | } 968 | } 969 | } 970 | 971 | impl Service for LiteServer { 972 | type Response = Response; 973 | type Error = LiteError; 974 | type Future = BoxFuture<'static, Result>; 975 | 976 | fn poll_ready(&mut self, _cx: &mut std::task::Context<'_>) -> Poll> { 977 | Poll::Ready(Ok(())) 978 | } 979 | 980 | fn call(&mut self, req: WrappedRequest) -> Self::Future { 981 | let ls = self.clone(); 982 | Box::pin(async move { 983 | ls.call_impl(req) 984 | .await 985 | .map_err(|e| LiteError::UnknownError(e.into())) 986 | }) 987 | } 988 | } 989 | 990 | pub fn run(engine: Arc, config: GlobalConfig) { 991 | let ls = LiteServer { engine, config }; 992 | tokio::spawn(async move { 993 | // TODO: key from environment variables 994 | let key: [u8; 32] = 995 | hex::decode("f0971651aec4bb0d65ec3861c597687fda9c1e7d2ee8a93acb9a131aa9f3aee7") 996 | .unwrap() 997 | .try_into() 998 | .unwrap(); 999 | let key = KeyPair::from(&SecretKey::from_bytes(key)); 1000 | 1001 | tracing::info!("Public key is: {}", base64::encode(key.public_key.to_bytes())); 1002 | 1003 | // TODO: configurable layers, rate limiting by ip/adnl 1004 | let service = ServiceBuilder::new() 1005 | .buffer(100) 1006 | .layer(UnwrapMessagesLayer) 1007 | .layer(WrapErrorLayer) 1008 | .service(ls); 1009 | serve(&("0.0.0.0", 3333), key, Shared::new(service)) 1010 | .await 1011 | .expect("liteserver error"); 1012 | }); 1013 | } 1014 | 1015 | trait BlockIdExtAsTonlabs { 1016 | fn as_tonlabs(&self) -> Result; 1017 | } 1018 | 1019 | trait BlockIdExtAsLiteapi { 1020 | fn as_liteapi(&self) -> ton_liteapi::tl::common::BlockIdExt; 1021 | } 1022 | 1023 | impl BlockIdExtAsTonlabs for ton_liteapi::tl::common::BlockIdExt { 1024 | fn as_tonlabs(&self) -> Result { 1025 | Ok(ton_block::BlockIdExt { 1026 | shard_id: ShardIdent::with_tagged_prefix(self.workchain, self.shard)?, 1027 | seq_no: self.seqno, 1028 | root_hash: UInt256::from_slice(&self.root_hash.0), 1029 | file_hash: UInt256::from_slice(&self.file_hash.0), 1030 | }) 1031 | } 1032 | } 1033 | 1034 | impl BlockIdExtAsLiteapi for ton_block::BlockIdExt { 1035 | fn as_liteapi(&self) -> ton_liteapi::tl::common::BlockIdExt { 1036 | ton_liteapi::tl::common::BlockIdExt { 1037 | workchain: self.shard().workchain_id(), 1038 | shard: self.shard().shard_prefix_with_tag(), 1039 | seqno: self.seq_no, 1040 | root_hash: Int256(*self.root_hash.as_array()), 1041 | file_hash: Int256(*self.file_hash.as_array()), 1042 | } 1043 | } 1044 | } 1045 | 1046 | trait AccountIdAsTonlabs { 1047 | fn prefix_full(&self) -> Result; 1048 | fn std(&self) -> ton_block::MsgAddrStd; 1049 | fn raw_id(&self) -> UInt256; 1050 | fn id(&self) -> ton_types::AccountId; 1051 | } 1052 | 1053 | impl AccountIdAsTonlabs for ton_liteapi::tl::common::AccountId { 1054 | fn std(&self) -> ton_block::MsgAddrStd { 1055 | MsgAddrStd::with_address(None, self.workchain as i8, ton_types::AccountId::from_raw(self.id.0.to_vec(),256)) 1056 | } 1057 | 1058 | fn prefix_full(&self) -> Result { 1059 | ton_block::AccountIdPrefixFull::prefix(&ton_block::MsgAddressInt::AddrStd(self.std())) 1060 | } 1061 | 1062 | fn raw_id(&self) -> UInt256 { 1063 | UInt256::from_slice(&self.id.0) 1064 | } 1065 | 1066 | fn id(&self) -> ton_types::AccountId { 1067 | ton_types::AccountId::from_raw(self.id.0.to_vec(), 256) 1068 | } 1069 | } -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | // Adopted from https://github.com/broxus/ton-indexer/blob/master/examples/simple_node.rs 2 | 3 | mod liteserver; 4 | mod web; 5 | mod utils; 6 | mod tracing_utils; 7 | mod tvm; 8 | 9 | use std::path::Path; 10 | use std::sync::Arc; 11 | 12 | use anyhow::Result; 13 | use argh::FromArgs; 14 | use metrics_exporter_prometheus::PrometheusBuilder; 15 | use serde::{Deserialize, Serialize}; 16 | 17 | use ton_indexer::{Engine, GlobalConfig, NodeConfig, Subscriber}; 18 | 19 | #[global_allocator] 20 | static GLOBAL: ton_indexer::alloc::Allocator = ton_indexer::alloc::allocator(); 21 | 22 | #[derive(Debug, FromArgs)] 23 | #[argh(description = "")] 24 | pub struct App { 25 | /// path to node config 26 | #[argh(option, short = 'c')] 27 | pub config: Option, 28 | 29 | /// path to the global config with zerostate and static dht nodes 30 | #[argh(option)] 31 | pub global_config_path: Option, 32 | 33 | /// url to the global config with zerostate and static dht nodes 34 | #[argh(option)] 35 | pub global_config_url: Option, 36 | 37 | /// if path or url are not specified, download global config from https://ton.org/global.config.json (default) or https://ton.org/testnet-global.config.json (--testnet flag) 38 | #[argh(switch)] 39 | pub testnet: bool, 40 | } 41 | 42 | #[tokio::main] 43 | async fn main() -> Result<()> { 44 | tracing_utils::init(); 45 | 46 | let any_signal = broxus_util::any_signal(broxus_util::TERMINATION_SIGNALS); 47 | 48 | let run = run(argh::from_env()); 49 | 50 | tokio::select! { 51 | result = run => result, 52 | signal = any_signal => { 53 | if let Ok(signal) = signal { 54 | tracing::warn!(?signal, "received termination signal, flushing state..."); 55 | tracing_utils::shutdown(); 56 | } 57 | // NOTE: engine future is safely dropped here so rocksdb method 58 | // `rocksdb_close` is called in DB object destructor 59 | Ok(()) 60 | } 61 | } 62 | } 63 | 64 | struct BlockSubscriber; 65 | 66 | impl Subscriber for BlockSubscriber {} 67 | 68 | async fn run(app: App) -> Result<()> { 69 | if app.global_config_path.is_some() && app.global_config_url.is_some() { 70 | anyhow::bail!("only one of --global-config-path and --global-config-url can be specified"); 71 | } else if app.testnet && (app.global_config_path.is_some() || app.global_config_url.is_some()) { 72 | anyhow::bail!("--testnet flag cannot be used with --global-config-path or --global-config-url"); 73 | } 74 | 75 | // SAFETY: global allocator is set to jemalloc 76 | tracing::info!("Applying allocator config..."); 77 | unsafe { ton_indexer::alloc::apply_config() }; 78 | 79 | // TODO: option to configure using environment variables, auto-generate and store private keys 80 | let mut config = if let Some(config) = app.config { 81 | broxus_util::read_config(config)? 82 | } else { 83 | tracing::info!("-c option is not set, using default node configuration"); 84 | Config::default() 85 | }; 86 | // disable shard state cache, it leaks memory and should not be used 87 | config.indexer.shard_state_cache_options = None; 88 | tracing::info!(?config, "Node configuration is done"); 89 | 90 | tracing::info!("RocksDB size is {} GB", fs_extra::dir::get_size(&config.indexer.rocks_db_path).unwrap_or(0) >> 30); 91 | tracing::info!("File DB size is {} GB", fs_extra::dir::get_size(&config.indexer.file_db_path).unwrap_or(0) >> 30); 92 | 93 | tracing::info!("Resolving public IPv4 for node ADNL->IP DHT entry..."); 94 | config 95 | .indexer 96 | .ip_address 97 | .set_ip(broxus_util::resolve_public_ip(None).await?); 98 | tracing::info!(?config.indexer.ip_address, "IP is resolved"); 99 | 100 | // prometheus metrics 101 | let builder = PrometheusBuilder::new(); 102 | let recorder = builder.install_recorder()?; 103 | prometheus::default_registry() 104 | .register(Box::new( 105 | tokio_metrics_collector::default_runtime_collector(), 106 | ))?; 107 | 108 | let global_config = if let Some(path) = app.global_config_path { 109 | read_global_config_from_path(path)? 110 | } else if let Some(url) = app.global_config_url { 111 | read_global_config_from_url(&url)? 112 | } else if app.testnet { 113 | read_global_config_from_url("https://ton.org/testnet-global.config.json")? 114 | } else { 115 | read_global_config_from_url("https://ton.org/global.config.json")? 116 | }; 117 | 118 | tracing::info!("Initializing engine..."); 119 | let engine = Engine::new( 120 | config.indexer, 121 | global_config.clone(), 122 | Arc::new(BlockSubscriber), 123 | ) 124 | .await?; 125 | 126 | tracing::info!("Initializing web server..."); 127 | web::run(engine.clone(), recorder).await?; 128 | 129 | tracing::info!("Initializing liteserver..."); 130 | liteserver::run(engine.clone(), global_config); 131 | 132 | tracing::info!("Starting engine..."); 133 | engine.start().await?; 134 | 135 | tracing::info!("Engine is running"); 136 | futures_util::future::pending().await 137 | } 138 | 139 | #[derive(Serialize, Deserialize, Default, Debug)] 140 | struct Config { 141 | indexer: NodeConfig, 142 | } 143 | 144 | fn read_global_config_from_path(path: T) -> Result 145 | where 146 | T: AsRef + std::fmt::Display, 147 | { 148 | tracing::info!("Loading global config from path {path}"); 149 | let file = std::fs::File::open(path)?; 150 | let reader = std::io::BufReader::new(file); 151 | let config = serde_json::from_reader(reader)?; 152 | Ok(config) 153 | } 154 | 155 | fn read_global_config_from_url(url: &str) -> Result { 156 | tracing::info!("Loading global config from url {url}"); 157 | let response = ureq::get(url).call() 158 | .map_err(|e| anyhow::anyhow!("Error occurred while fetching config from {}: {:?}. Use --global-config-path if you have local config.", url, e))?; 159 | if response.status() != 200 { 160 | anyhow::bail!("Error occurred while fetching config from {}: {}", url, response.status()); 161 | } 162 | let config = serde_json::from_reader(response.into_reader())?; 163 | Ok(config) 164 | } -------------------------------------------------------------------------------- /src/tracing_utils.rs: -------------------------------------------------------------------------------- 1 | use tracing_subscriber::layer::SubscriberExt as _; 2 | use tracing_subscriber::util::SubscriberInitExt as _; 3 | use tracing_subscriber::{EnvFilter, Layer}; 4 | use tracing_subscriber::fmt::format::FmtSpan; 5 | 6 | 7 | pub fn init() { 8 | let jaeger_layer = if let Ok(agent_endpoint) = std::env::var("JAEGER_AGENT_ENDPOINT") { 9 | Some(tracing_opentelemetry::layer().with_tracer(opentelemetry_jaeger::new_pipeline() 10 | .with_service_name("liteserver") 11 | .with_agent_endpoint(agent_endpoint) 12 | .install_simple().expect("jaeger tracer must initialize"))) 13 | } else { None }; 14 | 15 | let stdout_layer = tracing_subscriber::fmt::layer().with_span_events(FmtSpan::CLOSE).with_filter( 16 | EnvFilter::builder() 17 | .with_default_directive(tracing::Level::INFO.into()) 18 | .from_env_lossy(), 19 | ); 20 | 21 | if let Some(jaeger_layer) = jaeger_layer { 22 | tracing_subscriber::registry() 23 | .with(stdout_layer) 24 | .with(jaeger_layer) 25 | .try_init().expect("Failed to register tracer with registry"); 26 | } else { 27 | tracing_subscriber::registry() 28 | .with(stdout_layer) 29 | .try_init().expect("Failed to register tracer with registry"); 30 | } 31 | } 32 | 33 | pub fn shutdown() { 34 | opentelemetry::global::shutdown_tracer_provider(); 35 | } -------------------------------------------------------------------------------- /src/tvm.rs: -------------------------------------------------------------------------------- 1 | use std::ffi::{c_void, CStr, CString}; 2 | 3 | use base64::Engine as _; 4 | use ton_liteapi::tl::common::AccountId; 5 | use tonlib_sys::*; 6 | 7 | #[derive(Default)] 8 | pub struct EmulatorBuilder { 9 | code: CString, 10 | data: CString, 11 | libs: Option, 12 | c7: Option<(CString, u32, u64, CString, CString)>, 13 | gas_limit: Option, 14 | debug: Option, 15 | } 16 | 17 | impl EmulatorBuilder { 18 | pub fn new(code: &[u8], data: &[u8]) -> Self { 19 | Self { 20 | code: b64(code), 21 | data: b64(data), 22 | ..Default::default() 23 | } 24 | } 25 | 26 | pub fn with_libs(mut self, libs: &[u8]) -> Self { 27 | self.libs = Some(b64(libs)); 28 | self 29 | } 30 | 31 | pub fn with_c7(mut self, address: &AccountId, unixtime: u32, balance: u64, rand_seed: &[u8], config: &[u8]) -> Self { 32 | let address = CString::new(address.workchain.to_string() + ":" + &address.id.to_hex()).unwrap(); // does not contain nul 33 | self.c7 = Some((address, unixtime, balance, hex(rand_seed), b64(config))); 34 | self 35 | } 36 | 37 | pub fn with_gas_limit(mut self, gas_limit: u64) -> Self { 38 | self.gas_limit = Some(gas_limit); 39 | self 40 | } 41 | 42 | pub fn with_debug(mut self, debug: bool) -> Self { 43 | self.debug = Some(debug); 44 | self 45 | } 46 | 47 | fn build(self) -> *mut c_void { 48 | let emulator = unsafe { tvm_emulator_create(self.code.as_ptr(), self.data.as_ptr(), 10) }; 49 | unsafe { 50 | if let Some(libs) = self.libs { 51 | tracing::info!(?libs, "set libraries"); 52 | tvm_emulator_set_libraries(emulator, libs.as_ptr()); 53 | } 54 | if let Some((address, unixtime, balance, rand_seed, config)) = self.c7 { 55 | tracing::info!(?address, ?unixtime, ?balance, ?rand_seed, ?config, "set c7"); 56 | //tvm_emulator_set_c7(emulator, address.as_ptr(), unixtime, balance, rand_seed.as_ptr(), config.as_ptr()); 57 | } 58 | if let Some(gas_limit) = self.gas_limit { 59 | tracing::info!(?gas_limit, "set gas limit"); 60 | tvm_emulator_set_gas_limit(emulator, gas_limit); 61 | } 62 | if let Some(debug) = self.debug { 63 | tracing::info!("set debug"); 64 | tvm_emulator_set_debug_enabled(emulator, debug as i32); 65 | } 66 | } 67 | emulator 68 | } 69 | 70 | pub fn run_external(self, message: &[u8]) -> TvmEmulatorSendExternalMessageResult { 71 | let emulator = self.build(); 72 | let message = b64(message); 73 | let result = unsafe { 74 | let result = tvm_emulator_send_external_message(emulator, message.as_ptr()); 75 | CStr::from_ptr(result).to_str().unwrap().to_string() 76 | }; 77 | unsafe { tvm_emulator_destroy(emulator); } 78 | serde_json::from_str(&result).unwrap() 79 | } 80 | 81 | pub fn run_get_method(self, method_id: i32, stack_boc: &[u8]) -> TvmEmulatorRunGetMethodResult { 82 | let emulator = self.build(); 83 | let stack_boc = b64(stack_boc); 84 | tracing::info!(?stack_boc, ?method_id, "run get method"); 85 | let result = unsafe { 86 | let result = tvm_emulator_run_get_method(emulator, method_id, stack_boc.as_ptr()); 87 | CStr::from_ptr(result).to_str().unwrap().to_string() 88 | }; 89 | tracing::info!(?result, "run get method result"); 90 | unsafe { tvm_emulator_destroy(emulator); } 91 | serde_json::from_str(&result).unwrap() 92 | } 93 | } 94 | 95 | fn b64(input: &[u8]) -> CString { 96 | let output = base64::engine::general_purpose::STANDARD.encode(input); 97 | // output is not containing nul byte, because it is base64-encoded 98 | CString::new(output).unwrap() 99 | } 100 | 101 | fn hex(input: &[u8]) -> CString { 102 | let output = hex::encode(input); 103 | // output is not containing nul byte, because it is hex-encoded 104 | CString::new(output).unwrap() 105 | } 106 | 107 | use serde::{Deserialize, Serialize}; 108 | 109 | #[derive(Serialize, Deserialize, Debug)] 110 | #[serde(untagged)] 111 | pub enum TvmEmulatorRunGetMethodResult { 112 | Error(TvmEmulatorError), 113 | Success(TvmEmulatorRunGetMethodSuccess), 114 | } 115 | 116 | #[derive(Serialize, Deserialize, Debug)] 117 | #[serde(untagged)] 118 | pub enum TvmEmulatorSendExternalMessageResult { 119 | Error(TvmEmulatorError), 120 | Success(TvmEmulatorSendExternalMessageSuccess), 121 | } 122 | 123 | #[derive(Serialize, Deserialize, Debug)] 124 | pub struct TvmEmulatorError { 125 | pub success: IsSuccess, 126 | pub error: String, 127 | } 128 | 129 | #[derive(Serialize, Deserialize, Debug)] 130 | pub struct TvmEmulatorRunGetMethodSuccess { 131 | pub success: IsSuccess, 132 | pub vm_log: String, 133 | pub vm_exit_code: i32, 134 | pub stack: String, 135 | pub missing_library: Option, 136 | pub gas_used: String, 137 | } 138 | 139 | #[derive(Serialize, Deserialize, Debug)] 140 | pub struct TvmEmulatorSendExternalMessageSuccess { 141 | pub success: IsSuccess, 142 | pub new_code: String, 143 | pub new_data: String, 144 | pub accepted: bool, 145 | pub vm_exit_code: i32, 146 | pub vm_log: String, 147 | pub missing_library: Option, 148 | pub gas_used: u64, 149 | pub actions: String, 150 | } 151 | 152 | #[derive(Debug)] 153 | pub struct IsSuccess; 154 | 155 | impl Serialize for IsSuccess { 156 | fn serialize(&self, serializer: S) -> Result 157 | where 158 | S: serde::Serializer, 159 | { 160 | serializer.serialize_bool(V) 161 | } 162 | } 163 | 164 | impl<'de, const V: bool> Deserialize<'de> for IsSuccess { 165 | fn deserialize(deserializer: D) -> Result 166 | where 167 | D: serde::Deserializer<'de>, 168 | { 169 | let value = bool::deserialize(deserializer)?; 170 | if value == V { 171 | Ok(IsSuccess::) 172 | } else { 173 | Err(serde::de::Error::custom("Expected another success value")) 174 | } 175 | } 176 | } 177 | 178 | #[cfg(test)] 179 | mod tests { 180 | use super::*; 181 | 182 | #[test] 183 | fn test_jsons() { 184 | let x: TvmEmulatorRunGetMethodResult = serde_json::from_str(r#" 185 | { 186 | "success": true, 187 | "vm_log": "...", 188 | "vm_exit_code": 0, 189 | "stack": "Base64 encoded BoC serialized stack (VmStack)", 190 | "missing_library": null, 191 | "gas_used": 1212 192 | } 193 | "#).unwrap(); 194 | println!("{:?}", x); 195 | let x: TvmEmulatorRunGetMethodResult = serde_json::from_str(r#" 196 | { 197 | "success": false, 198 | "error": "Error description" 199 | }"#).unwrap(); 200 | println!("{:?}", x); 201 | let x: TvmEmulatorSendExternalMessageResult = serde_json::from_str(r#" 202 | { 203 | "success": true, 204 | "new_code": "Base64 boc decoded new code cell", 205 | "new_data": "Base64 boc decoded new data cell", 206 | "accepted": true, 207 | "vm_exit_code": 0, 208 | "vm_log": "...", 209 | "missing_library": null, 210 | "gas_used": 1212, 211 | "actions": "Base64 boc decoded actions cell of type (OutList n)" 212 | } 213 | "#).unwrap(); 214 | println!("{:?}", x); 215 | } 216 | 217 | #[test] 218 | fn test_run_get_method() { 219 | let result = EmulatorBuilder::new( 220 | &hex::decode("b5ee9c72010214010002d4000114ff00f4a413f4bcf2c80b010201200203020148040504f8f28308d71820d31fd31fd31f02f823bbf264ed44d0d31fd31fd3fff404d15143baf2a15151baf2a205f901541064f910f2a3f80024a4c8cb1f5240cb1f5230cbff5210f400c9ed54f80f01d30721c0009f6c519320d74a96d307d402fb00e830e021c001e30021c002e30001c0039130e30d03a4c8cb1f12cb1fcbff1011121302e6d001d0d3032171b0925f04e022d749c120925f04e002d31f218210706c7567bd22821064737472bdb0925f05e003fa403020fa4401c8ca07cbffc9d0ed44d0810140d721f404305c810108f40a6fa131b3925f07e005d33fc8258210706c7567ba923830e30d03821064737472ba925f06e30d06070201200809007801fa00f40430f8276f2230500aa121bef2e0508210706c7567831eb17080185004cb0526cf1658fa0219f400cb6917cb1f5260cb3f20c98040fb0006008a5004810108f45930ed44d0810140d720c801cf16f400c9ed540172b08e23821064737472831eb17080185005cb055003cf1623fa0213cb6acb1fcb3fc98040fb00925f03e20201200a0b0059bd242b6f6a2684080a06b90fa0218470d4080847a4937d29910ce6903e9ff9837812801b7810148987159f31840201580c0d0011b8c97ed44d0d70b1f8003db29dfb513420405035c87d010c00b23281f2fff274006040423d029be84c600201200e0f0019adce76a26840206b90eb85ffc00019af1df6a26840106b90eb858fc0006ed207fa00d4d422f90005c8ca0715cbffc9d077748018c8cb05cb0222cf165005fa0214cb6b12ccccc973fb00c84014810108f451f2a7020070810108d718fa00d33fc8542047810108f451f2a782106e6f746570748018c8cb05cb025006cf165004fa0214cb6a12cb1fcb3fc973fb0002006c810108d718fa00d33f305224810108f459f2a782106473747270748018c8cb05cb025005cf165003fa0213cb6acb1f12cb3fc973fb00000af400c9ed54").unwrap(), 221 | &hex::decode("b5ee9c7201010101002b0000510000009629a9a31729a335f44b54ab056e34d0de7bcad14abc71400a24e1f785217ec138d2dffbda40").unwrap() 222 | ).run_get_method(85143, &hex::decode("b5ee9c7201010101002b0000510000009629a9a31729a335f44b54ab056e34d0de7bcad14abc71400a24e1f785217ec138d2dffbda40").unwrap()); 223 | println!("{:?}", result); 224 | } 225 | } -------------------------------------------------------------------------------- /src/utils.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use ton_block::{Augmentable, Augmentation, Deserializable, HashmapAugType, Serializable, TraverseNextStep}; 3 | use ton_types::BuilderData; 4 | 5 | pub trait HashmapAugIterator { 6 | fn iterate_ext(&self, reverse_order: bool, start_after: Option, p: F) -> Result where F: FnMut(K, X) -> Result; 7 | } 8 | 9 | impl< 10 | K: Deserializable + Serializable, 11 | X: Deserializable + Serializable + Augmentation, 12 | Y: Augmentable, 13 | T: HashmapAugType 14 | > HashmapAugIterator for T { 15 | fn iterate_ext(&self, reverse_order: bool, start_after: Option, mut p: F) -> Result where F: FnMut(K, X) -> Result { 16 | let after_cell_opt = start_after.map(|start| start.write_to_new_cell()).transpose()?; 17 | let is_complete = self.traverse(|prefix, prefix_len, _, value_opt| { 18 | let prefix = BuilderData::with_raw(prefix.into(), prefix_len)?; 19 | if let Some(after_cell) = &after_cell_opt { 20 | match prefix.compare_data(after_cell)? { 21 | (Some(_), None) => unreachable!("prefix can't include full key"), 22 | // do not visit branches that are smaller than `after` (for direct order) or bigger than `after` (for reverse order) 23 | (None, Some(next_bit)) => if !reverse_order && next_bit == 1 { 24 | return Ok(TraverseNextStep::VisitOne) 25 | } else if reverse_order && next_bit == 0 { 26 | return Ok(TraverseNextStep::VisitZero) 27 | }, 28 | // in previous match arm we are still going to `after` value, but it can be not present, 29 | // so we can accidentally run into unneeded branches, stop it here 30 | (Some(n1), Some(n2)) => if !reverse_order && n1 < n2 || reverse_order && n1 > n2 { 31 | return Ok(TraverseNextStep::Stop) 32 | }, 33 | // stop if we found `after` 34 | (None, None) => return Ok(TraverseNextStep::Stop), 35 | } 36 | } 37 | if let Some(value) = value_opt { 38 | let should_continue = p(K::construct_from_cell(prefix.into_cell()?)?, value)?; 39 | if !should_continue { 40 | // if hashmap iteration was interrupted, return Some(()). otherwise, None will be returned on complete 41 | return Ok(TraverseNextStep::End(())); 42 | } 43 | } 44 | Ok(if reverse_order { 45 | TraverseNextStep::VisitOneZero 46 | } else { 47 | TraverseNextStep::VisitZeroOne 48 | }) 49 | })?.is_none(); 50 | Ok(is_complete) 51 | } 52 | } 53 | 54 | #[test] 55 | fn test_hashmap_iterator() -> Result<()> { 56 | use ton_block::*; 57 | use ton_types::*; 58 | let mut transactions = Transactions::new(); 59 | let acc = Account::with_address(ton_block::MsgAddressInt::AddrStd(MsgAddrStd::with_address(None, 0, AccountId::from_string("0000000000000000000000000000000000000000000000000000000000000000")?))); 60 | let msg = Message::with_ext_in_header(ExternalInboundMessageHeader::default()); 61 | for i in 0..100 { 62 | transactions.insert(&Transaction::with_account_and_message(&acc, &msg, i)?)?; 63 | } 64 | let test_data: Vec<(bool, Option, Vec)> = vec![ 65 | (true, Some(40), (0..40).rev().collect()), 66 | (true, Some(70), (0..70).rev().collect()), 67 | (false, Some(30), (31..100).collect()), 68 | (false, Some(0), (1..100).collect()), 69 | (false, Some(99), vec![]), 70 | (false, Some(100), vec![]), 71 | (false, Some(101), vec![]), 72 | (false, Some(1000), vec![]), 73 | (false, Some(98), vec![99]), 74 | (false, Some(97), vec![98, 99]), 75 | (true, Some(1), vec![0]), 76 | (true, Some(2), vec![1, 0]), 77 | (true, Some(0), vec![]), 78 | (true, Some(1000), (0..100).rev().collect()), 79 | (true, Some(100), (0..100).rev().collect()), 80 | (true, Some(99), (0..99).rev().collect()), 81 | (true, None, (0..100).rev().collect()), 82 | (false, None, (0..100).collect()), 83 | ]; 84 | for (reverse_order, start_after, expected_keys) in test_data { 85 | let mut result = Vec::new(); 86 | transactions.iterate_ext(reverse_order, start_after, |_, InRefValue(value)| { 87 | result.push(value.lt); 88 | Ok(true) 89 | })?; 90 | assert_eq!(result, expected_keys, "test case is rev={reverse_order}, after={start_after:?}"); 91 | } 92 | Ok(()) 93 | } -------------------------------------------------------------------------------- /src/web.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use anyhow::Result; 4 | use axum::{ 5 | body::Body, extract::State, http::{Response, StatusCode}, response::IntoResponse, routing::get, Router 6 | }; 7 | use metrics_exporter_prometheus::{PrometheusHandle, PrometheusRecorder}; 8 | use prometheus::{Encoder, TextEncoder}; 9 | use ton_indexer::Engine; 10 | 11 | pub async fn run(engine: Arc, recorder: PrometheusHandle) -> Result<()> { 12 | let app = Router::new() 13 | .route("/metrics", get(get_metrics)) 14 | .with_state(Arc::new(AppState { engine, recorder })); 15 | let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await?; 16 | tokio::spawn(async move { 17 | axum::serve(listener, app).await.unwrap(); 18 | }); 19 | Ok(()) 20 | } 21 | 22 | struct AppState { 23 | engine: Arc, 24 | recorder: PrometheusHandle, 25 | } 26 | 27 | async fn get_metrics(State(state): State>) -> Result { 28 | let encoder = TextEncoder::new(); 29 | let mut buffer = vec![]; 30 | let metrics = prometheus::gather(); 31 | encoder.encode(&metrics, &mut buffer)?; 32 | let mut response = String::from_utf8(buffer)?; 33 | response += "\n\n# engine metrics\n\n"; 34 | response += &state.recorder.render(); 35 | Ok(response) 36 | } 37 | 38 | struct AppError(anyhow::Error); 39 | 40 | impl IntoResponse for AppError { 41 | fn into_response(self) -> Response { 42 | ( 43 | StatusCode::INTERNAL_SERVER_ERROR, 44 | format!("Something went wrong: {}", self.0), 45 | ) 46 | .into_response() 47 | } 48 | } 49 | 50 | impl From for AppError 51 | where 52 | E: Into, 53 | { 54 | fn from(err: E) -> Self { 55 | Self(err.into()) 56 | } 57 | } 58 | --------------------------------------------------------------------------------