├── .gitignore ├── .vscode └── settings.json ├── Cargo.lock ├── Cargo.toml ├── README.md ├── metrics ├── Cargo.toml └── src │ └── main.rs ├── nodeapi ├── Cargo.toml ├── README.md └── src │ └── main.rs ├── services ├── Cargo.toml └── src │ └── main.rs └── signer ├── Cargo.toml └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "rust-analyzer.linkedProjects": ["./nodeapi/Cargo.toml"] 3 | } 4 | -------------------------------------------------------------------------------- /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.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 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 = "async-trait" 22 | version = "0.1.79" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" 25 | dependencies = [ 26 | "proc-macro2", 27 | "quote", 28 | "syn", 29 | ] 30 | 31 | [[package]] 32 | name = "axum" 33 | version = "0.7.5" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" 36 | dependencies = [ 37 | "async-trait", 38 | "axum-core", 39 | "bytes", 40 | "futures-util", 41 | "http", 42 | "http-body", 43 | "http-body-util", 44 | "hyper", 45 | "hyper-util", 46 | "itoa", 47 | "matchit", 48 | "memchr", 49 | "mime", 50 | "percent-encoding", 51 | "pin-project-lite", 52 | "rustversion", 53 | "serde", 54 | "serde_json", 55 | "serde_path_to_error", 56 | "serde_urlencoded", 57 | "sync_wrapper 1.0.0", 58 | "tokio", 59 | "tower", 60 | "tower-layer", 61 | "tower-service", 62 | "tracing", 63 | ] 64 | 65 | [[package]] 66 | name = "axum-core" 67 | version = "0.4.3" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" 70 | dependencies = [ 71 | "async-trait", 72 | "bytes", 73 | "futures-util", 74 | "http", 75 | "http-body", 76 | "http-body-util", 77 | "mime", 78 | "pin-project-lite", 79 | "rustversion", 80 | "sync_wrapper 0.1.2", 81 | "tower-layer", 82 | "tower-service", 83 | "tracing", 84 | ] 85 | 86 | [[package]] 87 | name = "backtrace" 88 | version = "0.3.71" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" 91 | dependencies = [ 92 | "addr2line", 93 | "cc", 94 | "cfg-if", 95 | "libc", 96 | "miniz_oxide", 97 | "object", 98 | "rustc-demangle", 99 | ] 100 | 101 | [[package]] 102 | name = "bytes" 103 | version = "1.6.0" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" 106 | 107 | [[package]] 108 | name = "cc" 109 | version = "1.0.90" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" 112 | 113 | [[package]] 114 | name = "cfg-if" 115 | version = "1.0.0" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 118 | 119 | [[package]] 120 | name = "fnv" 121 | version = "1.0.7" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 124 | 125 | [[package]] 126 | name = "form_urlencoded" 127 | version = "1.2.1" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 130 | dependencies = [ 131 | "percent-encoding", 132 | ] 133 | 134 | [[package]] 135 | name = "futures-channel" 136 | version = "0.3.30" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 139 | dependencies = [ 140 | "futures-core", 141 | ] 142 | 143 | [[package]] 144 | name = "futures-core" 145 | version = "0.3.30" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 148 | 149 | [[package]] 150 | name = "futures-task" 151 | version = "0.3.30" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 154 | 155 | [[package]] 156 | name = "futures-util" 157 | version = "0.3.30" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 160 | dependencies = [ 161 | "futures-core", 162 | "futures-task", 163 | "pin-project-lite", 164 | "pin-utils", 165 | ] 166 | 167 | [[package]] 168 | name = "gimli" 169 | version = "0.28.1" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" 172 | 173 | [[package]] 174 | name = "hermit-abi" 175 | version = "0.3.9" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 178 | 179 | [[package]] 180 | name = "http" 181 | version = "1.1.0" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 184 | dependencies = [ 185 | "bytes", 186 | "fnv", 187 | "itoa", 188 | ] 189 | 190 | [[package]] 191 | name = "http-body" 192 | version = "1.0.0" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" 195 | dependencies = [ 196 | "bytes", 197 | "http", 198 | ] 199 | 200 | [[package]] 201 | name = "http-body-util" 202 | version = "0.1.1" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" 205 | dependencies = [ 206 | "bytes", 207 | "futures-core", 208 | "http", 209 | "http-body", 210 | "pin-project-lite", 211 | ] 212 | 213 | [[package]] 214 | name = "httparse" 215 | version = "1.8.0" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 218 | 219 | [[package]] 220 | name = "httpdate" 221 | version = "1.0.3" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 224 | 225 | [[package]] 226 | name = "hyper" 227 | version = "1.2.0" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" 230 | dependencies = [ 231 | "bytes", 232 | "futures-channel", 233 | "futures-util", 234 | "http", 235 | "http-body", 236 | "httparse", 237 | "httpdate", 238 | "itoa", 239 | "pin-project-lite", 240 | "smallvec", 241 | "tokio", 242 | ] 243 | 244 | [[package]] 245 | name = "hyper-util" 246 | version = "0.1.3" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" 249 | dependencies = [ 250 | "bytes", 251 | "futures-util", 252 | "http", 253 | "http-body", 254 | "hyper", 255 | "pin-project-lite", 256 | "socket2", 257 | "tokio", 258 | ] 259 | 260 | [[package]] 261 | name = "itoa" 262 | version = "1.0.11" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 265 | 266 | [[package]] 267 | name = "libc" 268 | version = "0.2.153" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 271 | 272 | [[package]] 273 | name = "log" 274 | version = "0.4.21" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 277 | 278 | [[package]] 279 | name = "matchit" 280 | version = "0.7.3" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 283 | 284 | [[package]] 285 | name = "memchr" 286 | version = "2.7.2" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 289 | 290 | [[package]] 291 | name = "metrics" 292 | version = "0.1.0" 293 | 294 | [[package]] 295 | name = "mime" 296 | version = "0.3.17" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 299 | 300 | [[package]] 301 | name = "miniz_oxide" 302 | version = "0.7.2" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" 305 | dependencies = [ 306 | "adler", 307 | ] 308 | 309 | [[package]] 310 | name = "mio" 311 | version = "0.8.11" 312 | source = "registry+https://github.com/rust-lang/crates.io-index" 313 | checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" 314 | dependencies = [ 315 | "libc", 316 | "wasi", 317 | "windows-sys 0.48.0", 318 | ] 319 | 320 | [[package]] 321 | name = "nodeapi" 322 | version = "0.1.0" 323 | dependencies = [ 324 | "axum", 325 | "serde", 326 | "serde_json", 327 | "tokio", 328 | ] 329 | 330 | [[package]] 331 | name = "num_cpus" 332 | version = "1.16.0" 333 | source = "registry+https://github.com/rust-lang/crates.io-index" 334 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 335 | dependencies = [ 336 | "hermit-abi", 337 | "libc", 338 | ] 339 | 340 | [[package]] 341 | name = "object" 342 | version = "0.32.2" 343 | source = "registry+https://github.com/rust-lang/crates.io-index" 344 | checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" 345 | dependencies = [ 346 | "memchr", 347 | ] 348 | 349 | [[package]] 350 | name = "once_cell" 351 | version = "1.19.0" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 354 | 355 | [[package]] 356 | name = "percent-encoding" 357 | version = "2.3.1" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 360 | 361 | [[package]] 362 | name = "pin-project" 363 | version = "1.1.5" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" 366 | dependencies = [ 367 | "pin-project-internal", 368 | ] 369 | 370 | [[package]] 371 | name = "pin-project-internal" 372 | version = "1.1.5" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" 375 | dependencies = [ 376 | "proc-macro2", 377 | "quote", 378 | "syn", 379 | ] 380 | 381 | [[package]] 382 | name = "pin-project-lite" 383 | version = "0.2.14" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 386 | 387 | [[package]] 388 | name = "pin-utils" 389 | version = "0.1.0" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 392 | 393 | [[package]] 394 | name = "proc-macro2" 395 | version = "1.0.79" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" 398 | dependencies = [ 399 | "unicode-ident", 400 | ] 401 | 402 | [[package]] 403 | name = "quote" 404 | version = "1.0.35" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 407 | dependencies = [ 408 | "proc-macro2", 409 | ] 410 | 411 | [[package]] 412 | name = "rustc-demangle" 413 | version = "0.1.23" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 416 | 417 | [[package]] 418 | name = "rustversion" 419 | version = "1.0.14" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 422 | 423 | [[package]] 424 | name = "ryu" 425 | version = "1.0.17" 426 | source = "registry+https://github.com/rust-lang/crates.io-index" 427 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 428 | 429 | [[package]] 430 | name = "serde" 431 | version = "1.0.197" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" 434 | dependencies = [ 435 | "serde_derive", 436 | ] 437 | 438 | [[package]] 439 | name = "serde_derive" 440 | version = "1.0.197" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" 443 | dependencies = [ 444 | "proc-macro2", 445 | "quote", 446 | "syn", 447 | ] 448 | 449 | [[package]] 450 | name = "serde_json" 451 | version = "1.0.115" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" 454 | dependencies = [ 455 | "itoa", 456 | "ryu", 457 | "serde", 458 | ] 459 | 460 | [[package]] 461 | name = "serde_path_to_error" 462 | version = "0.1.16" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" 465 | dependencies = [ 466 | "itoa", 467 | "serde", 468 | ] 469 | 470 | [[package]] 471 | name = "serde_urlencoded" 472 | version = "0.7.1" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 475 | dependencies = [ 476 | "form_urlencoded", 477 | "itoa", 478 | "ryu", 479 | "serde", 480 | ] 481 | 482 | [[package]] 483 | name = "services" 484 | version = "0.1.0" 485 | 486 | [[package]] 487 | name = "signal-hook-registry" 488 | version = "1.4.1" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 491 | dependencies = [ 492 | "libc", 493 | ] 494 | 495 | [[package]] 496 | name = "signer" 497 | version = "0.1.0" 498 | 499 | [[package]] 500 | name = "smallvec" 501 | version = "1.13.2" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 504 | 505 | [[package]] 506 | name = "socket2" 507 | version = "0.5.6" 508 | source = "registry+https://github.com/rust-lang/crates.io-index" 509 | checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" 510 | dependencies = [ 511 | "libc", 512 | "windows-sys 0.52.0", 513 | ] 514 | 515 | [[package]] 516 | name = "syn" 517 | version = "2.0.57" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" 520 | dependencies = [ 521 | "proc-macro2", 522 | "quote", 523 | "unicode-ident", 524 | ] 525 | 526 | [[package]] 527 | name = "sync_wrapper" 528 | version = "0.1.2" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 531 | 532 | [[package]] 533 | name = "sync_wrapper" 534 | version = "1.0.0" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" 537 | 538 | [[package]] 539 | name = "tokio" 540 | version = "1.37.0" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" 543 | dependencies = [ 544 | "backtrace", 545 | "libc", 546 | "mio", 547 | "num_cpus", 548 | "pin-project-lite", 549 | "signal-hook-registry", 550 | "socket2", 551 | "tokio-macros", 552 | "windows-sys 0.48.0", 553 | ] 554 | 555 | [[package]] 556 | name = "tokio-macros" 557 | version = "2.2.0" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" 560 | dependencies = [ 561 | "proc-macro2", 562 | "quote", 563 | "syn", 564 | ] 565 | 566 | [[package]] 567 | name = "tower" 568 | version = "0.4.13" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 571 | dependencies = [ 572 | "futures-core", 573 | "futures-util", 574 | "pin-project", 575 | "pin-project-lite", 576 | "tokio", 577 | "tower-layer", 578 | "tower-service", 579 | "tracing", 580 | ] 581 | 582 | [[package]] 583 | name = "tower-layer" 584 | version = "0.3.2" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 587 | 588 | [[package]] 589 | name = "tower-service" 590 | version = "0.3.2" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 593 | 594 | [[package]] 595 | name = "tracing" 596 | version = "0.1.40" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 599 | dependencies = [ 600 | "log", 601 | "pin-project-lite", 602 | "tracing-core", 603 | ] 604 | 605 | [[package]] 606 | name = "tracing-core" 607 | version = "0.1.32" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 610 | dependencies = [ 611 | "once_cell", 612 | ] 613 | 614 | [[package]] 615 | name = "unicode-ident" 616 | version = "1.0.12" 617 | source = "registry+https://github.com/rust-lang/crates.io-index" 618 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 619 | 620 | [[package]] 621 | name = "wasi" 622 | version = "0.11.0+wasi-snapshot-preview1" 623 | source = "registry+https://github.com/rust-lang/crates.io-index" 624 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 625 | 626 | [[package]] 627 | name = "windows-sys" 628 | version = "0.48.0" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 631 | dependencies = [ 632 | "windows-targets 0.48.5", 633 | ] 634 | 635 | [[package]] 636 | name = "windows-sys" 637 | version = "0.52.0" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 640 | dependencies = [ 641 | "windows-targets 0.52.4", 642 | ] 643 | 644 | [[package]] 645 | name = "windows-targets" 646 | version = "0.48.5" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 649 | dependencies = [ 650 | "windows_aarch64_gnullvm 0.48.5", 651 | "windows_aarch64_msvc 0.48.5", 652 | "windows_i686_gnu 0.48.5", 653 | "windows_i686_msvc 0.48.5", 654 | "windows_x86_64_gnu 0.48.5", 655 | "windows_x86_64_gnullvm 0.48.5", 656 | "windows_x86_64_msvc 0.48.5", 657 | ] 658 | 659 | [[package]] 660 | name = "windows-targets" 661 | version = "0.52.4" 662 | source = "registry+https://github.com/rust-lang/crates.io-index" 663 | checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" 664 | dependencies = [ 665 | "windows_aarch64_gnullvm 0.52.4", 666 | "windows_aarch64_msvc 0.52.4", 667 | "windows_i686_gnu 0.52.4", 668 | "windows_i686_msvc 0.52.4", 669 | "windows_x86_64_gnu 0.52.4", 670 | "windows_x86_64_gnullvm 0.52.4", 671 | "windows_x86_64_msvc 0.52.4", 672 | ] 673 | 674 | [[package]] 675 | name = "windows_aarch64_gnullvm" 676 | version = "0.48.5" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 679 | 680 | [[package]] 681 | name = "windows_aarch64_gnullvm" 682 | version = "0.52.4" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" 685 | 686 | [[package]] 687 | name = "windows_aarch64_msvc" 688 | version = "0.48.5" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 691 | 692 | [[package]] 693 | name = "windows_aarch64_msvc" 694 | version = "0.52.4" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" 697 | 698 | [[package]] 699 | name = "windows_i686_gnu" 700 | version = "0.48.5" 701 | source = "registry+https://github.com/rust-lang/crates.io-index" 702 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 703 | 704 | [[package]] 705 | name = "windows_i686_gnu" 706 | version = "0.52.4" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" 709 | 710 | [[package]] 711 | name = "windows_i686_msvc" 712 | version = "0.48.5" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 715 | 716 | [[package]] 717 | name = "windows_i686_msvc" 718 | version = "0.52.4" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" 721 | 722 | [[package]] 723 | name = "windows_x86_64_gnu" 724 | version = "0.48.5" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 727 | 728 | [[package]] 729 | name = "windows_x86_64_gnu" 730 | version = "0.52.4" 731 | source = "registry+https://github.com/rust-lang/crates.io-index" 732 | checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" 733 | 734 | [[package]] 735 | name = "windows_x86_64_gnullvm" 736 | version = "0.48.5" 737 | source = "registry+https://github.com/rust-lang/crates.io-index" 738 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 739 | 740 | [[package]] 741 | name = "windows_x86_64_gnullvm" 742 | version = "0.52.4" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" 745 | 746 | [[package]] 747 | name = "windows_x86_64_msvc" 748 | version = "0.48.5" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 751 | 752 | [[package]] 753 | name = "windows_x86_64_msvc" 754 | version = "0.52.4" 755 | source = "registry+https://github.com/rust-lang/crates.io-index" 756 | checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" 757 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | name = "eigenlayer-rs" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | 7 | members = ["nodeapi", "signer", "services", "metrics"] 8 | 9 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 10 | 11 | # [dependencies] 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## eigenlayer-rs 2 | 3 | A rust port of https://github.com/Layr-Labs/eigensdk-go -------------------------------------------------------------------------------- /metrics/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "metrics" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /metrics/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /nodeapi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "nodeapi" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | axum = "0.7.5" 10 | serde = { version = "1.0.197", features = ["derive"] } 11 | serde_json = "1.0.115" 12 | tokio = { version = "1.37.0", features = ["signal", "rt-multi-thread"] } 13 | -------------------------------------------------------------------------------- /nodeapi/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/distributedstatemachine/eigenlayer-rs/b5061e48001461766f6c2ad994bc0ba29e1df336/nodeapi/README.md -------------------------------------------------------------------------------- /nodeapi/src/main.rs: -------------------------------------------------------------------------------- 1 | use axum::extract::Path; 2 | use axum::Extension; 3 | use axum::{http::StatusCode, routing::get, Json, Router}; 4 | use serde::{Deserialize, Serialize}; 5 | use serde_json::json; 6 | use std::net::SocketAddr; 7 | use std::sync::{Arc, Mutex}; 8 | use tokio::signal; 9 | 10 | #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 11 | enum NodeHealth { 12 | Healthy, 13 | PartiallyHealthy, 14 | Unhealthy, 15 | } 16 | 17 | #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 18 | enum ServiceStatus { 19 | Up, 20 | Down, 21 | Initializing, 22 | } 23 | 24 | #[derive(Debug, Clone, Serialize, Deserialize)] 25 | struct NodeService { 26 | id: String, 27 | name: String, 28 | description: String, 29 | status: ServiceStatus, 30 | } 31 | 32 | #[derive(Clone)] 33 | struct NodeApi { 34 | avs_node_name: String, 35 | avs_node_sem_ver: String, 36 | health: Arc>, 37 | node_services: Arc>>, 38 | } 39 | 40 | impl NodeApi { 41 | async fn node_handler(Extension(api): Extension>) -> Json { 42 | Json(json!({ 43 | "node_name": api.avs_node_name, 44 | "spec_version": "v0.0.1", 45 | "node_version": api.avs_node_sem_ver, 46 | })) 47 | } 48 | 49 | async fn health_handler(Extension(api): Extension>) -> StatusCode { 50 | let health = api.health.lock().unwrap(); 51 | match *health { 52 | NodeHealth::Healthy => StatusCode::OK, 53 | NodeHealth::PartiallyHealthy => StatusCode::PARTIAL_CONTENT, 54 | NodeHealth::Unhealthy => StatusCode::SERVICE_UNAVAILABLE, 55 | } 56 | } 57 | 58 | async fn service_health_handler( 59 | Extension(api): Extension>, 60 | Path(service_id): Path, 61 | ) -> StatusCode { 62 | let services = api.node_services.lock().unwrap(); 63 | let service = services.iter().find(|s| s.id == service_id); 64 | 65 | match service { 66 | Some(s) => match s.status { 67 | ServiceStatus::Up => StatusCode::OK, 68 | ServiceStatus::Down => StatusCode::SERVICE_UNAVAILABLE, 69 | ServiceStatus::Initializing => StatusCode::PARTIAL_CONTENT, 70 | }, 71 | None => StatusCode::NOT_FOUND, 72 | } 73 | } 74 | } 75 | 76 | #[tokio::main] 77 | async fn main() { 78 | let api = Arc::new(NodeApi { 79 | avs_node_name: "NodeName".to_string(), 80 | avs_node_sem_ver: "v0.0.1".to_string(), 81 | health: Arc::new(Mutex::new(NodeHealth::Healthy)), 82 | node_services: Arc::new(Mutex::new(vec![])), 83 | }); 84 | 85 | let app = Router::new() 86 | .route("/node", get(NodeApi::node_handler)) 87 | .route("/node/health", get(NodeApi::health_handler)) 88 | .route( 89 | "/node/services/:service_id/health", 90 | get(NodeApi::service_health_handler), 91 | ) 92 | .layer(axum::Extension(api)); 93 | 94 | let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); 95 | let listener = tokio::net::TcpListener::bind(addr).await.unwrap(); 96 | println!("Listening on {}", addr); 97 | 98 | axum::serve(listener, app).await.unwrap(); 99 | } 100 | 101 | async fn shutdown_signal() { 102 | let _ = signal::ctrl_c() 103 | .await 104 | .expect("failed to install CTRL+C signal handler"); 105 | } 106 | -------------------------------------------------------------------------------- /services/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "services" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /services/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | -------------------------------------------------------------------------------- /signer/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "signer" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | -------------------------------------------------------------------------------- /signer/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | --------------------------------------------------------------------------------