From 3b4c82226a05bd090a7ba58534c859f31defc44a Mon Sep 17 00:00:00 2001 From: Nasr Date: Fri, 19 Jan 2024 17:17:02 -0500 Subject: [PATCH 1/9] feat: start integrating libp2p --- Cargo.lock | 2083 +++++++++++++++++++++++++++++++++++++++++++----- Cargo.toml | 8 +- dojo.h | 37 +- example/main.c | 51 +- src/libc.rs | 67 +- 5 files changed, 1965 insertions(+), 281 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9831b30..c82a8ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + [[package]] name = "aes" version = "0.8.3" @@ -28,6 +38,20 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + [[package]] name = "ahash" version = "0.8.7" @@ -141,6 +165,12 @@ dependencies = [ "rand", ] +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + [[package]] name = "arrayvec" version = "0.7.4" @@ -156,6 +186,45 @@ dependencies = [ "term", ] +[[package]] +name = "asn1-rs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits 0.2.17", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "assert_matches" version = "1.5.0" @@ -180,7 +249,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", - "event-listener 4.0.2", + "event-listener 4.0.3", "event-listener-strategy", "futures-core", "pin-project-lite", @@ -192,14 +261,26 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.3.0", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "slab", ] +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", +] + [[package]] name = "async-global-executor" version = "2.4.1" @@ -208,10 +289,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.1.1", "async-executor", - "async-io 2.2.2", - "async-lock 3.2.0", + "async-io 2.3.0", + "async-lock 3.3.0", "blocking", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "once_cell", ] @@ -237,18 +318,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.2.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "parking", - "polling 3.3.1", - "rustix 0.38.28", + "polling 3.3.2", + "rustix 0.38.30", "slab", "tracing", "windows-sys 0.52.0", @@ -265,15 +346,61 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 4.0.2", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite", ] +[[package]] +name = "async-net" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" +dependencies = [ + "async-io 1.13.0", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.30", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io 2.3.0", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.30", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", +] + [[package]] name = "async-std" version = "1.12.0" @@ -284,6 +411,7 @@ dependencies = [ "async-global-executor", "async-io 1.13.0", "async-lock 2.8.0", + "async-process", "crossbeam-utils", "futures-channel", "futures-core", @@ -300,6 +428,21 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "async-std-resolver" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0ed2b6671c13d2c28756c5a64e04759c1e0b5d3d7ac031f521c3561e21fbcb" +dependencies = [ + "async-std", + "async-trait", + "futures-io", + "futures-util", + "hickory-resolver", + "pin-utils", + "socket2 0.5.5", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -339,6 +482,19 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "asynchronous-codec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a860072022177f903e59730004fb5dc13db9275b79bb2aef7ba8ce831956c233" +dependencies = [ + "bytes", + "futures-sink", + "futures-util", + "memchr", + "pin-project-lite", +] + [[package]] name = "atoi" version = "2.0.0" @@ -360,10 +516,21 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" dependencies = [ - "nix", + "nix 0.27.1", "rand", ] +[[package]] +name = "attohttpc" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2" +dependencies = [ + "http", + "log", + "url", +] + [[package]] name = "atty" version = "0.2.14" @@ -453,6 +620,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base-x" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" + [[package]] name = "base16ct" version = "0.2.0" @@ -467,9 +640,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -512,9 +685,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" dependencies = [ "serde", ] @@ -531,6 +704,15 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -547,15 +729,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ "async-channel 2.1.1", - "async-lock 3.2.0", + "async-lock 3.3.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "piper", "tracing", ] +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.14.0" @@ -642,9 +833,9 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24abd6752c41f3d2276fba63fa0434875ccf6e7cbcdebfebc790db1201eb0892" +checksum = "40058b275150a66c15f39aa09f2a79be7acd089e526beca79ded7a29aafd0ae9" dependencies = [ "cairo-lang-utils", "indoc", @@ -659,9 +850,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5699f44b183ddc2982976efdd72bbdfafc13a64f9593b44eb86f8a335f3b90da" +checksum = "dd38cbddb149d5417b3b9a655489de356f29b15be2637e4270c95ea5fcc51e87" dependencies = [ "anyhow", "cairo-lang-defs", @@ -682,18 +873,18 @@ dependencies = [ [[package]] name = "cairo-lang-debug" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a52b381fab22b723818692fa93aafc2e1490a79a4c8bd856e8996f1253f16a8" +checksum = "22ea67db5af077ca6817d1db5020ab450f28aff2d3ffbc55b6d3a5132e9bc0e1" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d436dcaa5a3ea69f60b990036d23dc3e54adc623c14cff824cb1230f974ce44" +checksum = "ed0f8ddae7bebbec634f6b0a7040a1c58003ec13be541e00e5e7ded04788c6d2" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -708,9 +899,9 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07771c7268044b6a7be828a4f4938bb823944efe6668a974bf5e52a6801ef366" +checksum = "64269b3fd33c17920cb6b300257439a885b1251bddab78cfcfea02031ad10eb6" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -720,9 +911,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fc8c224c0aaadc01c961fac234e8d8d3563a8fbb8544186a69969765a0c2a5" +checksum = "15f57f448a8ccd1ff77f663941bd8310e3ce4e30fdcfd6ea4ee7d897df0fab04" dependencies = [ "cairo-lang-utils", "good_lp", @@ -730,9 +921,9 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d62a519bd68f158cd1b5ee2f1f1dc2aa916a8dcb14914444846d39ff8fb33789" +checksum = "439a6506fb2f749964aac614f5295aa4fa1e18123aea0d1e09a03ea0311b3847" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -744,9 +935,9 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989744e09f351ff24a0bc076dba8e3420ab957b99edc46acde58a484ebb09ed9" +checksum = "5c38232c57885ef108395e784aa0fc8d9e23a5a2b0f985484f10d6d9ef85c83e" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -770,9 +961,9 @@ dependencies = [ [[package]] name = "cairo-lang-parser" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5b262ae2d11b4d5783a8b66d8e31cbeab45bb4e14d6ddb13ba280e9c41824" +checksum = "1bcaec01565917823193ea2db9f239c5d496987a006f7be894fd757216d64d94" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -790,9 +981,9 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcfe1e269ab2027bad187d9c61c7e1e324374c722b75f3a7d7fba77c977f8ca" +checksum = "428c7ce26429eaf08afe7831aab3e61c5858e88250227cdabfec8307cd25bea2" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -809,9 +1000,9 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9bc4f93f28bda29d879acb9b9e26b32108591225a507ffb5aff9bbf58524c4f" +checksum = "97efc9847766adc92e0c6f21dfaab26960c66579978f5767c5995950b40b73c6" dependencies = [ "cairo-lang-debug", "quote", @@ -820,9 +1011,9 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d490a3d00dd45228c1691c390f177449b45a907a2cb4b3ad8f305faea82a0c" +checksum = "93b3ff44aee12e08955d2c107eb087cf3b238db8f3d306bdd2e3be95bb149880" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -834,9 +1025,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcc25adf813972129dcac6c7d87026d47644f3d4e975c042d27e1166a2a0489" +checksum = "a6cd57e7e6d437419643e075297532d98789f75d12824ee02ec4144278870bfc" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -859,9 +1050,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc9571dbb143e33979fc02d38bbb4d7b608d6f53cde585b08551bbedfb0c217" +checksum = "68a035e4b4b961df135fc3ef81c4b1d5e1efa19a6a3245862860a11856af46bc" dependencies = [ "anyhow", "cairo-lang-utils", @@ -884,9 +1075,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16894bfe0072f82b549e4b2be42c7dc8f0611ac5049dfb069b95b10c51ec7cb5" +checksum = "f68b38763f995b27b2fb824a90e43b5671af17e015af8dfeb13eabad8149eba2" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -898,9 +1089,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fbc8baef18b3c315d3fb7a0cf59f0ee14df5cefc7dd147598248cdb7b2252d" +checksum = "19187cf2ef439fa1abcc65dac87e408482ae8a124748558e2d760ab7ce5b7333" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -912,9 +1103,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75700bf5fd1c1cdd8ca29af338c65de8b03c905472f9bdce22b3034f3f3755d9" +checksum = "210fcedd39d513d4fdcd727156de179dc640ee27dca8e5bba076aa514cb70fe4" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -936,9 +1127,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0bc8edaf95bdb9577c6b801c36b24538ec08042e1d74b98fc08d50621427061" +checksum = "fdea72b0699e040c1a56ed89878904d44184fc66208ce3da77dc78d4e34c33f9" dependencies = [ "assert_matches", "cairo-felt", @@ -957,9 +1148,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b028f3e06e150005e82b07500d4ea509ee8350f841d5645fbcf00bb49c4537" +checksum = "a70bd365647251e18669bb7e702a3e48455ba4d5712959ca11d16ddead65580b" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -967,9 +1158,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f55ffe2cbd277b6f3040e23bde028ae0b68e8e4910a9dd1c2f78ed668974d2a" +checksum = "b95bc3c2dd33256fe168706189f58d34214ab2b970b038dd27de38b2b2670a05" dependencies = [ "anyhow", "cairo-felt", @@ -1004,9 +1195,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d745c72ac1cef893239d36bc749742d2622136ffc1434a2c70b07096d02de0" +checksum = "23fe738fde316bc47a663adb0b6aabe4b8b43a2bcaee4824f220ac32c496672d" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1020,9 +1211,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c9f119185b736b5318325e7a0fc1378b706116c1c558e1ced1bdf55367813b" +checksum = "0c3352674bb20b008e7549edc33da4c5fe7d6061787127e073044f73147bd50b" dependencies = [ "genco", "xshell", @@ -1030,9 +1221,9 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.4.3" +version = "2.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343ac08a5b9d34c9f4bbac7249453a31edad4cf4ff54487197cc344f8293dc4f" +checksum = "f12291945d9230ce82f6e658537fbc5cc34920b19283dfff8e814154edd378eb" dependencies = [ "indexmap 2.1.0", "itertools 0.11.0", @@ -1086,6 +1277,30 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + [[package]] name = "chrono" version = "0.4.31" @@ -1107,6 +1322,7 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] @@ -1209,6 +1425,15 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.12" @@ -1244,44 +1469,37 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.17" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-queue" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -1309,6 +1527,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core", "typenum", ] @@ -1321,6 +1540,34 @@ dependencies = [ "cipher", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "darling" version = "0.20.3" @@ -1356,6 +1603,32 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + +[[package]] +name = "data-encoding-macro" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +dependencies = [ + "data-encoding", + "syn 1.0.109", +] + [[package]] name = "der" version = "0.7.8" @@ -1367,6 +1640,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der-parser" +version = "8.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits 0.2.17", + "rusticata-macros", +] + [[package]] name = "deranged" version = "0.3.11" @@ -1427,14 +1714,26 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "dojo-c" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "cbindgen", "dojo-types", "futures", + "futures-channel", "js-sys", "parking_lot 0.12.1", "serde", @@ -1455,8 +1754,8 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.4.4" -source = "git+https://github.com/dojoengine/dojo#74c12c05b8da22ebf45984dd5fc5448998abb5bf" +version = "0.5.1-alpha.0" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" dependencies = [ "crypto-bigint", "hex", @@ -1471,8 +1770,8 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.4.4" -source = "git+https://github.com/dojoengine/dojo#74c12c05b8da22ebf45984dd5fc5448998abb5bf" +version = "0.5.1-alpha.0" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" dependencies = [ "anyhow", "async-trait", @@ -1501,6 +1800,12 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + [[package]] name = "dyn-clone" version = "1.0.16" @@ -1508,25 +1813,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] -name = "either" -version = "1.9.0" +name = "ed25519" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "serde", + "pkcs8", + "signature", ] [[package]] -name = "ena" -version = "0.14.2" +name = "ed25519-dalek" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ - "log", + "curve25519-dalek", + "ed25519", + "rand_core", + "serde", + "sha2", + "subtle", + "zeroize", ] [[package]] -name = "encoding_rs" +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +dependencies = [ + "serde", +] + +[[package]] +name = "ena" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +dependencies = [ + "log", +] + +[[package]] +name = "encoding_rs" version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" @@ -1534,6 +1864,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1618,9 +1960,20 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.2" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "218a870470cce1469024e9fb66b901aa983929d81304a1cdb299f28118e550d5" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -1633,7 +1986,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.2", + "event-listener 4.0.3", "pin-project-lite", ] @@ -1652,6 +2005,12 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "fiat-crypto" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" + [[package]] name = "finl_unicode" version = "1.2.0" @@ -1733,6 +2092,16 @@ dependencies = [ "futures-util", ] +[[package]] +name = "futures-bounded" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" +dependencies = [ + "futures-timer", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.30" @@ -1758,6 +2127,7 @@ dependencies = [ "futures-core", "futures-task", "futures-util", + "num_cpus", ] [[package]] @@ -1794,9 +2164,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ "fastrand 2.0.1", "futures-core", @@ -1816,6 +2186,16 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "futures-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" +dependencies = [ + "futures-io", + "rustls", +] + [[package]] name = "futures-sink" version = "0.3.30" @@ -1828,6 +2208,23 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +[[package]] +name = "futures-ticker" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9763058047f713632a52e916cc7f6a4b3fc6e9fc1ff8c5b1dc49e5a89041682e" +dependencies = [ + "futures", + "futures-timer", + "instant", +] + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.30" @@ -1880,9 +2277,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -1891,6 +2288,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gimli" version = "0.28.1" @@ -1934,9 +2341,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -2005,9 +2412,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -2015,6 +2422,58 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex_fmt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" + +[[package]] +name = "hickory-proto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand", + "socket2 0.5.5", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.1", + "rand", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -2042,6 +2501,17 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + [[package]] name = "http" version = "0.2.11" @@ -2143,7 +2613,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -2167,6 +2637,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.5.0" @@ -2177,6 +2657,55 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "if-addrs" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "if-watch" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +dependencies = [ + "async-io 2.3.0", + "core-foundation", + "fnv", + "futures", + "if-addrs", + "ipnet", + "log", + "rtnetlink", + "smol", + "system-configuration", + "tokio", + "windows", +] + +[[package]] +name = "igd-next" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "064d90fec10d541084e7b39ead8875a5a80d9114a2b18791565253bae25f49e4" +dependencies = [ + "async-trait", + "attohttpc", + "bytes", + "futures", + "http", + "hyper", + "log", + "rand", + "tokio", + "url", + "xmltree", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -2273,11 +2802,23 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.4", "libc", "windows-sys 0.48.0", ] +[[package]] +name = "ipconfig" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" +dependencies = [ + "socket2 0.5.5", + "widestring", + "windows-sys 0.48.0", + "winreg", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -2290,8 +2831,8 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi 0.3.3", - "rustix 0.38.28", + "hermit-abi 0.3.4", + "rustix 0.38.30", "windows-sys 0.52.0", ] @@ -2339,9 +2880,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -2398,9 +2939,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.151" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libm" @@ -2409,66 +2950,512 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "libredox" -version = "0.0.1" +name = "libp2p" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" dependencies = [ - "bitflags 2.4.1", - "libc", - "redox_syscall 0.4.1", + "bytes", + "either", + "futures", + "futures-timer", + "getrandom", + "instant", + "libp2p-allow-block-list", + "libp2p-connection-limits", + "libp2p-core", + "libp2p-dns", + "libp2p-gossipsub", + "libp2p-identify", + "libp2p-identity", + "libp2p-mdns", + "libp2p-metrics", + "libp2p-noise", + "libp2p-ping", + "libp2p-quic", + "libp2p-relay", + "libp2p-swarm", + "libp2p-tcp", + "libp2p-upnp", + "libp2p-yamux", + "multiaddr", + "pin-project", + "rw-stream-sink", + "thiserror", ] [[package]] -name = "libsqlite3-sys" -version = "0.27.0" +name = "libp2p-allow-block-list" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" dependencies = [ - "cc", - "pkg-config", - "vcpkg", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", ] [[package]] -name = "linux-raw-sys" -version = "0.3.8" +name = "libp2p-connection-limits" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +dependencies = [ + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "void", +] [[package]] -name = "linux-raw-sys" -version = "0.4.12" +name = "libp2p-core" +version = "0.41.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "8130a8269e65a2554d55131c770bdf4bcd94d2b8d4efb24ca23699be65066c05" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-identity", + "multiaddr", + "multihash", + "multistream-select", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "quick-protobuf", + "rand", + "rw-stream-sink", + "smallvec", + "thiserror", + "tracing", + "unsigned-varint 0.8.0", + "void", +] [[package]] -name = "lock_api" -version = "0.4.11" +name = "libp2p-dns" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" dependencies = [ - "autocfg", - "scopeguard", + "async-std-resolver", + "async-trait", + "futures", + "hickory-resolver", + "libp2p-core", + "libp2p-identity", + "parking_lot 0.12.1", + "smallvec", + "tracing", ] [[package]] -name = "log" -version = "0.4.20" +name = "libp2p-gossipsub" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" dependencies = [ - "value-bag", + "asynchronous-codec", + "base64 0.21.7", + "byteorder", + "bytes", + "either", + "fnv", + "futures", + "futures-ticker", + "getrandom", + "hex_fmt", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "prometheus-client", + "quick-protobuf", + "quick-protobuf-codec", + "rand", + "regex", + "sha2", + "smallvec", + "tracing", + "void", ] [[package]] -name = "matchit" -version = "0.7.3" +name = "libp2p-identify" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "20499a945d2f0221fdc6269b3848892c0f370d2ee3e19c7f65a29d8f860f6126" +dependencies = [ + "asynchronous-codec", + "either", + "futures", + "futures-bounded", + "futures-timer", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "lru", + "quick-protobuf", + "quick-protobuf-codec", + "smallvec", + "thiserror", + "tracing", + "void", +] [[package]] -name = "matrixmultiply" +name = "libp2p-identity" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "999ec70441b2fb35355076726a6bc466c932e9bdc66f6a11c6c0aa17c7ab9be0" +dependencies = [ + "bs58", + "ed25519-dalek", + "hkdf", + "multihash", + "quick-protobuf", + "rand", + "sha2", + "thiserror", + "tracing", + "zeroize", +] + +[[package]] +name = "libp2p-mdns" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +dependencies = [ + "async-io 2.3.0", + "async-std", + "data-encoding", + "futures", + "hickory-proto", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "rand", + "smallvec", + "socket2 0.5.5", + "tokio", + "tracing", + "void", +] + +[[package]] +name = "libp2p-metrics" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" +dependencies = [ + "futures", + "instant", + "libp2p-core", + "libp2p-gossipsub", + "libp2p-identify", + "libp2p-identity", + "libp2p-ping", + "libp2p-relay", + "libp2p-swarm", + "pin-project", + "prometheus-client", +] + +[[package]] +name = "libp2p-noise" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" +dependencies = [ + "asynchronous-codec", + "bytes", + "curve25519-dalek", + "futures", + "libp2p-core", + "libp2p-identity", + "multiaddr", + "multihash", + "once_cell", + "quick-protobuf", + "rand", + "sha2", + "snow", + "static_assertions", + "thiserror", + "tracing", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "libp2p-ping" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76b94ee41bd8c294194fe608851e45eb98de26fe79bc7913838cbffbfe8c7ce2" +dependencies = [ + "either", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "rand", + "tracing", + "void", +] + +[[package]] +name = "libp2p-quic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" +dependencies = [ + "async-std", + "bytes", + "futures", + "futures-timer", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-tls", + "parking_lot 0.12.1", + "quinn", + "rand", + "ring 0.16.20", + "rustls", + "socket2 0.5.5", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "libp2p-relay" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aadb213ffc8e1a6f2b9c48dcf0fc07bf370f2ea4db7981813d45e50671c8d9d" +dependencies = [ + "asynchronous-codec", + "bytes", + "either", + "futures", + "futures-bounded", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm", + "quick-protobuf", + "quick-protobuf-codec", + "rand", + "static_assertions", + "thiserror", + "tracing", + "void", +] + +[[package]] +name = "libp2p-swarm" +version = "0.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e92532fc3c4fb292ae30c371815c9b10103718777726ea5497abc268a4761866" +dependencies = [ + "async-std", + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-core", + "libp2p-identity", + "libp2p-swarm-derive", + "multistream-select", + "once_cell", + "rand", + "smallvec", + "tokio", + "tracing", + "void", +] + +[[package]] +name = "libp2p-swarm-derive" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b644268b4acfdaa6a6100b31226ee7a36d96ab4c43287d113bfd2308607d8b6f" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "libp2p-tcp" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" +dependencies = [ + "async-io 1.13.0", + "futures", + "futures-timer", + "if-watch", + "libc", + "libp2p-core", + "libp2p-identity", + "socket2 0.5.5", + "tokio", + "tracing", +] + +[[package]] +name = "libp2p-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" +dependencies = [ + "futures", + "futures-rustls", + "libp2p-core", + "libp2p-identity", + "rcgen", + "ring 0.16.20", + "rustls", + "rustls-webpki", + "thiserror", + "x509-parser", + "yasna", +] + +[[package]] +name = "libp2p-upnp" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "963eb8a174f828f6a51927999a9ab5e45dfa9aa2aa5fed99aa65f79de6229464" +dependencies = [ + "futures", + "futures-timer", + "igd-next", + "libp2p-core", + "libp2p-swarm", + "tokio", + "tracing", + "void", +] + +[[package]] +name = "libp2p-yamux" +version = "0.45.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200cbe50349a44760927d50b431d77bed79b9c0a3959de1af8d24a63434b71e5" +dependencies = [ + "either", + "futures", + "libp2p-core", + "thiserror", + "tracing", + "yamux 0.12.1", + "yamux 0.13.1", +] + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall 0.4.1", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +dependencies = [ + "value-bag", +] + +[[package]] +name = "lru" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2994eeba8ed550fd9b47a0b38f0242bc3344e496483c6180b69139cc2fa5d1d7" +dependencies = [ + "hashbrown 0.14.3", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "matrixmultiply" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "916806ba0031cd542105d916a97c8572e1fa6dd79c9c51e7eb43a09ec2dd84c1" @@ -2534,12 +3521,66 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "multiaddr" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" +dependencies = [ + "arrayref", + "byteorder", + "data-encoding", + "libp2p-identity", + "multibase", + "multihash", + "percent-encoding", + "serde", + "static_assertions", + "unsigned-varint 0.7.2", + "url", +] + +[[package]] +name = "multibase" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" +dependencies = [ + "base-x", + "data-encoding", + "data-encoding-macro", +] + +[[package]] +name = "multihash" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +dependencies = [ + "core2", + "unsigned-varint 0.7.2", +] + [[package]] name = "multimap" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multistream-select" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0df8e5eec2298a62b326ee4f0d7fe1a6b90a09dfcf9df37b38f947a8c42f19" +dependencies = [ + "bytes", + "futures", + "log", + "pin-project", + "smallvec", + "unsigned-varint 0.7.2", +] + [[package]] name = "ndarray" version = "0.13.1" @@ -2553,23 +3594,107 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "netlink-packet-core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-proto" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror", + "tokio", +] + +[[package]] +name = "netlink-sys" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +dependencies = [ + "async-io 1.13.0", + "bytes", + "futures", + "libc", + "log", + "tokio", +] + [[package]] name = "new_debug_unreachable" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", +] + [[package]] name = "nix" version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + [[package]] name = "nom" version = "7.1.3" @@ -2580,6 +3705,16 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.4" @@ -2665,7 +3800,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.4", "libc", ] @@ -2678,6 +3813,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -2690,12 +3834,24 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "os_str_bytes" version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -2797,6 +3953,16 @@ dependencies = [ "digest", ] +[[package]] +name = "pem" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -2903,9 +4069,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "platforms" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "polling" @@ -2925,18 +4097,41 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.1" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.28", + "rustix 0.38.30", "tracing", "windows-sys 0.52.0", ] +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3023,13 +4218,36 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.75" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus-client" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "510c4f1c9d81d556458f94c98f857748130ea9737bbd6053da497503b26ea63c" +dependencies = [ + "dtoa", + "itoa", + "parking_lot 0.12.1", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "prost" version = "0.11.9" @@ -3135,7 +4353,85 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ - "prost 0.12.3", + "prost 0.12.3", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quick-protobuf" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6da84cc204722a989e01ba2f6e1e276e190f22263d0cb6ce8526fcdb0d2e1f" +dependencies = [ + "byteorder", +] + +[[package]] +name = "quick-protobuf-codec" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint 0.8.0", +] + +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "async-io 1.13.0", + "async-std", + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" +dependencies = [ + "bytes", + "rand", + "ring 0.16.20", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +dependencies = [ + "bytes", + "libc", + "socket2 0.5.5", + "tracing", + "windows-sys 0.48.0", ] [[package]] @@ -3191,9 +4487,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -3201,14 +4497,26 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", ] +[[package]] +name = "rcgen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" +dependencies = [ + "pem", + "ring 0.16.20", + "time", + "yasna", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -3285,7 +4593,7 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -3319,6 +4627,16 @@ dependencies = [ "winreg", ] +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -3329,6 +4647,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + [[package]] name = "ring" version = "0.17.7" @@ -3339,7 +4672,7 @@ dependencies = [ "getrandom", "libc", "spin 0.9.8", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.48.0", ] @@ -3373,6 +4706,22 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rtnetlink" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +dependencies = [ + "async-global-executor", + "futures", + "log", + "netlink-packet-route", + "netlink-proto", + "nix 0.24.3", + "thiserror", + "tokio", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3400,6 +4749,15 @@ dependencies = [ "semver", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + [[package]] name = "rustix" version = "0.37.27" @@ -3416,14 +4774,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] @@ -3434,7 +4792,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring", + "ring 0.17.7", "rustls-webpki", "sct", ] @@ -3445,7 +4803,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -3454,8 +4812,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -3464,6 +4822,17 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +[[package]] +name = "rw-stream-sink" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c9026ff5d2f23da5e45bbc283f156383001bfb09c4e44256d02c1a685fe9a1" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + [[package]] name = "ryu" version = "1.0.16" @@ -3557,8 +4926,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -3569,9 +4938,9 @@ checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -3589,9 +4958,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", @@ -3733,6 +5102,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -3769,19 +5147,53 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "smol" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" +dependencies = [ + "async-channel 1.9.0", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-net", + "async-process", + "blocking", + "futures-lite 1.13.0", +] [[package]] name = "smol_str" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" dependencies = [ "serde", ] +[[package]] +name = "snow" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" +dependencies = [ + "aes-gcm", + "blake2", + "chacha20poly1305", + "curve25519-dalek", + "rand_core", + "ring 0.17.7", + "rustc_version", + "sha2", + "subtle", +] + [[package]] name = "socket2" version = "0.4.10" @@ -3903,7 +5315,7 @@ dependencies = [ "tokio-stream", "tracing", "url", - "uuid 1.6.1", + "uuid 1.7.0", ] [[package]] @@ -3954,8 +5366,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" dependencies = [ "atoi", - "base64 0.21.5", - "bitflags 2.4.1", + "base64 0.21.7", + "bitflags 2.4.2", "byteorder", "bytes", "chrono", @@ -3987,7 +5399,7 @@ dependencies = [ "stringprep", "thiserror", "tracing", - "uuid 1.6.1", + "uuid 1.7.0", "whoami", ] @@ -3998,8 +5410,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" dependencies = [ "atoi", - "base64 0.21.5", - "bitflags 2.4.1", + "base64 0.21.7", + "bitflags 2.4.2", "byteorder", "chrono", "crc", @@ -4028,7 +5440,7 @@ dependencies = [ "stringprep", "thiserror", "tracing", - "uuid 1.6.1", + "uuid 1.7.0", "whoami", ] @@ -4055,7 +5467,7 @@ dependencies = [ "tracing", "url", "urlencoding", - "uuid 1.6.1", + "uuid 1.7.0", ] [[package]] @@ -4066,7 +5478,7 @@ checksum = "5eb139c5e6f6c6da627080e33cc00b3fc1c9733403034ca1ee9c42a95c337c7f" dependencies = [ "starknet-accounts", "starknet-contract", - "starknet-core", + "starknet-core 0.8.1", "starknet-crypto", "starknet-ff", "starknet-macros", @@ -4082,7 +5494,7 @@ checksum = "3743932c80ad2a5868c2dd4ef729de4e12060c88e73e4bb678a5f8e51b105e53" dependencies = [ "async-trait", "auto_impl", - "starknet-core", + "starknet-core 0.8.1", "starknet-providers", "starknet-signers", "thiserror", @@ -4098,7 +5510,7 @@ dependencies = [ "serde_json", "serde_with", "starknet-accounts", - "starknet-core", + "starknet-core 0.8.1", "starknet-providers", "thiserror", ] @@ -4109,7 +5521,25 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1da8287d38c2c1253c95c915c8d28d4ef4722f8c200e264133e1ba60bdadef7c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", + "flate2", + "hex", + "serde", + "serde_json", + "serde_json_pythonic", + "serde_with", + "sha3", + "starknet-crypto", + "starknet-ff", +] + +[[package]] +name = "starknet-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b15034c07557615f6bea248cb2ac91a103f56792c515319025a5edc4de2a60e" +dependencies = [ + "base64 0.21.7", "flate2", "hex", "serde", @@ -4178,11 +5608,11 @@ dependencies = [ [[package]] name = "starknet-macros" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "840be1a7eb5735863eee47d3a3f26df45b9be2c519e8da294e74b4d0524d77d1" +checksum = "7c5d2964612f0ccd0a700279e33cfc98d6db04f64645ff834f3b7ec422142d7a" dependencies = [ - "starknet-core", + "starknet-core 0.9.0", "syn 2.0.48", ] @@ -4201,7 +5631,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "starknet-core", + "starknet-core 0.8.1", "thiserror", "url", ] @@ -4217,7 +5647,7 @@ dependencies = [ "crypto-bigint", "eth-keystore", "rand", - "starknet-core", + "starknet-core 0.8.1", "starknet-crypto", "thiserror", ] @@ -4311,6 +5741,18 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -4347,7 +5789,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.28", + "rustix 0.38.30", "windows-sys 0.52.0", ] @@ -4364,9 +5806,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -4397,6 +5839,16 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.31" @@ -4586,7 +6038,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-trait", - "base64 0.21.5", + "base64 0.21.7", "bytes", "flate2", "futures-core", @@ -4611,7 +6063,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.5", + "base64 0.21.7", "bytes", "h2", "http", @@ -4674,7 +6126,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fddb2a37b247e6adcb9f239f4e5cefdcc5ed526141a416b943929f13aea2cce" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes", "http", "http-body", @@ -4694,7 +6146,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac5987e92915a51a4b05e69a0ef903a7b76f16674f7ee66534f87fd3323e2d3a" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "byteorder", "bytes", "futures-util", @@ -4714,8 +6166,8 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.4.4" -source = "git+https://github.com/dojoengine/dojo#74c12c05b8da22ebf45984dd5fc5448998abb5bf" +version = "0.5.1-alpha.0" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" dependencies = [ "async-trait", "crypto-bigint", @@ -4735,13 +6187,14 @@ dependencies = [ "tonic 0.10.2", "tonic 0.9.2", "torii-grpc", + "torii-libp2p", "url", ] [[package]] name = "torii-grpc" -version = "0.4.4" -source = "git+https://github.com/dojoengine/dojo#74c12c05b8da22ebf45984dd5fc5448998abb5bf" +version = "0.5.1-alpha.0" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" dependencies = [ "bytes", "crypto-bigint", @@ -4777,6 +6230,21 @@ dependencies = [ "url", ] +[[package]] +name = "torii-libp2p" +version = "0.5.1-alpha.0" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" +dependencies = [ + "futures", + "libp2p", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-subscriber", +] + [[package]] name = "tower" version = "0.4.13" @@ -4803,7 +6271,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "bytes", "futures-core", "futures-util", @@ -4857,6 +6325,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", ] [[package]] @@ -4919,9 +6413,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -4956,6 +6450,34 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "unsigned-varint" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" + +[[package]] +name = "unsigned-varint" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb066959b24b5196ae73cb057f45598450d2c5f71460e98c49b738086eff9c06" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" @@ -4969,7 +6491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", ] @@ -4991,15 +6513,21 @@ dependencies = [ [[package]] name = "uuid" -version = "1.6.1" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" + +[[package]] +name = "valuable" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.4.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ce5bb364b23e66b528d03168df78b38c0f7b6fe17386928f29d5ab2e7cb2f7" +checksum = "7cdbaf5e132e593e9fc1de6a15bbec912395b11fb9719e061cf64f804524c503" [[package]] name = "vcpkg" @@ -5013,6 +6541,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + [[package]] name = "waker-fn" version = "1.1.1" @@ -5138,7 +6672,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.28", + "rustix 0.38.30", ] [[package]] @@ -5147,6 +6681,12 @@ version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +[[package]] +name = "widestring" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" + [[package]] name = "winapi" version = "0.3.9" @@ -5178,6 +6718,25 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core 0.51.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -5321,9 +6880,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.32" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8434aeec7b290e8da5c3f0d628cb0eac6cabcb31d14bb74f779a08109a5914d6" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -5347,6 +6906,50 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek", + "rand_core", + "serde", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + [[package]] name = "xshell" version = "0.2.5" @@ -5362,6 +6965,46 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e2c411759b501fb9501aac2b1b2d287a6e93e5bdcf13c25306b23e1b716dd0e" +[[package]] +name = "yamux" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed0164ae619f2dc144909a9f082187ebb5893693d8c0196e8085283ccd4b776" +dependencies = [ + "futures", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "pin-project", + "rand", + "static_assertions", +] + +[[package]] +name = "yamux" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1d0148b89300047e72994bee99ecdabd15a9166a7b70c8b8c37c314dcc9002" +dependencies = [ + "futures", + "instant", + "log", + "nohash-hasher", + "parking_lot 0.12.1", + "pin-project", + "rand", + "static_assertions", +] + +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time", +] + [[package]] name = "zerocopy" version = "0.7.32" diff --git a/Cargo.toml b/Cargo.toml index 13c3f8c..7849078 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,9 @@ version = "0.1.1" crate-type = ["cdylib", "rlib"] [dependencies] -dojo-types = { git = "https://github.com/dojoengine/dojo" } -torii-client = { git = "https://github.com/dojoengine/dojo" } -torii-grpc = { git = "https://github.com/dojoengine/dojo", features = [ +dojo-types = { git = "https://github.com/Larkooo/dojo", branch = "torii-libp2p"} +torii-client = { git = "https://github.com/Larkooo/dojo", branch = "torii-libp2p" } +torii-grpc = { git = "https://github.com/Larkooo/dojo", branch = "torii-libp2p", features = [ "client", ] } @@ -21,6 +21,8 @@ url = "2.5.0" anyhow = "1.0.76" serde = { version = "1.0.193", features = ["derive"] } tokio-stream = "0.1.14" +futures = "0.3.30" +futures-channel = "0.3.30" # WASM [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/dojo.h b/dojo.h index d2960d2..945df2b 100644 --- a/dojo.h +++ b/dojo.h @@ -59,6 +59,23 @@ typedef struct KeysClause { struct CArrayc_char keys; } KeysClause; +typedef enum Resultbool_Tag { + Okbool, + Errbool, +} Resultbool_Tag; + +typedef struct Resultbool { + Resultbool_Tag tag; + union { + struct { + bool ok; + }; + struct { + struct Error err; + }; + }; +} Resultbool; + typedef struct FieldElement { uint8_t data[32]; } FieldElement; @@ -361,23 +378,6 @@ typedef struct CArrayKeysClause { uintptr_t data_len; } CArrayKeysClause; -typedef enum Resultbool_Tag { - Okbool, - Errbool, -} Resultbool_Tag; - -typedef struct Resultbool { - Resultbool_Tag tag; - union { - struct { - bool ok; - }; - struct { - struct Error err; - }; - }; -} Resultbool; - typedef struct CArrayFieldElement { struct FieldElement *data; uintptr_t data_len; @@ -525,10 +525,13 @@ extern "C" { struct ResultToriiClient client_new(const char *torii_url, const char *rpc_url, + const char *libp2p_relay_url, const char *world, const struct KeysClause *entities, uintptr_t entities_len); +struct Resultbool client_on_message(struct ToriiClient *client, void (*callback)(void)); + struct ResultCOptionTy client_model(struct ToriiClient *client, const struct KeysClause *keys); struct ResultCArrayEntity client_entities(struct ToriiClient *client, const struct Query *query); diff --git a/example/main.c b/example/main.c index 8868b35..95f0964 100644 --- a/example/main.c +++ b/example/main.c @@ -23,7 +23,7 @@ void on_entity_state_update(FieldElement key, CArrayModel models) } } -int hex_to_bytes(const char *hex, unsigned char *bytes) +void hex_to_bytes(const char *hex, FieldElement* felt) { if (hex[0] == '0' && hex[1] == 'x') @@ -33,10 +33,8 @@ int hex_to_bytes(const char *hex, unsigned char *bytes) for (size_t i = 0; i < 32; i++) { - sscanf(hex + 2 * i, "%2hhx", &bytes[i]); + sscanf(hex + 2 * i, "%2hhx", &(*felt).data[i]); } - - return 0; } int main() @@ -47,7 +45,7 @@ int main() const char *playerKey = "0x028cd7ee02d7f6ec9810e75b930e8e607793b302445abbdee0ac88143f18da20"; const char *playerAddress = "0x0517ececd29116499f4a1b64b094da79ba08dfd54a3edaa316134c41f8160973"; const char *world = "0x028f5999ae62fec17c09c52a800e244961dba05251f5aaf923afabd9c9804d1a"; - const char *actions = "0x03e274b7d85fd0415bec56a5d831c3854f7308bbb26d486993cfc49e5a5fb788"; + const char *actions = "0x0297bde19ca499fd8a39dd9bedbcd881a47f7b8f66c19478ce97d7de89e6112e"; // Initialize world.data here... KeysClause entities[1] = {}; @@ -66,13 +64,8 @@ int main() ToriiClient *client = resClient.ok; // signing key - ResultFieldElement resSigningKey = felt_from_hex_be("0x1800000000300000180000000000030000000000003006001800006600"); - if (resSigningKey.tag == ErrFieldElement) - { - printf("Failed to create signing key: %s\n", resSigningKey.err.message); - return 1; - } - FieldElement signing_key = resSigningKey.ok; + FieldElement signing_key = {}; + hex_to_bytes(playerKey, &signing_key); // provider ResultCJsonRpcClient resProvider = jsonrpc_client_new(rpc_url); @@ -83,6 +76,7 @@ int main() } CJsonRpcClient *provider = resProvider.ok; + // account ResultAccount resAccount = account_new(provider, signing_key, playerAddress); if (resAccount.tag == ErrAccount) @@ -92,16 +86,24 @@ int main() } Account *master_account = resAccount.ok; - ResultAccount resBurner = account_deploy_burner(master_account); - if (resBurner.tag == ErrAccount) + FieldElement master_address = account_address(master_account); + printf("Master account: 0x"); + for (size_t i = 0; i < 32; i++) { - printf("Failed to create burner: %s\n", resBurner.err.message); - return 1; + printf("%02x", master_address.data[i]); } + printf("\n"); - Account *burner = resBurner.ok; + // ResultAccount resBurner = account_deploy_burner(provider, master_account); + // if (resBurner.tag == ErrAccount) + // { + // printf("Failed to create burner: %s\n", resBurner.err.message); + // return 1; + // } - FieldElement address = account_address(burner); + // Account *burner = resBurner.ok; + + FieldElement address = account_address(master_account); printf("New account: 0x"); for (size_t i = 0; i < 32; i++) { @@ -129,6 +131,7 @@ int main() ty_free(ty.some); } + Query query = {}; query.limit = 100; query.clause.tag = NoneClause; @@ -186,7 +189,7 @@ int main() } FieldElement keys[1] = {}; - keys[0] = felt_from_hex_be(playerKey).ok; + hex_to_bytes(playerKey, &keys[0]); Resultbool resEntityUpdate = client_on_entity_state_update(client, keys, 0, &on_entity_state_update); if (resEntityUpdate.tag == Errbool) { @@ -207,14 +210,8 @@ int main() .data_len = 1, }}; - ResultFieldElement moveLeft = felt_from_hex_be("0x01"); - if (moveLeft.tag == ErrFieldElement) - { - printf("Failed to create moveLeft: %s\n", moveLeft.err.message); - return 1; - } - - move.calldata.data[0] = moveLeft.ok; + // move left felt(0x01) + hex_to_bytes("0x01", &move.calldata.data[0]); ResultFieldElement resSpawn = account_execute_raw(master_account, &spawn, 1); if (resSpawn.tag == Errbool) diff --git a/src/libc.rs b/src/libc.rs index dcba905..6fbf536 100644 --- a/src/libc.rs +++ b/src/libc.rs @@ -5,6 +5,7 @@ use crate::types::{ Query, Result, Signature, ToriiClient, Ty, WorldMetadata, }; use crate::utils::watch_tx; +use futures::channel::mpsc::UnboundedSender; use starknet::accounts::{Account as StarknetAccount, ExecutionEncoding, SingleOwnerAccount}; use starknet::core::utils::{ cairo_short_string_to_felt, get_contract_address, get_selector_from_name, @@ -25,6 +26,7 @@ use torii_client::client::Client as TClient; pub unsafe extern "C" fn client_new( torii_url: *const c_char, rpc_url: *const c_char, + libp2p_relay_url: *const c_char, world: *const c_char, // entities is optional entities: *const KeysClause, @@ -32,6 +34,11 @@ pub unsafe extern "C" fn client_new( ) -> Result<*mut ToriiClient> { let torii_url = unsafe { CStr::from_ptr(torii_url).to_string_lossy().into_owned() }; let rpc_url = unsafe { CStr::from_ptr(rpc_url).to_string_lossy().into_owned() }; + let libp2p_relay_url = unsafe { + CStr::from_ptr(libp2p_relay_url) + .to_string_lossy() + .into_owned() + }; let world = unsafe { CStr::from_ptr(world).to_string_lossy().into_owned() }; let some_entities = if entities.is_null() || entities_len == 0 { None @@ -50,20 +57,40 @@ pub unsafe extern "C" fn client_new( } let world = world.unwrap(); - let client_future = TClient::new(torii_url, rpc_url, world, some_entities); + let client_future = TClient::new(torii_url, rpc_url, libp2p_relay_url, world, some_entities); let runtime = tokio::runtime::Runtime::new().unwrap(); - let client = runtime.block_on(client_future); + let client = runtime.block_on(client_future).map_err(|e| Error { + message: CString::new(e.to_string()).unwrap().into_raw(), + }); + + if let Err(e) = client { + return Result::Err(e); + } - match client { - Ok(client) => Result::Ok(Box::into_raw(Box::new(ToriiClient { + let client = client.unwrap(); + + Result::Ok(Box::into_raw(Box::new(ToriiClient { inner: client, runtime, - }))), - Err(e) => Result::Err(Error { - message: CString::new(e.to_string()).unwrap().into_raw(), - }), - } + }))) +} + +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn client_on_message(client: *mut ToriiClient, callback: unsafe extern "C" fn()) -> Result { + let (sender, receiver) = futures::channel::mpsc::unbounded(); + + (*client) + .runtime + .spawn((*client).inner.run_libp2p(&sender)); + + + (*client).runtime.spawn(async move { + while let Some(_) = receiver.next().await { + callback(); + } + }); } #[no_mangle] @@ -103,6 +130,8 @@ pub unsafe extern "C" fn client_entities( let result = (*client).runtime.block_on(entities_future); + println!("result: {:?}", result); + match result { Ok(entities) => { let entities: Vec = entities.into_iter().map(|e| (&e).into()).collect(); @@ -407,9 +436,14 @@ pub unsafe extern "C" fn account_deploy_burner( selector: get_selector_from_name("deployContract").unwrap(), }]); - let result = tokio::runtime::Runtime::new() - .unwrap() - .block_on(exec.send()); + let result = tokio::runtime::Runtime::new().map_err(|e| Error { + message: CString::new(e.to_string()).unwrap().into_raw(), + }); + if let Err(e) = result { + return Result::Err(e); + } + + let result = result.unwrap().block_on(exec.send()); if let Err(e) = result { return Result::Err(Error { @@ -419,10 +453,15 @@ pub unsafe extern "C" fn account_deploy_burner( let result = result.unwrap(); - tokio::runtime::Runtime::new() + if let Err(e) = tokio::runtime::Runtime::new() .unwrap() .block_on(watch_tx(&(*provider).0, result.transaction_hash)) - .unwrap(); + .map_err(|e| Error { + message: CString::new(e.to_string()).unwrap().into_raw(), + }) + { + return Result::Err(e); + } Result::Ok(Box::into_raw(Box::new(Account(account)))) } From daecd74eab2b21307f5e2923897baf2477c349fe Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 10:02:39 -0500 Subject: [PATCH 2/9] feat: added libp2p torii client c bindings --- Cargo.lock | 1256 +++++++++++++++++++++++++++++++++++++----------- Cargo.toml | 2 +- dojo.h | 27 +- example/main.c | 5 +- src/libc.rs | 111 ++++- 5 files changed, 1094 insertions(+), 307 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c82a8ce..519cf4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,6 +101,12 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + [[package]] name = "ark-ff" version = "0.4.2" @@ -269,18 +275,6 @@ dependencies = [ "slab", ] -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "blocking", - "futures-lite 1.13.0", -] - [[package]] name = "async-global-executor" version = "2.4.1" @@ -355,52 +349,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-net" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" -dependencies = [ - "async-io 1.13.0", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.30", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-signal" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" -dependencies = [ - "async-io 2.3.0", - "async-lock 2.8.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.30", - "signal-hook-registry", - "slab", - "windows-sys 0.48.0", -] - [[package]] name = "async-std" version = "1.12.0" @@ -411,7 +359,6 @@ dependencies = [ "async-global-executor", "async-io 1.13.0", "async-lock 2.8.0", - "async-process", "crossbeam-utils", "futures-channel", "futures-core", @@ -428,21 +375,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "async-std-resolver" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0ed2b6671c13d2c28756c5a64e04759c1e0b5d3d7ac031f521c3561e21fbcb" -dependencies = [ - "async-std", - "async-trait", - "futures-io", - "futures-util", - "hickory-resolver", - "pin-utils", - "socket2 0.5.5", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -662,6 +594,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -722,6 +663,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + [[package]] name = "blocking" version = "1.5.1" @@ -820,9 +770,9 @@ dependencies = [ [[package]] name = "cairo-felt" -version = "0.8.7" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5972097b8800ca5dffb458040e74c724a2ac4fa4b5b480b50f5b96c7e67d6427" +checksum = "ae932292b9ba497a4e892b56aa4e0c6f329a455180fdbdc132700dfe68d9b153" dependencies = [ "lazy_static", "num-bigint", @@ -833,26 +783,24 @@ dependencies = [ [[package]] name = "cairo-lang-casm" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40058b275150a66c15f39aa09f2a79be7acd089e526beca79ded7a29aafd0ae9" +checksum = "c3085455fa119efc82b887950b56d4d34a10348ae8a29f422101f2b199438ca6" dependencies = [ "cairo-lang-utils", + "hashbrown 0.14.3", "indoc", "num-bigint", "num-traits 0.2.17", "parity-scale-codec", - "parity-scale-codec-derive", - "schemars", "serde", - "thiserror", ] [[package]] name = "cairo-lang-compiler" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd38cbddb149d5417b3b9a655489de356f29b15be2637e4270c95ea5fcc51e87" +checksum = "470c388cd2a281788c4dfec42821ba313a4e49e304fd2d2c9e66bf4300aa9f34" dependencies = [ "anyhow", "cairo-lang-defs", @@ -866,25 +814,24 @@ dependencies = [ "cairo-lang-sierra-generator", "cairo-lang-syntax", "cairo-lang-utils", - "itertools 0.11.0", "salsa", "thiserror", ] [[package]] name = "cairo-lang-debug" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ea67db5af077ca6817d1db5020ab450f28aff2d3ffbc55b6d3a5132e9bc0e1" +checksum = "bab648e172102fc4a6c45d99b56d440684dbe89c9e707f3cfb32adb711818834" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0f8ddae7bebbec634f6b0a7040a1c58003ec13be541e00e5e7ded04788c6d2" +checksum = "0772c941cce18e5ebc64b138db5579fdd4ce776d8afb9d8d310df42e01d367a4" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -899,9 +846,9 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64269b3fd33c17920cb6b300257439a885b1251bddab78cfcfea02031ad10eb6" +checksum = "f34d641d9b6200c1d79c2da92ab14dcfad211676cd7775d67028f1132581da2b" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -911,9 +858,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f57f448a8ccd1ff77f663941bd8310e3ce4e30fdcfd6ea4ee7d897df0fab04" +checksum = "860afc2931051a91866c64058b1f682ab3b1d6bd67d07153261de63536659542" dependencies = [ "cairo-lang-utils", "good_lp", @@ -921,9 +868,9 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a6506fb2f749964aac614f5295aa4fa1e18123aea0d1e09a03ea0311b3847" +checksum = "9fe3c207886492581816d744a81f2ee81d2fee6f7326b62caa7c5f99fd658887" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -935,9 +882,9 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c38232c57885ef108395e784aa0fc8d9e23a5a2b0f985484f10d6d9ef85c83e" +checksum = "fff23dfe3e4de8613a7044cb0a313826b049cc8b8a89aa6dffed326b3d0c6405" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -949,7 +896,6 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "id-arena", - "indexmap 2.1.0", "itertools 0.11.0", "log", "num-bigint", @@ -961,9 +907,9 @@ dependencies = [ [[package]] name = "cairo-lang-parser" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bcaec01565917823193ea2db9f239c5d496987a006f7be894fd757216d64d94" +checksum = "ef5ad088b73ec17360766e1149de6a09f43cfd610ff54f19c6c02bb39b05a725" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -981,9 +927,9 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428c7ce26429eaf08afe7831aab3e61c5858e88250227cdabfec8307cd25bea2" +checksum = "22353bef64e394ffe12d21d6c1aa61894af1faa8cf511c6675cbce0c8cc3065e" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -1000,9 +946,9 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97efc9847766adc92e0c6f21dfaab26960c66579978f5767c5995950b40b73c6" +checksum = "49bc7b990207a91e756c2045015cd94ba366ed9fea467ab45358b4ed9e046326" dependencies = [ "cairo-lang-debug", "quote", @@ -1011,9 +957,9 @@ dependencies = [ [[package]] name = "cairo-lang-project" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b3ff44aee12e08955d2c107eb087cf3b238db8f3d306bdd2e3be95bb149880" +checksum = "aa408032bab9d665d02e5a5b60a5fe3414abb4ea49f7de4cdf606fec008b31e8" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -1025,9 +971,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cd57e7e6d437419643e075297532d98789f75d12824ee02ec4144278870bfc" +checksum = "ea038491d2d6a46f4cbc053713c2a0a4aeffeb76d97ccea18f7260e459b4dc19" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1050,11 +996,12 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a035e4b4b961df135fc3ef81c4b1d5e1efa19a6a3245862860a11856af46bc" +checksum = "9ba35ff92b43872a8f89a8745e6fa911d964b47c145011d96b2d8ebf1aad8fa3" dependencies = [ "anyhow", + "cairo-felt", "cairo-lang-utils", "const-fnv1a-hash", "convert_case", @@ -1075,37 +1022,39 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68b38763f995b27b2fb824a90e43b5671af17e015af8dfeb13eabad8149eba2" +checksum = "ac25af35be8ee9b47d8db4d39b2c9359fc8013acb8ed933cc751bbb54e8fa78e" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", "cairo-lang-sierra-type-size", "cairo-lang-utils", "itertools 0.11.0", + "num-traits 0.2.17", "thiserror", ] [[package]] name = "cairo-lang-sierra-gas" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19187cf2ef439fa1abcc65dac87e408482ae8a124748558e2d760ab7ce5b7333" +checksum = "e510821a12693b8486614d0a43b3e776163bc9dbeedcd9a9d949124a6789271c" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", "cairo-lang-sierra-type-size", "cairo-lang-utils", "itertools 0.11.0", + "num-traits 0.2.17", "thiserror", ] [[package]] name = "cairo-lang-sierra-generator" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210fcedd39d513d4fdcd727156de179dc640ee27dca8e5bba076aa514cb70fe4" +checksum = "2a5b905f46390e4d5d26bfb632cdb747e8a2fc31866b39a082289d2cc7fa348c" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1117,7 +1066,6 @@ dependencies = [ "cairo-lang-sierra", "cairo-lang-syntax", "cairo-lang-utils", - "indexmap 2.1.0", "itertools 0.11.0", "num-bigint", "once_cell", @@ -1127,9 +1075,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdea72b0699e040c1a56ed89878904d44184fc66208ce3da77dc78d4e34c33f9" +checksum = "1fa4bdbacf02bf4b13c2b891e2396567ad733f20d7e59526255e07c897a14405" dependencies = [ "assert_matches", "cairo-felt", @@ -1148,9 +1096,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70bd365647251e18669bb7e702a3e48455ba4d5712959ca11d16ddead65580b" +checksum = "854d43c5e1c0cf7e24cc58e665b60f1bb3d603615c72e13aad872a9548b44359" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -1158,9 +1106,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95bc3c2dd33256fe168706189f58d34214ab2b970b038dd27de38b2b2670a05" +checksum = "09fe48d254ffdce63c5f6eb001d663d4d9b77c3f30a4bcb0124be6ac8177830f" dependencies = [ "anyhow", "cairo-felt", @@ -1195,9 +1143,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fe738fde316bc47a663adb0b6aabe4b8b43a2bcaee4824f220ac32c496672d" +checksum = "983fa8cc3d92ac4d80cba2a6a1511a03f71384a953464ccf7809cddcb1714e86" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1211,9 +1159,9 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3352674bb20b008e7549edc33da4c5fe7d6061787127e073044f73147bd50b" +checksum = "caa5e57952da2c330df7e63181d57b80e639096e061dff2c30730b7f7a124dda" dependencies = [ "genco", "xshell", @@ -1221,15 +1169,15 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.4.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12291945d9230ce82f6e658537fbc5cc34920b19283dfff8e814154edd378eb" +checksum = "71fa45c5e537470c11f620576e80d1f3a8d0096e7d7070fcc3248fa960a186b6" dependencies = [ + "hashbrown 0.14.3", "indexmap 2.1.0", "itertools 0.11.0", "num-bigint", "num-traits 0.2.17", - "parity-scale-codec", "schemars", "serde", ] @@ -1243,6 +1191,15 @@ dependencies = [ "serde", ] +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + [[package]] name = "cbindgen" version = "0.26.0" @@ -1271,6 +1228,18 @@ dependencies = [ "libc", ] +[[package]] +name = "ccm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae3c82e4355234767756212c570e29833699ab63e6ffd161887314cc5b43847" +dependencies = [ + "aead", + "cipher", + "ctr", + "subtle", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -1303,15 +1272,15 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits 0.2.17", "serde", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -1368,6 +1337,16 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + [[package]] name = "const-fnv1a-hash" version = "1.1.0" @@ -1755,7 +1734,7 @@ dependencies = [ [[package]] name = "dojo-types" version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" dependencies = [ "crypto-bigint", "hex", @@ -1771,7 +1750,7 @@ dependencies = [ [[package]] name = "dojo-world" version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" dependencies = [ "anyhow", "async-trait", @@ -1812,6 +1791,20 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + [[package]] name = "ed25519" version = "2.2.3" @@ -1846,6 +1839,27 @@ dependencies = [ "serde", ] +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "ena" version = "0.14.2" @@ -1958,17 +1972,6 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "4.0.3" @@ -2005,6 +2008,16 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.2.5" @@ -2095,8 +2108,7 @@ dependencies = [ [[package]] name = "futures-bounded" version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e2774cc104e198ef3d3e1ff4ab40f86fa3245d6cb6a3a46174f21463cee173" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "futures-timer", "futures-util", @@ -2224,6 +2236,10 @@ name = "futures-timer" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +dependencies = [ + "gloo-timers", + "send_wrapper 0.4.0", +] [[package]] name = "futures-util" @@ -2273,6 +2289,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -2339,6 +2356,17 @@ dependencies = [ "minilp", ] +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + [[package]] name = "h2" version = "0.3.24" @@ -2372,6 +2400,7 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", + "serde", ] [[package]] @@ -2681,7 +2710,6 @@ dependencies = [ "ipnet", "log", "rtnetlink", - "smol", "system-configuration", "tokio", "windows", @@ -2784,6 +2812,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" dependencies = [ + "block-padding", "generic-array", ] @@ -2794,6 +2823,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "interceptor" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5927883184e6a819b22d5e4f5f7bc7ca134fde9b2026fbddd8d95249746ba21e" +dependencies = [ + "async-trait", + "bytes", + "log", + "rand", + "rtcp", + "rtp", + "thiserror", + "tokio", + "waitgroup", + "webrtc-srtp", + "webrtc-util", ] [[package]] @@ -2871,9 +2922,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -2952,8 +3003,7 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" version = "0.53.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "bytes", "either", @@ -2963,9 +3013,9 @@ dependencies = [ "instant", "libp2p-allow-block-list", "libp2p-connection-limits", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-dns", - "libp2p-gossipsub", + "libp2p-gossipsub 0.46.1 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identify", "libp2p-identity", "libp2p-mdns", @@ -2974,37 +3024,35 @@ dependencies = [ "libp2p-ping", "libp2p-quic", "libp2p-relay", - "libp2p-swarm", + "libp2p-swarm 0.44.2", "libp2p-tcp", "libp2p-upnp", "libp2p-yamux", "multiaddr", "pin-project", - "rw-stream-sink", + "rw-stream-sink 0.4.0 (git+https://github.com/libp2p/rust-libp2p)", "thiserror", ] [[package]] name = "libp2p-allow-block-list" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.44.2", "void", ] [[package]] name = "libp2p-connection-limits" version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.44.2", "void", ] @@ -3022,13 +3070,40 @@ dependencies = [ "libp2p-identity", "multiaddr", "multihash", - "multistream-select", + "multistream-select 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell", + "parking_lot 0.12.1", + "pin-project", + "quick-protobuf", + "rand", + "rw-stream-sink 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec", + "thiserror", + "tracing", + "unsigned-varint 0.8.0", + "void", +] + +[[package]] +name = "libp2p-core" +version = "0.41.2" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "instant", + "libp2p-identity", + "multiaddr", + "multihash", + "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p)", "once_cell", "parking_lot 0.12.1", "pin-project", "quick-protobuf", "rand", - "rw-stream-sink", + "rw-stream-sink 0.4.0 (git+https://github.com/libp2p/rust-libp2p)", "smallvec", "thiserror", "tracing", @@ -3039,14 +3114,12 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.41.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ - "async-std-resolver", "async-trait", "futures", "hickory-resolver", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", "parking_lot 0.12.1", "smallvec", @@ -3070,12 +3143,12 @@ dependencies = [ "getrandom", "hex_fmt", "instant", - "libp2p-core", + "libp2p-core 0.41.2 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.44.1", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand", "regex", "sha2", @@ -3085,22 +3158,51 @@ dependencies = [ ] [[package]] -name = "libp2p-identify" -version = "0.44.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20499a945d2f0221fdc6269b3848892c0f370d2ee3e19c7f65a29d8f860f6126" +name = "libp2p-gossipsub" +version = "0.46.1" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "asynchronous-codec", + "base64 0.21.7", + "byteorder", + "bytes", "either", + "fnv", "futures", - "futures-bounded", - "futures-timer", - "libp2p-core", + "futures-ticker", + "getrandom", + "hex_fmt", + "instant", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.44.2", + "prometheus-client", + "quick-protobuf", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", + "rand", + "regex", + "sha2", + "smallvec", + "tracing", + "void", +] + +[[package]] +name = "libp2p-identify" +version = "0.44.2" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "asynchronous-codec", + "either", + "futures", + "futures-bounded", + "futures-timer", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-identity", + "libp2p-swarm 0.44.2", "lru", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", "smallvec", "thiserror", "tracing", @@ -3128,18 +3230,15 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ - "async-io 2.3.0", - "async-std", "data-encoding", "futures", "hickory-proto", "if-watch", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.44.2", "rand", "smallvec", "socket2 0.5.5", @@ -3151,18 +3250,17 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "futures", "instant", - "libp2p-core", - "libp2p-gossipsub", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-gossipsub 0.46.1 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identify", "libp2p-identity", "libp2p-ping", "libp2p-relay", - "libp2p-swarm", + "libp2p-swarm 0.44.2", "pin-project", "prometheus-client", ] @@ -3170,14 +3268,13 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecd0545ce077f6ea5434bcb76e8d0fe942693b4380aaad0d34a358c2bd05793" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "asynchronous-codec", "bytes", "curve25519-dalek", "futures", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", "multiaddr", "multihash", @@ -3196,16 +3293,15 @@ dependencies = [ [[package]] name = "libp2p-ping" version = "0.44.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b94ee41bd8c294194fe608851e45eb98de26fe79bc7913838cbffbfe8c7ce2" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "either", "futures", "futures-timer", "instant", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.44.2", "rand", "tracing", "void", @@ -3214,15 +3310,13 @@ dependencies = [ [[package]] name = "libp2p-quic" version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0375cdfee57b47b313ef1f0fdb625b78aed770d33a40cf1c294a371ff5e6666" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ - "async-std", "bytes", "futures", "futures-timer", "if-watch", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", "libp2p-tls", "parking_lot 0.12.1", @@ -3239,8 +3333,7 @@ dependencies = [ [[package]] name = "libp2p-relay" version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aadb213ffc8e1a6f2b9c48dcf0fc07bf370f2ea4db7981813d45e50671c8d9d" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "asynchronous-codec", "bytes", @@ -3249,11 +3342,11 @@ dependencies = [ "futures-bounded", "futures-timer", "instant", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", - "libp2p-swarm", + "libp2p-swarm 0.44.2", "quick-protobuf", - "quick-protobuf-codec", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", "rand", "static_assertions", "thiserror", @@ -3267,29 +3360,50 @@ version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e92532fc3c4fb292ae30c371815c9b10103718777726ea5497abc268a4761866" dependencies = [ - "async-std", "either", "fnv", "futures", "futures-timer", "instant", - "libp2p-core", + "libp2p-core 0.41.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p-identity", + "multistream-select 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell", + "rand", + "smallvec", + "tracing", + "void", +] + +[[package]] +name = "libp2p-swarm" +version = "0.44.2" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "either", + "fnv", + "futures", + "futures-timer", + "getrandom", + "instant", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", "libp2p-swarm-derive", - "multistream-select", + "lru", + "multistream-select 0.13.0 (git+https://github.com/libp2p/rust-libp2p)", "once_cell", "rand", "smallvec", "tokio", "tracing", "void", + "wasm-bindgen-futures", ] [[package]] name = "libp2p-swarm-derive" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b644268b4acfdaa6a6100b31226ee7a36d96ab4c43287d113bfd2308607d8b6f" +version = "0.34.3" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "heck 0.4.1", "proc-macro2", @@ -3300,15 +3414,13 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ - "async-io 1.13.0", "futures", "futures-timer", "if-watch", "libc", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", "socket2 0.5.5", "tokio", @@ -3318,12 +3430,11 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ce7e3c2e7569d685d08ec795157981722ff96e9e9f9eae75df3c29d02b07a5" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "futures", "futures-rustls", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "libp2p-identity", "rcgen", "ring 0.16.20", @@ -3336,29 +3447,98 @@ dependencies = [ [[package]] name = "libp2p-upnp" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963eb8a174f828f6a51927999a9ab5e45dfa9aa2aa5fed99aa65f79de6229464" +version = "0.2.1" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "futures", "futures-timer", "igd-next", - "libp2p-core", - "libp2p-swarm", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-swarm 0.44.2", "tokio", "tracing", "void", ] +[[package]] +name = "libp2p-webrtc" +version = "0.7.1-alpha" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "async-trait", + "bytes", + "futures", + "futures-timer", + "hex", + "if-watch", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-identity", + "libp2p-noise", + "libp2p-webrtc-utils", + "multihash", + "rand", + "rcgen", + "serde", + "stun", + "thiserror", + "tinytemplate", + "tokio", + "tokio-util", + "tracing", + "webrtc", +] + +[[package]] +name = "libp2p-webrtc-utils" +version = "0.2.0" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "asynchronous-codec", + "bytes", + "futures", + "hex", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-identity", + "libp2p-noise", + "quick-protobuf", + "quick-protobuf-codec 0.3.1 (git+https://github.com/libp2p/rust-libp2p)", + "rand", + "serde", + "sha2", + "thiserror", + "tinytemplate", + "tracing", +] + +[[package]] +name = "libp2p-webrtc-websys" +version = "0.3.0-alpha" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "bytes", + "futures", + "getrandom", + "hex", + "js-sys", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", + "libp2p-identity", + "libp2p-webrtc-utils", + "send_wrapper 0.6.0", + "thiserror", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "libp2p-yamux" version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200cbe50349a44760927d50b431d77bed79b9c0a3959de1af8d24a63434b71e5" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" dependencies = [ "either", "futures", - "libp2p-core", + "libp2p-core 0.41.2 (git+https://github.com/libp2p/rust-libp2p)", "thiserror", "tracing", "yamux 0.12.1", @@ -3448,6 +3628,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matchit" version = "0.7.3" @@ -3479,6 +3668,15 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.17" @@ -3581,6 +3779,19 @@ dependencies = [ "unsigned-varint 0.7.2", ] +[[package]] +name = "multistream-select" +version = "0.13.0" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "bytes", + "futures", + "pin-project", + "smallvec", + "tracing", + "unsigned-varint 0.8.0", +] + [[package]] name = "ndarray" version = "0.13.1" @@ -3653,7 +3864,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "async-io 1.13.0", "bytes", "futures", "libc", @@ -3678,6 +3888,19 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset", + "pin-utils", +] + [[package]] name = "nix" version = "0.27.1" @@ -3852,6 +4075,30 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p384" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -4170,6 +4417,15 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -4218,9 +4474,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -4384,14 +4640,24 @@ dependencies = [ "unsigned-varint 0.8.0", ] +[[package]] +name = "quick-protobuf-codec" +version = "0.3.1" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "asynchronous-codec", + "bytes", + "quick-protobuf", + "thiserror", + "unsigned-varint 0.8.0", +] + [[package]] name = "quinn" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ - "async-io 1.13.0", - "async-std", "bytes", "futures-io", "pin-project-lite", @@ -4514,6 +4780,7 @@ dependencies = [ "pem", "ring 0.16.20", "time", + "x509-parser", "yasna", ] @@ -4548,27 +4815,42 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata", + "regex-automata 0.4.4", "regex-syntax 0.8.2", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", "regex-syntax 0.8.2", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.7.5" @@ -4706,13 +4988,23 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rtcp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3677908cadfbecb4cc1da9a56a32524fae4ebdfa7c2ea93886e1b1e846488cb9" +dependencies = [ + "bytes", + "thiserror", + "webrtc-util", +] + [[package]] name = "rtnetlink" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ - "async-global-executor", "futures", "log", "netlink-packet-route", @@ -4722,6 +5014,19 @@ dependencies = [ "tokio", ] +[[package]] +name = "rtp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e60482acbe8afb31edf6b1413103b7bca7a65004c423b3c3993749a083994fbe" +dependencies = [ + "bytes", + "rand", + "serde", + "thiserror", + "webrtc-util", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -4833,6 +5138,16 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "rw-stream-sink" +version = "0.4.0" +source = "git+https://github.com/libp2p/rust-libp2p#1139f1c170c36d7223bb8c52c667b111ea5c5fbc" +dependencies = [ + "futures", + "pin-project", + "static_assertions", +] + [[package]] name = "ryu" version = "1.0.16" @@ -4902,6 +5217,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -4930,12 +5251,53 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "sdp" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4653054c30ebce63658762eb0d64e27673868a95564474811ae6c220cf767640" +dependencies = [ + "rand", + "substring", + "thiserror", + "url", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" +dependencies = [ + "futures-core", +] + [[package]] name = "serde" version = "1.0.195" @@ -5152,36 +5514,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] -name = "smol" -version = "1.3.0" +name = "smol_str" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" -dependencies = [ - "async-channel 1.9.0", - "async-executor", - "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-net", - "async-process", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "smol_str" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" dependencies = [ "serde", ] [[package]] name = "snow" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" +checksum = "2e87c18a6608909007e75a60e04d03eda77b601c94de1c74d9a9dc2c04ab789a" dependencies = [ "aes-gcm", "blake2", @@ -5707,6 +6052,34 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "stun" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7beb1624a3ea34778d58d30e2b8606b4d29fe65e87c4d50b87ed30afd5c3830c" +dependencies = [ + "base64 0.21.7", + "crc", + "lazy_static", + "md-5", + "rand", + "ring 0.16.20", + "subtle", + "thiserror", + "tokio", + "url", + "webrtc-util", +] + +[[package]] +name = "substring" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +dependencies = [ + "autocfg", +] + [[package]] name = "subtle" version = "2.5.0" @@ -5887,6 +6260,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -5971,6 +6354,7 @@ checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -6167,7 +6551,7 @@ dependencies = [ [[package]] name = "torii-client" version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" dependencies = [ "async-trait", "crypto-bigint", @@ -6175,6 +6559,7 @@ dependencies = [ "dojo-world", "futures", "futures-util", + "libp2p-gossipsub 0.46.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.12.1", "prost 0.11.9", "prost 0.12.3", @@ -6187,14 +6572,14 @@ dependencies = [ "tonic 0.10.2", "tonic 0.9.2", "torii-grpc", - "torii-libp2p", + "torii-relay", "url", ] [[package]] name = "torii-grpc" version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" dependencies = [ "bytes", "crypto-bigint", @@ -6231,18 +6616,28 @@ dependencies = [ ] [[package]] -name = "torii-libp2p" +name = "torii-relay" version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#448d4a4482ee8534e312f62273e88cde56bf71c3" +source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" dependencies = [ + "anyhow", + "async-trait", "futures", "libp2p", + "libp2p-webrtc", + "libp2p-webrtc-websys", + "rand", + "regex", "serde", "serde_json", "thiserror", "tokio", "tracing", "tracing-subscriber", + "tracing-wasm", + "wasm-bindgen-futures", + "wasm-bindgen-test", + "wasm-timer", ] [[package]] @@ -6345,14 +6740,29 @@ version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ + "matchers", "nu-ansi-term", + "once_cell", + "regex", "sharded-slab", "smallvec", "thread_local", + "tracing", "tracing-core", "tracing-log", ] +[[package]] +name = "tracing-wasm" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" +dependencies = [ + "tracing", + "tracing-subscriber", + "wasm-bindgen", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -6384,6 +6794,25 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "turn" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f4fcb97da0426e8146fe0e9b78cc13120161087256198701d12d9df77f7701" +dependencies = [ + "async-trait", + "base64 0.21.7", + "futures", + "log", + "md-5", + "rand", + "ring 0.16.20", + "stun", + "thiserror", + "tokio", + "webrtc-util", +] + [[package]] name = "typenum" version = "1.17.0" @@ -6404,9 +6833,9 @@ dependencies = [ [[package]] name = "unescaper" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f0f68e58d297ba8b22b8b5a96a87b863ba6bb46aaf51e19a4b02c5a6dd5b7f" +checksum = "0adf6ad32eb5b3cadff915f7b770faaac8f7ff0476633aa29eb0d9584d889d34" dependencies = [ "thiserror", ] @@ -6516,6 +6945,9 @@ name = "uuid" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +dependencies = [ + "getrandom", +] [[package]] name = "valuable" @@ -6547,6 +6979,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "waitgroup" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +dependencies = [ + "atomic-waker", +] + [[package]] name = "waker-fn" version = "1.1.1" @@ -6570,9 +7011,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -6580,9 +7021,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -6595,9 +7036,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -6607,9 +7048,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6617,9 +7058,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -6630,9 +7071,34 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "wasm-bindgen-test" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139bd73305d50e1c1c4333210c0db43d989395b64a237bd35c10ef3832a7f70c" +dependencies = [ + "console_error_panic_hook", + "js-sys", + "scoped-tls", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-bindgen-test-macro", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70072aebfe5da66d2716002c729a14e4aec4da0e23cc2ea66323dac541c93928" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] [[package]] name = "wasm-streams" @@ -6647,11 +7113,26 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -6663,6 +7144,212 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +[[package]] +name = "webrtc" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91e7cf018f7185552bf6a5dd839f4ed9827aea33b746763c9a215f84a0d0b34" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "cfg-if", + "hex", + "interceptor", + "lazy_static", + "log", + "pem", + "rand", + "rcgen", + "regex", + "ring 0.16.20", + "rtcp", + "rtp", + "rustls", + "sdp", + "serde", + "serde_json", + "sha2", + "smol_str", + "stun", + "thiserror", + "time", + "tokio", + "turn", + "url", + "waitgroup", + "webrtc-data", + "webrtc-dtls", + "webrtc-ice", + "webrtc-mdns", + "webrtc-media", + "webrtc-sctp", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "webrtc-data" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a45d2461d0e0bf93f181e30eb0b40df32b8bf3efb89c53cebb1990e603e2067d" +dependencies = [ + "bytes", + "log", + "thiserror", + "tokio", + "webrtc-sctp", + "webrtc-util", +] + +[[package]] +name = "webrtc-dtls" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b140b953f986e97828aa33ec6318186b05d862bee689efbc57af04a243e832" +dependencies = [ + "aes", + "aes-gcm", + "async-trait", + "bincode", + "byteorder", + "cbc", + "ccm", + "der-parser", + "hkdf", + "hmac", + "log", + "p256", + "p384", + "pem", + "rand", + "rand_core", + "rcgen", + "ring 0.16.20", + "rustls", + "sec1", + "serde", + "sha1", + "sha2", + "subtle", + "thiserror", + "tokio", + "webrtc-util", + "x25519-dalek", + "x509-parser", +] + +[[package]] +name = "webrtc-ice" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66eb4b85646f1c52225779db3e1e7e873dede6db68cc9be080b648f1713083a3" +dependencies = [ + "arc-swap", + "async-trait", + "crc", + "log", + "rand", + "serde", + "serde_json", + "stun", + "thiserror", + "tokio", + "turn", + "url", + "uuid 1.7.0", + "waitgroup", + "webrtc-mdns", + "webrtc-util", +] + +[[package]] +name = "webrtc-mdns" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bebbd40e7f8b630a0f1a74783dbfff1edfc0ccaae891c4689891156a8c4d8c" +dependencies = [ + "log", + "socket2 0.5.5", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-media" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfde3c7b9450b67d466bb2f02c6d9ff9514d33535eb9994942afd1f828839d1" +dependencies = [ + "byteorder", + "bytes", + "rand", + "rtp", + "thiserror", +] + +[[package]] +name = "webrtc-sctp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1af6116b7f9703560c3ad0b32f67220b171bb1b59633b03563db8404d0e482ea" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "crc", + "log", + "rand", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-srtp" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1db1f36c1c81e4b1e531c0b9678ba0c93809e196ce62122d87259bb71c03b9f" +dependencies = [ + "aead", + "aes", + "aes-gcm", + "byteorder", + "bytes", + "ctr", + "hmac", + "log", + "rtcp", + "rtp", + "sha1", + "subtle", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-util" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adc96bee68417e1f4d19dd7698124a7f859db55ae2fd3eedbbb7e732f614735" +dependencies = [ + "async-trait", + "bitflags 1.3.2", + "bytes", + "cc", + "ipnet", + "lazy_static", + "libc", + "log", + "nix 0.26.4", + "rand", + "thiserror", + "tokio", + "winapi", +] + [[package]] name = "which" version = "4.4.2" @@ -6930,6 +7617,7 @@ dependencies = [ "lazy_static", "nom", "oid-registry", + "ring 0.16.20", "rusticata-macros", "thiserror", "time", diff --git a/Cargo.toml b/Cargo.toml index 7849078..4b1e1b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ futures-channel = "0.3.30" # WASM [target.'cfg(target_arch = "wasm32")'.dependencies] serde-wasm-bindgen = "0.6.3" -wasm-bindgen = "=0.2.89" +wasm-bindgen = "0.2.89" wasm-bindgen-futures = "0.4.39" tsify = "0.4.5" futures = "0.3.30" diff --git a/dojo.h b/dojo.h index 945df2b..7add880 100644 --- a/dojo.h +++ b/dojo.h @@ -76,6 +76,11 @@ typedef struct Resultbool { }; } Resultbool; +typedef struct CArrayu8 { + uint8_t *data; + uintptr_t data_len; +} CArrayu8; + typedef struct FieldElement { uint8_t data[32]; } FieldElement; @@ -275,11 +280,6 @@ typedef struct ResultCArrayEntity { }; } ResultCArrayEntity; -typedef struct CArrayu8 { - uint8_t *data; - uintptr_t data_len; -} CArrayu8; - typedef enum ValueType_Tag { String, Int, @@ -530,7 +530,22 @@ struct ResultToriiClient client_new(const char *torii_url, const struct KeysClause *entities, uintptr_t entities_len); -struct Resultbool client_on_message(struct ToriiClient *client, void (*callback)(void)); +void client_run_libp2p(struct ToriiClient *client); + +struct Resultbool client_on_message(struct ToriiClient *client, + void (*callback)(const char *propagation_source, + const char *source, + const char *message_id, + const char *topic, + struct CArrayu8 data)); + +struct Resultbool client_subscribe_topic(struct ToriiClient *client, const char *topic); + +struct Resultbool client_unsubscribe_topic(struct ToriiClient *client, const char *topic); + +struct Resultbool client_publish_message(struct ToriiClient *client, + const char *topic, + struct CArrayu8 data); struct ResultCOptionTy client_model(struct ToriiClient *client, const struct KeysClause *keys); diff --git a/example/main.c b/example/main.c index 95f0964..fc968d4 100644 --- a/example/main.c +++ b/example/main.c @@ -55,7 +55,7 @@ int main() entities[0].keys.data_len = 1; entities[0].keys.data[0] = playerKey; - ResultToriiClient resClient = client_new(torii_url, rpc_url, world, entities, 1); + ResultToriiClient resClient = client_new(torii_url, rpc_url, "/ip4/127.0.0.1/tcp/1010", world, entities, 1); if (resClient.tag == ErrAccount) { printf("Failed to create client: %s\n", resClient.err.message); @@ -76,6 +76,9 @@ int main() } CJsonRpcClient *provider = resProvider.ok; + // publish message + + // account ResultAccount resAccount = account_new(provider, signing_key, playerAddress); diff --git a/src/libc.rs b/src/libc.rs index 6fbf536..085291a 100644 --- a/src/libc.rs +++ b/src/libc.rs @@ -5,7 +5,6 @@ use crate::types::{ Query, Result, Signature, ToriiClient, Ty, WorldMetadata, }; use crate::utils::watch_tx; -use futures::channel::mpsc::UnboundedSender; use starknet::accounts::{Account as StarknetAccount, ExecutionEncoding, SingleOwnerAccount}; use starknet::core::utils::{ cairo_short_string_to_felt, get_contract_address, get_selector_from_name, @@ -71,26 +70,110 @@ pub unsafe extern "C" fn client_new( let client = client.unwrap(); Result::Ok(Box::into_raw(Box::new(ToriiClient { - inner: client, - runtime, - }))) + inner: client, + runtime, + }))) } #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn client_on_message(client: *mut ToriiClient, callback: unsafe extern "C" fn()) -> Result { - let (sender, receiver) = futures::channel::mpsc::unbounded(); - - (*client) - .runtime - .spawn((*client).inner.run_libp2p(&sender)); - +pub unsafe extern "C" fn client_run_libp2p(client: *mut ToriiClient) { + let libp2p_runner = (*client).inner.run_libp2p(); (*client).runtime.spawn(async move { - while let Some(_) = receiver.next().await { - callback(); + libp2p_runner.await; + }); +} + +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn client_on_message( + client: *mut ToriiClient, + callback: unsafe extern "C" fn( + propagation_source: *const c_char, + source: *const c_char, + message_id: *const c_char, + topic: *const c_char, + data: CArray, + ), +) -> Result { + let stream = (*client).inner.libp2p_message_stream(); + + (*client).runtime.spawn(async move { + while let Some(msg) = stream.lock().await.next().await { + let propagation_source = CString::new(msg.propagation_source).unwrap().into_raw(); + let source = CString::new(msg.source).unwrap().into_raw(); + let message_id = CString::new(msg.message_id.0).unwrap().into_raw(); + let topic = CString::new(msg.topic.as_str()).unwrap().into_raw(); + let data = msg.data.into(); + + callback(propagation_source, source, message_id, topic, data); } }); + + Result::Ok(true) +} + +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn client_subscribe_topic( + client: *mut ToriiClient, + topic: *const c_char, +) -> Result { + let topic = unsafe { CStr::from_ptr(topic).to_string_lossy().into_owned() }; + + let client_future = unsafe { (*client).inner.subscribe_topic(topic) }; + + let result = (*client).runtime.block_on(client_future); + + match result { + Ok(_) => Result::Ok(true), + Err(e) => Result::Err(Error { + message: CString::new(e.to_string()).unwrap().into_raw(), + }), + } +} + +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn client_unsubscribe_topic( + client: *mut ToriiClient, + topic: *const c_char, +) -> Result { + let topic = unsafe { CStr::from_ptr(topic).to_string_lossy().into_owned() }; + + let client_future = unsafe { (*client).inner.unsubscribe_topic(topic) }; + + let result = (*client).runtime.block_on(client_future); + + match result { + Ok(_) => Result::Ok(true), + Err(e) => Result::Err(Error { + message: CString::new(e.to_string()).unwrap().into_raw(), + }), + } +} + +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn client_publish_message( + client: *mut ToriiClient, + topic: *const c_char, + data: CArray, +) -> Result { + let topic = unsafe { CStr::from_ptr(topic).to_string_lossy().to_string() }; + let data = unsafe { std::slice::from_raw_parts(data.data, data.data_len) }; + + let client_future = unsafe { (*client).inner.publish_message(topic.as_str(), data) }; + + let result = (*client).runtime.block_on(client_future); + + match result { + Ok(_) => Result::Ok(true), + Err(e) => Result::Err(Error { + message: CString::new(e.to_string()).unwrap().into_raw(), + }), + } } #[no_mangle] @@ -130,8 +213,6 @@ pub unsafe extern "C" fn client_entities( let result = (*client).runtime.block_on(entities_future); - println!("result: {:?}", result); - match result { Ok(entities) => { let entities: Vec = entities.into_iter().map(|e| (&e).into()).collect(); From 81db77aab455e28d0bbbe631837d1971cd58ef38 Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 10:26:45 -0500 Subject: [PATCH 3/9] feat: added libp2p to example file --- example/main.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++-- src/libc.rs | 6 +++--- 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/example/main.c b/example/main.c index fc968d4..8aaef46 100644 --- a/example/main.c +++ b/example/main.c @@ -23,6 +23,21 @@ void on_entity_state_update(FieldElement key, CArrayModel models) } } +void on_message(const char *propagation_source, const char *source, const char *message_id, const char *topic, CArrayu8 data) +{ + printf("on_message\n"); + printf("Propagation source: %s\n", propagation_source); + printf("Source: %s\n", source); + printf("Message id: %s\n", message_id); + printf("Topic: %s\n", topic); + printf("Data: "); + for (size_t i = 0; i < data.data_len; i++) + { + printf("%02x", data.data[i]); + } + printf("\n"); +} + void hex_to_bytes(const char *hex, FieldElement* felt) { @@ -55,7 +70,7 @@ int main() entities[0].keys.data_len = 1; entities[0].keys.data[0] = playerKey; - ResultToriiClient resClient = client_new(torii_url, rpc_url, "/ip4/127.0.0.1/tcp/1010", world, entities, 1); + ResultToriiClient resClient = client_new(torii_url, rpc_url, "/ip4/127.0.0.1/tcp/9090", world, entities, 1); if (resClient.tag == ErrAccount) { printf("Failed to create client: %s\n", resClient.err.message); @@ -76,8 +91,44 @@ int main() } CJsonRpcClient *provider = resProvider.ok; + // run libp2p + client_run_libp2p(client); + + // subscribe to topic + Resultbool resSub = client_subscribe_topic(client, "mimi"); + if (resSub.tag == Errbool) + { + printf("Failed to subscribe to topic: %s\n", resSub.err.message); + return 1; + } + + sleep(1); + + // handle message + Resultbool resHandle = client_on_message(client, &on_message); + if (resHandle.tag == Errbool) + { + printf("Failed to set message handler: %s\n", resHandle.err.message); + return 1; + } + // publish message - + CArrayu8 message_data = { + .data = malloc(sizeof(uint8_t)*4), + .data_len = 4, + }; + + message_data.data[0] = 0x01; + message_data.data[1] = 0x02; + message_data.data[2] = 0x03; + message_data.data[3] = 0x04; + + Resultbool resPub = client_publish_message(client, "mimi", message_data); + if (resPub.tag == Errbool) + { + printf("Failed to publish message: %s\n", resPub.err.message); + return 1; + } // account diff --git a/src/libc.rs b/src/libc.rs index 085291a..c8353f8 100644 --- a/src/libc.rs +++ b/src/libc.rs @@ -101,9 +101,9 @@ pub unsafe extern "C" fn client_on_message( (*client).runtime.spawn(async move { while let Some(msg) = stream.lock().await.next().await { - let propagation_source = CString::new(msg.propagation_source).unwrap().into_raw(); - let source = CString::new(msg.source).unwrap().into_raw(); - let message_id = CString::new(msg.message_id.0).unwrap().into_raw(); + let propagation_source = CString::new(msg.propagation_source.to_string()).unwrap().into_raw(); + let source = CString::new(msg.source.to_string()).unwrap().into_raw(); + let message_id = CString::new(msg.message_id.to_string()).unwrap().into_raw(); let topic = CString::new(msg.topic.as_str()).unwrap().into_raw(); let data = msg.data.into(); From 422fe076b589f9e03b23b3ca01129e34e8cf807c Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 12:58:52 -0500 Subject: [PATCH 4/9] feat: libp2p wasm support --- Cargo.toml | 3 +- src/lib.rs | 2 +- src/libc.rs | 1 - src/libwasm.rs | 149 +++++++++++++++++++++++++++++++++++++++++++++---- src/types.rs | 1 - 5 files changed, 141 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4b1e1b7..eb984dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,12 +25,11 @@ futures = "0.3.30" futures-channel = "0.3.30" # WASM -[target.'cfg(target_arch = "wasm32")'.dependencies] +# [target.'cfg(target_arch = "wasm32")'.dependencies] serde-wasm-bindgen = "0.6.3" wasm-bindgen = "0.2.89" wasm-bindgen-futures = "0.4.39" tsify = "0.4.5" -futures = "0.3.30" serde_json = "1.0.111" js-sys = "0.3.66" web-sys = { version = "0.3.4", features = [ diff --git a/src/lib.rs b/src/lib.rs index bd89148..ae9f30b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,6 @@ mod utils; #[cfg(not(target_arch = "wasm32"))] mod libc; -#[cfg(target_arch = "wasm32")] +// #[cfg(target_arch = "wasm32")] /// cbindgen:ignore mod libwasm; diff --git a/src/libc.rs b/src/libc.rs index c8353f8..7fec442 100644 --- a/src/libc.rs +++ b/src/libc.rs @@ -68,7 +68,6 @@ pub unsafe extern "C" fn client_new( } let client = client.unwrap(); - Result::Ok(Box::into_raw(Box::new(ToriiClient { inner: client, runtime, diff --git a/src/libwasm.rs b/src/libwasm.rs index 0d0207f..38e6907 100644 --- a/src/libwasm.rs +++ b/src/libwasm.rs @@ -1,7 +1,9 @@ //! Minimal JS bindings for the torii client. use std::str::FromStr; +use std::sync::Arc; +use futures::lock::Mutex; use futures::StreamExt; use serde::{Deserialize, Serialize}; use starknet::accounts::{ @@ -145,6 +147,8 @@ pub struct ClientConfig { pub rpc_url: String, #[serde(rename = "toriiUrl")] pub torii_url: String, + #[serde(rename = "relayUrl")] + pub relay_url: String, #[serde(rename = "worldAddress")] pub world_address: String, } @@ -160,7 +164,7 @@ extern "C" { #[wasm_bindgen] pub struct Client { - inner: torii_client::client::Client, + inner: Arc>, } #[derive(Tsify, Serialize, Deserialize)] @@ -481,6 +485,8 @@ impl Client { let results = self .inner + .lock() + .await .entities(Query { clause: None, limit, @@ -515,6 +521,8 @@ impl Client { let results = self .inner + .lock() + .await .entities(Query { clause: Some(Clause::Keys(KeysClause { model: model.to_string(), @@ -551,6 +559,8 @@ impl Client { match self .inner + .lock() + .await .model(&KeysClause { model: model.to_string(), keys, @@ -581,6 +591,8 @@ impl Client { .collect::, _>>()?; self.inner + .lock() + .await .add_models_to_sync(models) .await .map_err(|err| JsValue::from(err.to_string())) @@ -603,6 +615,8 @@ impl Client { .collect::, _>>()?; self.inner + .lock() + .await .remove_models_to_sync(models) .await .map_err(|err| JsValue::from(err.to_string())) @@ -610,7 +624,7 @@ impl Client { /// Register a callback to be called every time the specified synced entity's value changes. #[wasm_bindgen(js_name = onSyncModelChange)] - pub fn on_sync_model_change( + pub async fn on_sync_model_change( &self, model: IEntityModel, callback: js_sys::Function, @@ -622,6 +636,8 @@ impl Client { let name = cairo_short_string_to_felt(&model.model).expect("invalid model name"); let mut rcv = self .inner + .lock() + .await .storage() .add_listener(name, &model.keys) .unwrap(); @@ -653,7 +669,13 @@ impl Client { }) .collect::, _>>()?; - let mut stream = self.inner.on_entity_updated(ids).await.unwrap(); + let mut stream = self + .inner + .lock() + .await + .on_entity_updated(ids) + .await + .unwrap(); wasm_bindgen_futures::spawn_local(async move { while let Some(update) = stream.next().await { @@ -668,6 +690,91 @@ impl Client { Ok(()) } + + #[wasm_bindgen(js_name = subscribeTopic)] + pub async fn subscribe_topic( + &self, + topic: String, + callback: js_sys::Function, + ) -> Result { + #[cfg(feature = "console-error-panic")] + console_error_panic_hook::set_once(); + + let sub = self + .inner + .lock() + .await + .subscribe_topic(topic) + .await + .map_err(|err| JsValue::from(err.to_string()))?; + + Ok(sub) + } + + #[wasm_bindgen(js_name = unsubscribeTopic)] + pub async fn unsubscribe_topic(&self, topic: String) -> Result { + #[cfg(feature = "console-error-panic")] + console_error_panic_hook::set_once(); + + let sub = self + .inner + .lock() + .await + .unsubscribe_topic(topic) + .await + .map_err(|err| JsValue::from(err.to_string()))?; + + Ok(sub) + } + + #[wasm_bindgen(js_name = publishMessage)] + pub async fn publish_message( + &self, + topic: &str, + message: &[u8], + ) -> Result { + #[cfg(feature = "console-error-panic")] + console_error_panic_hook::set_once(); + + let message_id = self + .inner + .lock() + .await + .publish_message(topic, message) + .await + .map_err(|err| JsValue::from(err.to_string()))?; + + Ok(message_id.as_slice().into()) + } + + #[wasm_bindgen(js_name = onMessage)] + pub async fn on_message( + &self, + callback: js_sys::Function, + ) -> Result<(), JsValue> { + #[cfg(feature = "console-error-panic")] + console_error_panic_hook::set_once(); + + let stream = self.inner.lock().await.libp2p_message_stream(); + + wasm_bindgen_futures::spawn_local(async move { + while let Some(message) = stream.lock().await.next().await { + let array = &js_sys::Array::new(); + array.push(&JsValue::from_str(message.propagation_source.to_string().as_str())); + array.push(&JsValue::from_str(message.source.to_string().as_str())); + array.push(&JsValue::from_str(message.message_id.to_string().as_str())); + array.push(&JsValue::from_str(message.topic.as_str())); + array.push(&js_sys::Uint8Array::from(message.data.as_slice())); + + let _ = callback.apply( + &JsValue::null(), + array + ); + } + }); + + Ok(()) + } } /// Create the a client with the given configurations. @@ -683,6 +790,7 @@ pub async fn create_client( let ClientConfig { rpc_url, torii_url, + relay_url, world_address, } = config; @@ -694,15 +802,36 @@ pub async fn create_client( let world_address = FieldElement::from_str(&world_address) .map_err(|err| JsValue::from(format!("failed to parse world address: {err}")))?; - let client = torii_client::client::Client::new(torii_url, rpc_url, world_address, Some(models)) + let client = Arc::new(Mutex::new( + torii_client::client::Client::new( + torii_url, + rpc_url, + relay_url, + world_address, + Some(models), + ) .await - .map_err(|err| JsValue::from(format!("failed to build client: {err}")))?; + .map_err(|err| JsValue::from(format!("failed to build client: {err}")))?, + )); + + let client_subscription = client.clone(); + wasm_bindgen_futures::spawn_local( + client_subscription + .lock() + .await + .start_subscription() + .await + .map_err(|err| { + JsValue::from(format!( + "failed to start torii client subscription service: {err}" + )) + })?, + ); - wasm_bindgen_futures::spawn_local(client.start_subscription().await.map_err(|err| { - JsValue::from(format!( - "failed to start torii client subscription service: {err}" - )) - })?); + let client_libp2p = client.clone(); + wasm_bindgen_futures::spawn_local(async move { + client_libp2p.lock().await.run_libp2p().await; + }); Ok(Client { inner: client }) } diff --git a/src/types.rs b/src/types.rs index debc59e..5c240e4 100644 --- a/src/types.rs +++ b/src/types.rs @@ -19,7 +19,6 @@ pub enum Result { Ok(T), Err(Error), } - #[derive(Debug, Clone)] #[repr(C)] pub enum COption { From 73044685589c880649c910f901c2890cc78ba1db Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 13:13:16 -0500 Subject: [PATCH 5/9] chore --- src/lib.rs | 2 +- src/libwasm.rs | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ae9f30b..bd89148 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,6 @@ mod utils; #[cfg(not(target_arch = "wasm32"))] mod libc; -// #[cfg(target_arch = "wasm32")] +#[cfg(target_arch = "wasm32")] /// cbindgen:ignore mod libwasm; diff --git a/src/libwasm.rs b/src/libwasm.rs index 38e6907..a4ef94d 100644 --- a/src/libwasm.rs +++ b/src/libwasm.rs @@ -748,10 +748,7 @@ impl Client { } #[wasm_bindgen(js_name = onMessage)] - pub async fn on_message( - &self, - callback: js_sys::Function, - ) -> Result<(), JsValue> { + pub async fn on_message(&self, callback: js_sys::Function) -> Result<(), JsValue> { #[cfg(feature = "console-error-panic")] console_error_panic_hook::set_once(); @@ -759,17 +756,20 @@ impl Client { wasm_bindgen_futures::spawn_local(async move { while let Some(message) = stream.lock().await.next().await { - let array = &js_sys::Array::new(); - array.push(&JsValue::from_str(message.propagation_source.to_string().as_str())); - array.push(&JsValue::from_str(message.source.to_string().as_str())); - array.push(&JsValue::from_str(message.message_id.to_string().as_str())); - array.push(&JsValue::from_str(message.topic.as_str())); - array.push(&js_sys::Uint8Array::from(message.data.as_slice())); - - let _ = callback.apply( - &JsValue::null(), - array + let array = &js_sys::Array::new_with_length(5); + array.set( + 0, + JsValue::from_str(message.propagation_source.to_string().as_str()), + ); + array.set(1, JsValue::from_str(message.source.to_string().as_str())); + array.set( + 2, + JsValue::from_str(message.message_id.to_string().as_str()), ); + array.set(3, JsValue::from_str(message.topic.as_str())); + array.set(4, js_sys::Uint8Array::from(message.data.as_slice()).into()); + + let _ = callback.apply(&JsValue::null(), array); } }); From e13c7b2e84a3f48cf5ccf729e5d5d9f51ea5abc1 Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 13:18:53 -0500 Subject: [PATCH 6/9] fmt + clippy --- src/libc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libc.rs b/src/libc.rs index 7fec442..5e109da 100644 --- a/src/libc.rs +++ b/src/libc.rs @@ -100,7 +100,9 @@ pub unsafe extern "C" fn client_on_message( (*client).runtime.spawn(async move { while let Some(msg) = stream.lock().await.next().await { - let propagation_source = CString::new(msg.propagation_source.to_string()).unwrap().into_raw(); + let propagation_source = CString::new(msg.propagation_source.to_string()) + .unwrap() + .into_raw(); let source = CString::new(msg.source.to_string()).unwrap().into_raw(); let message_id = CString::new(msg.message_id.to_string()).unwrap().into_raw(); let topic = CString::new(msg.topic.as_str()).unwrap().into_raw(); From a45cf373a0e5b35c776f07be862affc1a6549cd1 Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 13:20:50 -0500 Subject: [PATCH 7/9] wasm deps --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index eb984dc..6eb0c9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ futures = "0.3.30" futures-channel = "0.3.30" # WASM -# [target.'cfg(target_arch = "wasm32")'.dependencies] +[target.'cfg(target_arch = "wasm32")'.dependencies] serde-wasm-bindgen = "0.6.3" wasm-bindgen = "0.2.89" wasm-bindgen-futures = "0.4.39" From b33fd78c248eaac80b99172028cc5b1204db581d Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 13:23:05 -0500 Subject: [PATCH 8/9] fix: ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed6ce8..199394e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - RUST_VERSION: 1.70.0 + RUST_VERSION: 1.73.0 jobs: test: From 740b6dcc767069a22c1f26834cb5670165c870be Mon Sep 17 00:00:00 2001 From: Nasr Date: Thu, 25 Jan 2024 13:29:38 -0500 Subject: [PATCH 9/9] main dojo repo --- Cargo.lock | 34 +++++++++++++++++----------------- Cargo.toml | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 519cf4b..8bd759e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1733,8 +1733,8 @@ dependencies = [ [[package]] name = "dojo-types" -version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" +version = "0.5.1-alpha.1" +source = "git+https://github.com/dojoengine/dojo#68e21992da4a1d038be316801b30eee98c4fc5ce" dependencies = [ "crypto-bigint", "hex", @@ -1749,8 +1749,8 @@ dependencies = [ [[package]] name = "dojo-world" -version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" +version = "0.5.1-alpha.1" +source = "git+https://github.com/dojoengine/dojo#68e21992da4a1d038be316801b30eee98c4fc5ce" dependencies = [ "anyhow", "async-trait", @@ -4252,18 +4252,18 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", @@ -4821,7 +4821,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.4", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -4836,9 +4836,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -6550,8 +6550,8 @@ dependencies = [ [[package]] name = "torii-client" -version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" +version = "0.5.1-alpha.1" +source = "git+https://github.com/dojoengine/dojo#68e21992da4a1d038be316801b30eee98c4fc5ce" dependencies = [ "async-trait", "crypto-bigint", @@ -6578,8 +6578,8 @@ dependencies = [ [[package]] name = "torii-grpc" -version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" +version = "0.5.1-alpha.1" +source = "git+https://github.com/dojoengine/dojo#68e21992da4a1d038be316801b30eee98c4fc5ce" dependencies = [ "bytes", "crypto-bigint", @@ -6617,8 +6617,8 @@ dependencies = [ [[package]] name = "torii-relay" -version = "0.5.1-alpha.0" -source = "git+https://github.com/Larkooo/dojo?branch=torii-libp2p#fbe2874bb047c74800b4f4cfc8b4706ffb105de1" +version = "0.5.1-alpha.1" +source = "git+https://github.com/dojoengine/dojo#68e21992da4a1d038be316801b30eee98c4fc5ce" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 6eb0c9e..f58a521 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,9 @@ version = "0.1.1" crate-type = ["cdylib", "rlib"] [dependencies] -dojo-types = { git = "https://github.com/Larkooo/dojo", branch = "torii-libp2p"} -torii-client = { git = "https://github.com/Larkooo/dojo", branch = "torii-libp2p" } -torii-grpc = { git = "https://github.com/Larkooo/dojo", branch = "torii-libp2p", features = [ +dojo-types = { git = "https://github.com/dojoengine/dojo" } +torii-client = { git = "https://github.com/dojoengine/dojo" } +torii-grpc = { git = "https://github.com/dojoengine/dojo", features = [ "client", ] }