diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 80df4ba9..755ffdc2 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -7,7 +7,7 @@ name: Security audit - daily # Run if workflow changes - '.github/workflows/audit.yml' # Run on changed dependencies - - '**/Cargo.toml' + - '../../p2pool/Cargo.toml' - '**/Cargo.lock' # Run if the configuration file changes - '**/audit.toml' diff --git a/Cargo.lock b/Cargo.lock index 34a4cae5..4f5bd2af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,6 +52,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "aes-kw" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69fa2b352dcefb5f7f3a5fb840e02665d311d878955380515e4fd50095dd3d8c" +dependencies = [ + "aes", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -151,7 +160,20 @@ checksum = "db4ce4441f99dbd377ca8a8f57b698c44d0d6e712d8329b5040da5a64aa1ce73" dependencies = [ "base64ct", "blake2", - "password-hash", + "password-hash 0.4.2", +] + +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash 0.5.0", + "zeroize", ] [[package]] @@ -315,12 +337,60 @@ dependencies = [ "url", ] +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "autotools" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf" +dependencies = [ + "cc", +] + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core 0.3.4", + "bitflags 1.3.2", + "bytes 1.7.2", + "futures-util", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 0.1.2", + "tower 0.4.13", + "tower-layer", + "tower-service", +] + [[package]] name = "axum" version = "0.7.7" @@ -328,7 +398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.4.5", "bytes 1.7.2", "futures-util", "http 1.1.0", @@ -355,6 +425,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes 1.7.2", + "futures-util", + "http 0.2.12", + "http-body 0.4.6", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-core" version = "0.4.5" @@ -458,6 +545,12 @@ dependencies = [ "serde", ] +[[package]] +name = "bitfield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7e60934ceec538daadb9d8432424ed043a904d8e0243f3c6446bce549a46ac" + [[package]] name = "bitflags" version = "0.9.1" @@ -515,6 +608,25 @@ 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 = "blowfish" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" +dependencies = [ + "byteorder", + "cipher 0.4.4", +] + [[package]] name = "borsh" version = "1.5.1" @@ -554,6 +666,25 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "bstr" +version = "1.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "buffer-redux" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e8acf87c5b9f5897cd3ebb9a327f420e0cae9dd4e5c1d2e36f2c84c571a58f1" +dependencies = [ + "memchr", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -566,6 +697,18 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +[[package]] +name = "bytecount" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" + +[[package]] +name = "bytemuck" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" + [[package]] name = "byteorder" version = "1.5.0" @@ -587,6 +730,25 @@ dependencies = [ "serde", ] +[[package]] +name = "camellia" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3264e2574e9ef2b53ce6f536dea83a69ac0bc600b762d1523ff83fe07230ce30" +dependencies = [ + "byteorder", + "cipher 0.4.4", +] + +[[package]] +name = "cast5" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b07d673db1ccf000e90f54b819db9e75a8348d6eb056e9b8ab53231b7a9911" +dependencies = [ + "cipher 0.4.4", +] + [[package]] name = "cbor4ii" version = "0.3.3" @@ -602,9 +764,20 @@ version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cfb-mode" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "738b8d467867f80a71351933f70461f5b56f24d5c93e0cf216e59229c968d330" +dependencies = [ + "cipher 0.4.4", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -652,6 +825,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "checked_int_cast" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" + [[package]] name = "chrono" version = "0.4.39" @@ -704,8 +883,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "bitflags 1.3.2", - "textwrap", - "unicode-width", + "textwrap 0.11.0", + "unicode-width 0.1.14", +] + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive 3.2.25", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap 0.16.1", ] [[package]] @@ -715,7 +911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", - "clap_derive", + "clap_derive 4.5.18", ] [[package]] @@ -726,8 +922,22 @@ checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", - "clap_lex", - "strsim", + "clap_lex 0.7.2", + "strsim 0.11.1", + "terminal_size", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -742,12 +952,49 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "clap_lex" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +[[package]] +name = "clipboard-win" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" +dependencies = [ + "error-code", + "str-buf", + "winapi", +] + +[[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher 0.4.4", + "dbl", + "digest", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "colorchoice" version = "1.0.2" @@ -769,11 +1016,67 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7328b20597b53c2454f0b1919720c25c7339051c02b72b7e05409e00b14132be" dependencies = [ + "async-trait", + "convert_case 0.6.0", + "json5", "lazy_static", "nom", "pathdiff", + "ron", + "rust-ini", + "serde", + "serde_json", + "toml 0.8.20", + "yaml-rust", +] + +[[package]] +name = "console" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "console-api" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2895653b4d9f1538a83970077cb01dfc77a4810524e51a110944688e916b18e" +dependencies = [ + "prost 0.11.9", + "prost-types 0.11.9", + "tonic 0.9.2", + "tracing-core", +] + +[[package]] +name = "console-subscriber" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4cf42660ac07fcebed809cfe561dd8730bcd35b075215e6479c516bcd0d11cb" +dependencies = [ + "console-api", + "crossbeam-channel", + "crossbeam-utils", + "futures 0.3.30", + "hdrhistogram", + "humantime", + "prost-types 0.11.9", "serde", - "toml 0.8.19", + "serde_json", + "thread_local", + "tokio", + "tokio-stream", + "tonic 0.9.2", + "tracing", + "tracing-core", + "tracing-subscriber", ] [[package]] @@ -782,6 +1085,41 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -792,6 +1130,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -816,6 +1164,12 @@ dependencies = [ "libc", ] +[[package]] +name = "crc24" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd121741cf3eb82c08dd3023eb55bf2665e5f60ec20f89760cf836ae4562e6a0" + [[package]] name = "crc32fast" version = "1.4.2" @@ -831,6 +1185,15 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" +[[package]] +name = "crossbeam-channel" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.5" @@ -856,6 +1219,32 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +[[package]] +name = "crossterm" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +dependencies = [ + "bitflags 1.3.2", + "crossterm_winapi", + "futures-core", + "libc", + "mio 0.8.11", + "parking_lot", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b" +dependencies = [ + "winapi", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -869,7 +1258,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -881,7 +1270,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "typenum", ] @@ -894,6 +1283,69 @@ dependencies = [ "cipher 0.4.4", ] +[[package]] +name = "cucumber" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5063d8cf24f4998ad01cac265da468a15ca682a8f4f826d50e661964e8d9b8" +dependencies = [ + "anyhow", + "async-trait", + "clap 4.5.18", + "console", + "cucumber-codegen", + "cucumber-expressions", + "derive_more 0.99.19", + "drain_filter_polyfill", + "either", + "futures 0.3.30", + "gherkin", + "globwalk", + "humantime", + "inventory", + "itertools 0.12.1", + "junit-report", + "lazy-regex", + "linked-hash-map", + "once_cell", + "pin-project 1.1.5", + "regex", + "sealed", + "serde", + "serde_json", + "smart-default", +] + +[[package]] +name = "cucumber-codegen" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01091e28d1f566c8b31b67948399d2efd6c0a8f6228a9785519ed7b73f7f0aef" +dependencies = [ + "cucumber-expressions", + "inflections", + "itertools 0.12.1", + "proc-macro2", + "quote", + "regex", + "syn 2.0.77", + "synthez", +] + +[[package]] +name = "cucumber-expressions" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d794fed319eea24246fb5f57632f7ae38d61195817b7eb659455aa5bdd7c1810" +dependencies = [ + "derive_more 0.99.19", + "either", + "nom", + "nom_locate", + "regex", + "regex-syntax 0.7.5", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -904,9 +1356,9 @@ dependencies = [ "cpufeatures", "curve25519-dalek-derive", "digest", - "fiat-crypto", + "fiat-crypto 0.2.9", "group", - "rand_core", + "rand_core 0.6.4", "rustc_version", "serde", "subtle", @@ -944,7 +1396,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.11.1", "syn 2.0.77", ] @@ -985,6 +1437,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array", +] + [[package]] name = "decimal-rs" version = "0.1.43" @@ -1039,12 +1500,109 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-getters" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2c35ab6e03642397cdda1dd58abbc05d418aef8e36297f336d5aba060fe8df" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.77", +] + +[[package]] +name = "derive_more" +version = "0.99.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f" +dependencies = [ + "convert_case 0.4.0", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.77", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", + "unicode-xid", +] + +[[package]] +name = "des" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdd80ce8ce993de27e9f063a444a4d53ce8e8db4c1f00cc03af5ad5a9867a1e" +dependencies = [ + "cipher 0.4.4", +] + [[package]] name = "destructure_traitobject" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7" +[[package]] +name = "dialoguer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +dependencies = [ + "console", + "shell-words", + "tempfile", + "zeroize", +] + [[package]] name = "diesel" version = "2.2.4" @@ -1127,6 +1685,16 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" version = "0.3.7" @@ -1160,12 +1728,43 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] + [[package]] name = "doc-comment" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "drain_filter_polyfill" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "669a445ee724c5c69b1b06fe0b63e70a1c84bc9bb7d9696cd4f4e3ec45050408" + +[[package]] +name = "dsa" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48bc224a9084ad760195584ce5abb3c2c34a225fa312a128ad245a6b412b7689" +dependencies = [ + "digest", + "num-bigint-dig", + "num-traits", + "pkcs8", + "rfc6979", + "sha2", + "signature", + "zeroize", +] + [[package]] name = "dsl_auto_type" version = "0.1.2" @@ -1186,6 +1785,19 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" +[[package]] +name = "eax" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9954fabd903b82b9d7a68f65f97dc96dd9ad368e40ccc907a7c19d53e6bfac28" +dependencies = [ + "aead", + "cipher 0.4.4", + "cmac", + "ctr", + "subtle", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -1218,13 +1830,24 @@ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core", + "rand_core 0.6.4", "serde", "sha2", "subtle", "zeroize", ] +[[package]] +name = "ed448-goldilocks" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87b5fa9e9e3dd5fe1369f380acd3dcdfa766dbd0a1cd5b048fb40e38a6a78e79" +dependencies = [ + "fiat-crypto 0.1.20", + "hex", + "subtle", +] + [[package]] name = "either" version = "1.13.0" @@ -1243,14 +1866,30 @@ dependencies = [ "ff", "generic-array", "group", + "hkdf", "pem-rfc7468", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", ] +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "endian-type" version = "0.1.2" @@ -1285,6 +1924,16 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "error-code" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" +dependencies = [ + "libc", + "str-buf", +] + [[package]] name = "event-listener" version = "5.3.1" @@ -1312,16 +1961,33 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +[[package]] +name = "fd-lock" +version = "3.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" +dependencies = [ + "cfg-if", + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "ff" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + [[package]] name = "fiat-crypto" version = "0.2.9" @@ -1346,6 +2012,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1392,6 +2068,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "funty" version = "2.0.0" @@ -1581,6 +2263,23 @@ dependencies = [ "polyval", ] +[[package]] +name = "gherkin" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b79820c0df536d1f3a089a2fa958f61cb96ce9e0f3f8f507f5a31179567755" +dependencies = [ + "heck 0.4.1", + "peg", + "quote", + "serde", + "serde_json", + "syn 2.0.77", + "textwrap 0.16.1", + "thiserror", + "typed-builder", +] + [[package]] name = "gimli" version = "0.31.0" @@ -1588,27 +2287,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] -name = "group" -version = "0.13.0" +name = "git2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "ff", - "rand_core", - "subtle", + "bitflags 2.6.0", + "libc", + "libgit2-sys", + "log", + "url", ] [[package]] -name = "h2" -version = "0.3.26" +name = "globset" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" dependencies = [ - "bytes 1.7.2", - "fnv", - "futures-core", - "futures-sink", - "futures-util", + "aho-corasick", + "bstr", + "log", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "globwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +dependencies = [ + "bitflags 1.3.2", + "ignore", + "walkdir", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes 1.7.2", + "fnv", + "futures-core", + "futures-sink", + "futures-util", "http 0.2.12", "indexmap 2.5.0", "slab", @@ -1648,6 +2384,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "hashbrown" version = "0.14.5" @@ -1671,7 +2413,10 @@ version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ + "base64 0.21.7", "byteorder", + "flate2", + "nom", "num-traits", ] @@ -1696,6 +2441,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.9" @@ -1714,6 +2468,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + [[package]] name = "hex-literal" version = "0.4.1" @@ -2012,6 +2772,18 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper 0.14.30", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "hyper-timeout" version = "0.5.1" @@ -2025,6 +2797,19 @@ dependencies = [ "tower-service", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes 1.7.2", + "hyper 0.14.30", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "hyper-util" version = "0.1.8" @@ -2074,6 +2859,15 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" +[[package]] +name = "idea" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "075557004419d7f2031b8bb7f44bb43e55a83ca7b63076a8fb8fe75753836477" +dependencies = [ + "cipher 0.4.4", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2117,7 +2911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ "async-io", - "core-foundation", + "core-foundation 0.9.4", "fnv", "futures 0.3.30", "if-addrs", @@ -2148,6 +2942,36 @@ dependencies = [ "xmltree", ] +[[package]] +name = "ignore" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata 0.4.7", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.23.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-iter", + "num-rational 0.3.2", + "num-traits", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -2197,6 +3021,12 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "inflections" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" + [[package]] name = "inout" version = "0.1.3" @@ -2221,6 +3051,15 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" +[[package]] +name = "inventory" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b12ebb6799019b044deaf431eadfe23245b259bba5a2c0796acec3943a3cdb" +dependencies = [ + "rustversion", +] + [[package]] name = "ipconfig" version = "0.3.2" @@ -2245,6 +3084,12 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "iter-read" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071ed4cc1afd86650602c7b11aa2e1ce30762a1c27193201cb5cee9c6ebb1294" + [[package]] name = "itertools" version = "0.10.5" @@ -2278,6 +3123,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.70" @@ -2287,6 +3141,43 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + +[[package]] +name = "junit-report" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c3a3342e6720a82d7d179f380e9841b73a1dd49344e33959fdfe571ce56b55" +dependencies = [ + "derive-getters", + "quick-xml", + "strip-ansi-escapes", + "time", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + [[package]] name = "keccak" version = "0.1.5" @@ -2296,11 +3187,37 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "lazy-regex" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.77", +] + [[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] [[package]] name = "libc" @@ -2308,6 +3225,18 @@ version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +[[package]] +name = "libgit2-sys" +version = "0.16.2+1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" +dependencies = [ + "cc", + "libc", + "libz-sys", + "pkg-config", +] + [[package]] name = "liblmdb-sys" version = "0.2.2" @@ -2395,7 +3324,7 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec", "rand", - "rand_core", + "rand_core 0.6.4", "thiserror", "tracing", "void", @@ -2885,6 +3814,64 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "libtor" +version = "47.13.0+0.4.7.x" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1be588c6a2f02b860a1c0e3b2a59edcb171058f8da71b8ca0ddd7bb40f102c5c" +dependencies = [ + "libtor-derive", + "libtor-sys", + "log", + "rand", + "sha1 0.6.0", +] + +[[package]] +name = "libtor-derive" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177781b25e83853831c5af66320ceaf5e456e1b6d533426fcd9c7544b5543043" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "libtor-src" +version = "47.13.0+0.4.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e73bef51ecfbe7e63ce5cb8757ebc59d09dca6985da7f7470931ac22eab00719" +dependencies = [ + "fs_extra", +] + +[[package]] +name = "libtor-sys" +version = "47.13.0+0.4.7.x" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb0bc2cfc5d03851617d33508acc511e46f0c2b3cbc3cda85defcb50efa628bb" +dependencies = [ + "autotools", + "cc", + "libtor-src", + "libz-sys", + "openssl-sys", +] + +[[package]] +name = "libz-sys" +version = "1.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -3009,18 +3996,46 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-stats" version = "1.2.0" @@ -3039,7 +4054,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core", + "rand_core 0.6.4", "zeroize", ] @@ -3050,7 +4065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" dependencies = [ "serde", - "toml 0.8.19", + "toml 0.8.20", ] [[package]] @@ -3090,7 +4105,7 @@ name = "minotari_app_grpc" version = "1.11.1-pre.0" source = "git+https://github.com/tari-project/tari.git?rev=53c1d47971994b2ac8795768e4b8a44800ea9988#53c1d47971994b2ac8795768e4b8a44800ea9988" dependencies = [ - "argon2", + "argon2 0.4.1", "base64 0.13.1", "borsh", "chrono", @@ -3110,11 +4125,33 @@ dependencies = [ "tari_utilities", "thiserror", "tokio", - "tonic", + "tonic 0.12.3", "tonic-build", "zeroize", ] +[[package]] +name = "minotari_app_utilities" +version = "1.11.1-pre.0" +source = "git+https://github.com/tari-project/tari.git?rev=53c1d47971994b2ac8795768e4b8a44800ea9988#53c1d47971994b2ac8795768e4b8a44800ea9988" +dependencies = [ + "clap 3.2.25", + "dialoguer", + "futures 0.3.30", + "json5", + "log", + "rand", + "serde", + "tari_common", + "tari_common_types", + "tari_comms", + "tari_features", + "tari_utilities", + "thiserror", + "tokio", + "tonic 0.12.3", +] + [[package]] name = "minotari_ledger_wallet_common" version = "1.11.1-pre.0" @@ -3123,6 +4160,51 @@ dependencies = [ "bs58 0.5.1", ] +[[package]] +name = "minotari_node" +version = "1.11.1-pre.0" +source = "git+https://github.com/tari-project/tari.git?rev=53c1d47971994b2ac8795768e4b8a44800ea9988#53c1d47971994b2ac8795768e4b8a44800ea9988" +dependencies = [ + "anyhow", + "async-trait", + "bincode", + "borsh", + "chrono", + "clap 3.2.25", + "config", + "console-subscriber", + "crossterm", + "derive_more 0.99.19", + "either", + "futures 0.3.30", + "log", + "log4rs", + "minotari_app_grpc", + "minotari_app_utilities", + "nom", + "qrcode", + "rustyline", + "rustyline-derive", + "serde", + "serde_json", + "strum", + "tari_common", + "tari_common_types", + "tari_comms", + "tari_comms_dht", + "tari_core", + "tari_features", + "tari_libtor", + "tari_p2p", + "tari_service_framework", + "tari_shutdown", + "tari_storage", + "tari_utilities", + "thiserror", + "tokio", + "tonic 0.12.3", +] + [[package]] name = "minotari_node_grpc_client" version = "0.1.0" @@ -3131,6 +4213,18 @@ dependencies = [ "minotari_app_grpc", ] +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "log", + "wasi", + "windows-sys 0.48.0", +] + [[package]] name = "mio" version = "1.0.2" @@ -3153,7 +4247,7 @@ dependencies = [ "curve25519-dalek", "fixed-hash", "hex", - "hex-literal", + "hex-literal 0.4.1", "sealed", "serde", "thiserror", @@ -3264,6 +4358,23 @@ dependencies = [ "unsigned-varint 0.7.2", ] +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework 2.11.1", + "security-framework-sys", + "tempfile", +] + [[package]] name = "netlink-packet-core" version = "0.4.2" @@ -3345,6 +4456,19 @@ dependencies = [ "smallvec", ] +[[package]] +name = "nix" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if", + "libc", + "memoffset", +] + [[package]] name = "nix" version = "0.24.3" @@ -3372,6 +4496,17 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom_locate" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e3c83c053b0713da60c5b8de47fe8e494fe3ece5267b2f23090a07a053ba8f3" +dependencies = [ + "bytecount", + "memchr", + "nom", +] + [[package]] name = "ntapi" version = "0.4.1" @@ -3391,7 +4526,7 @@ dependencies = [ "num-complex", "num-integer", "num-iter", - "num-rational", + "num-rational 0.4.2", "num-traits", ] @@ -3406,6 +4541,24 @@ dependencies = [ "serde", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "serde", + "smallvec", + "zeroize", +] + [[package]] name = "num-complex" version = "0.4.6" @@ -3463,6 +4616,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.2" @@ -3482,6 +4646,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -3494,6 +4659,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "object" version = "0.36.4" @@ -3503,6 +4689,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "ocb3" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c196e0276c471c843dd5777e7543a36a298a4be942a2a688d8111cd43390dedb" +dependencies = [ + "aead", + "cipher 0.4.4", + "ctr", + "subtle", +] + [[package]] name = "oid-registry" version = "0.7.1" @@ -3554,6 +4752,21 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-src" +version = "300.4.2+3.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.104" @@ -3562,6 +4775,7 @@ checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -3584,6 +4798,22 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ordered-multimap" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ed8acf08e98e744e5384c8bc63ceb0364e68a6854187221c18df61c4797690e" +dependencies = [ + "dlv-list", + "hashbrown 0.13.2", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + [[package]] name = "p256" version = "0.13.2" @@ -3596,6 +4826,32 @@ dependencies = [ "sha2", ] +[[package]] +name = "p384" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p521" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" +dependencies = [ + "base16ct", + "ecdsa", + "elliptic-curve", + "primeorder", + "rand_core 0.6.4", + "sha2", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -3658,7 +4914,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", - "rand_core", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", "subtle", ] @@ -3680,6 +4947,33 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "peg" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f76678828272f177ac33b7e2ac2e3e73cc6c1cd1e3e387928aa69562fa51367" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "636d60acf97633e48d266d7415a9355d4389cea327a193f87df395d88cd2b14d" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555b1514d2d99d78150d3c799d4c357a3e2c2a8062cd108e93a06d9057629c5" + [[package]] name = "pem" version = "3.0.4" @@ -3705,14 +4999,126 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pest" +version = "2.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "pest_meta" +version = "2.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + [[package]] name = "petgraph" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ - "fixedbitset", - "indexmap 2.5.0", + "fixedbitset", + "indexmap 2.5.0", +] + +[[package]] +name = "pgp" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1877a97fd422433220ad272eb008ec55691944b1200e9eb204e3cb2cb69d34e9" +dependencies = [ + "aes", + "aes-gcm", + "aes-kw", + "argon2 0.5.3", + "base64 0.22.1", + "bitfield", + "block-padding", + "blowfish", + "bstr", + "buffer-redux", + "byteorder", + "camellia", + "cast5", + "cfb-mode", + "chrono", + "cipher 0.4.4", + "const-oid", + "crc24", + "curve25519-dalek", + "derive_builder", + "derive_more 1.0.0", + "des", + "digest", + "dsa", + "eax", + "ecdsa", + "ed25519-dalek", + "elliptic-curve", + "flate2", + "generic-array", + "hex", + "hkdf", + "idea", + "iter-read", + "k256", + "log", + "md-5", + "nom", + "num-bigint-dig", + "num-traits", + "num_enum", + "ocb3", + "p256", + "p384", + "p521", + "rand", + "ripemd", + "rsa", + "sha1 0.10.6", + "sha1-checked", + "sha2", + "sha3", + "signature", + "smallvec", + "thiserror", + "twofish", + "x25519-dalek", + "x448", + "zeroize", ] [[package]] @@ -3767,6 +5173,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + [[package]] name = "pkcs8" version = "0.10.2" @@ -4065,6 +5482,16 @@ dependencies = [ "prost 0.13.3", ] +[[package]] +name = "qrcode" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d2f1455f3630c6e5107b4f2b94e74d76dea80736de0981fd27644216cff57f" +dependencies = [ + "checked_int_cast", + "image", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -4093,6 +5520,15 @@ dependencies = [ "unsigned-varint 0.8.0", ] +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + [[package]] name = "quinn" version = "0.11.5" @@ -4186,7 +5622,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4196,9 +5632,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + [[package]] name = "rand_core" version = "0.6.4" @@ -4291,8 +5733,17 @@ checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -4303,15 +5754,67 @@ checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes 1.7.2", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 1.0.4", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "resolv-conf" version = "0.7.0" @@ -4362,6 +5865,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + [[package]] name = "rkv" version = "0.19.0" @@ -4385,6 +5897,38 @@ dependencies = [ "uuid", ] +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.7", + "bitflags 2.6.0", + "serde", + "serde_derive", +] + +[[package]] +name = "rsa" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "signature", + "spki", + "subtle", + "zeroize", +] + [[package]] name = "rtnetlink" version = "0.10.1" @@ -4395,11 +5939,21 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix", + "nix 0.24.3", "thiserror", "tokio", ] +[[package]] +name = "rust-ini" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -4476,6 +6030,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.2.0", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -4497,9 +6063,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" [[package]] name = "rustls-webpki" @@ -4528,6 +6094,40 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +[[package]] +name = "rustyline" +version = "9.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "clipboard-win", + "dirs-next 2.0.0", + "fd-lock", + "libc", + "log", + "memchr", + "nix 0.23.2", + "radix_trie", + "scopeguard", + "smallvec", + "unicode-segmentation", + "unicode-width 0.1.14", + "utf8parse", + "winapi", +] + +[[package]] +name = "rustyline-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688599bdab9f42105d0ae1494335a9ffafdeb7d36325e6b10fd4abc5829d6284" +dependencies = [ + "quote", + "syn 1.0.109", +] + [[package]] name = "rw-stream-sink" version = "0.4.0" @@ -4545,6 +6145,24 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "scheduled-thread-pool" version = "0.2.7" @@ -4596,6 +6214,42 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.23" @@ -4677,9 +6331,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -4709,6 +6363,34 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1-checked" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89f599ac0c323ebb1c6082821a54962b839832b03984598375bff3975b804423" +dependencies = [ + "digest", + "sha1 0.10.6", + "zeroize", +] + [[package]] name = "sha2" version = "0.10.8" @@ -4736,7 +6418,7 @@ version = "0.22.2" dependencies = [ "anyhow", "async-trait", - "axum", + "axum 0.7.7", "bincode", "blake2", "chrono", @@ -4771,15 +6453,81 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "tonic", + "tonic 0.12.3", +] + +[[package]] +name = "sha_p2pool_integration_tests" +version = "0.22.1" +dependencies = [ + "cucumber", + "indexmap 1.9.3", + "libp2p", + "log", + "minotari_app_grpc", + "minotari_app_utilities", + "minotari_node", + "minotari_node_grpc_client", + "rand", + "serde", + "serde_json", + "sha_p2pool", + "tari_common", + "tari_common_types", + "tari_comms", + "tari_comms_dht", + "tari_core", + "tari_crypto", + "tari_p2p", + "tari_script", + "tari_shutdown", + "thiserror", + "tokio", + "tonic 0.12.3", ] +[[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 = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" +dependencies = [ + "libc", + "mio 0.8.11", + "signal-hook", +] + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -4796,7 +6544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4814,6 +6562,23 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smart-default" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "smawk" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" + [[package]] name = "snafu" version = "0.7.5" @@ -4846,7 +6611,7 @@ dependencies = [ "blake2", "chacha20poly1305", "curve25519-dalek", - "rand_core", + "rand_core 0.6.4", "ring 0.17.8", "rustc_version", "sha2", @@ -4897,6 +6662,27 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "str-buf" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" + +[[package]] +name = "strip-ansi-escapes" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8f8038e7e7969abb3f1b7c2a811225e9296da208539e0f79c5251d6cac0025" +dependencies = [ + "vte", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -5029,6 +6815,39 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "synthez" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d2c2202510a1e186e63e596d9318c91a8cbe85cd1a56a7be0c333e5f59ec8d" +dependencies = [ + "syn 2.0.77", + "synthez-codegen", + "synthez-core", +] + +[[package]] +name = "synthez-codegen" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f724aa6d44b7162f3158a57bccd871a77b39a4aef737e01bcdff41f4772c7746" +dependencies = [ + "syn 2.0.77", + "synthez-core", +] + +[[package]] +name = "synthez-core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bfa6ec52465e2425fd43ce5bbbe0f0b623964f7c63feb6b10980e816c654ea" +dependencies = [ + "proc-macro2", + "quote", + "sealed", + "syn 2.0.77", +] + [[package]] name = "sysinfo" version = "0.30.13" @@ -5051,7 +6870,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -5095,7 +6914,7 @@ dependencies = [ "itertools 0.12.1", "merlin", "once_cell", - "rand_core", + "rand_core 0.6.4", "serde", "sha3", "thiserror-no-std", @@ -5109,7 +6928,8 @@ source = "git+https://github.com/tari-project/tari.git?rev=53c1d47971994b2ac8795 dependencies = [ "anyhow", "config", - "dirs-next", + "dirs-next 1.0.2", + "git2", "log", "log4rs", "multiaddr 0.14.0", @@ -5272,7 +7092,7 @@ dependencies = [ "diesel", "diesel_migrations", "digest", - "dirs-next", + "dirs-next 1.0.2", "fs2", "futures 0.3.30", "hex", @@ -5337,7 +7157,7 @@ dependencies = [ "log", "merlin", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "serde", "sha3", "snafu", @@ -5367,7 +7187,7 @@ name = "tari_key_manager" version = "1.11.1-pre.0" source = "git+https://github.com/tari-project/tari.git?rev=53c1d47971994b2ac8795768e4b8a44800ea9988#53c1d47971994b2ac8795768e4b8a44800ea9988" dependencies = [ - "argon2", + "argon2 0.4.1", "async-trait", "blake2", "chacha20 0.7.3", @@ -5395,6 +7215,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tari_libtor" +version = "1.11.1-pre.0" +source = "git+https://github.com/tari-project/tari.git?rev=53c1d47971994b2ac8795768e4b8a44800ea9988#53c1d47971994b2ac8795768e4b8a44800ea9988" +dependencies = [ + "derivative", + "libtor", + "log", + "rand", + "tari_common", + "tari_p2p", + "tempfile", + "tor-hash-passwd", +] + [[package]] name = "tari_max_size" version = "1.11.1-pre.0" @@ -5433,9 +7268,12 @@ dependencies = [ "hickory-resolver 0.25.0-alpha.2", "lmdb-zero", "log", + "pgp", "prost 0.13.3", "rand", + "reqwest", "rustls 0.23.13", + "semver", "serde", "tari_common", "tari_comms", @@ -5549,13 +7387,43 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "textwrap" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" dependencies = [ - "unicode-width", + "unicode-width 0.1.14", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width 0.1.14", ] [[package]] @@ -5608,6 +7476,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.36" @@ -5672,15 +7550,26 @@ dependencies = [ "backtrace", "bytes 1.7.2", "libc", - "mio", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", + "tracing", "windows-sys 0.52.0", ] +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-macros" version = "2.4.0" @@ -5692,6 +7581,16 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -5764,9 +7663,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -5785,9 +7684,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap 2.5.0", "serde", @@ -5796,6 +7695,34 @@ dependencies = [ "winnow", ] +[[package]] +name = "tonic" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +dependencies = [ + "async-trait", + "axum 0.6.20", + "base64 0.21.7", + "bytes 1.7.2", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-timeout 0.4.1", + "percent-encoding", + "pin-project 1.1.5", + "prost 0.11.9", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tonic" version = "0.12.3" @@ -5804,7 +7731,7 @@ checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.7.7", "base64 0.22.1", "bytes 1.7.2", "h2 0.4.6", @@ -5812,11 +7739,12 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "hyper 1.4.1", - "hyper-timeout", + "hyper-timeout 0.5.1", "hyper-util", "percent-encoding", "pin-project 1.1.5", "prost 0.13.3", + "rustls-native-certs", "rustls-pemfile 2.1.3", "socket2", "tokio", @@ -5842,6 +7770,19 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "tor-hash-passwd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b83cd43a176c0c19d5db4401283e8f5c296b9c6c7fa29029de15cc445f26e12" +dependencies = [ + "hex", + "hex-literal 0.3.4", + "rand", + "sha1 0.6.0", + "thiserror", +] + [[package]] name = "tower" version = "0.4.13" @@ -5921,6 +7862,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "once_cell", + "regex", + "sharded-slab", + "thread_local", + "tracing", + "tracing-core", ] [[package]] @@ -5929,6 +7886,35 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "twofish" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78e83a30223c757c3947cd144a31014ff04298d8719ae10d03c31c0448c8013" +dependencies = [ + "cipher 0.4.4", +] + +[[package]] +name = "typed-builder" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe83c85a85875e8c4cb9ce4a890f05b23d38cd0d47647db7895d3d2a79566d2" +dependencies = [ + "typed-builder-macro", +] + +[[package]] +name = "typed-builder-macro" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29a3151c41d0b13e3d011f98adc24434560ef06673a155a6c7f66b9879eecce2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "typemap-ors" version = "1.0.0" @@ -5944,6 +7930,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uint" version = "0.9.5" @@ -5968,6 +7960,12 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +[[package]] +name = "unicode-linebreak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" + [[package]] name = "unicode-normalization" version = "0.1.24" @@ -5989,6 +7987,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unicode-xid" version = "0.2.6" @@ -6067,6 +8071,12 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + [[package]] name = "vcpkg" version = "0.2.15" @@ -6085,6 +8095,25 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "vte" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "231fdcd7ef3037e8330d8e17e61011a2c244126acc0a982f4040ac3f9f0bc077" +dependencies = [ + "memchr", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -6126,6 +8155,18 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.93" @@ -6218,6 +8259,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -6412,9 +8462,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" dependencies = [ "memchr", ] @@ -6445,11 +8495,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek", - "rand_core", + "rand_core 0.6.4", "serde", "zeroize", ] +[[package]] +name = "x448" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd07d4fae29e07089dbcacf7077cd52dce7760125ca9a4dd5a35ca603ffebb" +dependencies = [ + "ed448-goldilocks", + "hex", + "rand_core 0.5.1", +] + [[package]] name = "x509-parser" version = "0.16.0" @@ -6482,6 +8543,15 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "yamux" version = "0.12.1" diff --git a/cargo.toml b/cargo.toml new file mode 100644 index 00000000..22712971 --- /dev/null +++ b/cargo.toml @@ -0,0 +1,14 @@ +[workspace] + +members = [ + "p2pool", + "integration_tests", +] + +# Add here until we move to edition=2021 +resolver = "2" + +[profile.release] +# By default, Rust will wrap an integer in release mode instead of throwing the overflow error +# seen in debug mode. Panicking at this time is better than silently using the wrong value. +overflow-checks = true diff --git a/integration_tests/.husky/_/husky.sh b/integration_tests/.husky/_/husky.sh new file mode 100644 index 00000000..ca2720e0 --- /dev/null +++ b/integration_tests/.husky/_/husky.sh @@ -0,0 +1,30 @@ +#!/bin/sh +if [ -z "$husky_skip_init" ]; then + debug () { + [ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1" + } + + readonly hook_name="$(basename "$0")" + debug "starting $hook_name..." + + if [ "$HUSKY" = "0" ]; then + debug "HUSKY env variable is set to 0, skipping hook" + exit 0 + fi + + if [ -f ~/.huskyrc ]; then + debug "sourcing ~/.huskyrc" + . ~/.huskyrc + fi + + export readonly husky_skip_init=1 + sh -e "$0" "$@" + exitCode="$?" + + if [ $exitCode != 0 ]; then + echo "husky - $hook_name hook exited with code $exitCode (error)" + exit $exitCode + fi + + exit 0 +fi diff --git a/integration_tests/README.md b/integration_tests/README.md new file mode 100644 index 00000000..8d9fd777 --- /dev/null +++ b/integration_tests/README.md @@ -0,0 +1,52 @@ +# Tari integration cucumber tests + +## Procedure to run + +In its simplest form you can run the tests from the project route with `cargo test --release --test cucumber` + +- To run a specific test, add `-- --name ` to the command line + + ```shell + # Runs a specific test + cargo test --release --test cucumber -- --name "?????????" + + # You can also use the short option -n + cargo test --release --test cucumber -- -n "?????????" + ``` + +- To run tests with specific tags, e.g. `critical`, add `-- --tags @` to the command line. + + ```shell + # Runs all critical tests + cargo test --release --test cucumber -- --tags "@critical" + + # Runs all critical tests, but not @long-running and not @tbroken + cargo test --release --test cucumber -- --tags "@critical and not @long-running and not @broken" + + # You can also use the short option -t + cargo test --release --test cucumber -- -t "@critical" + ``` + +- To run a specific file or files add `-- --input glob` to the command line + + ```shell + # Runs all files matching glob + cargo test --release --test cucumber -- --input "?????????" + + # If you want to run a single file make the glob specific to the filename + cargo test --release --test cucumber -- --input "?????????" + + # You can also use the short option -i + cargo test --release --test cucumber -- -i "?????????" + ``` + +## Notes + +This suite is still a work in progress. We have scenarios marked `@broken` that are known broken and require fixing. +We also have scenarios commented out entirely. These scenarios are being reactivated and having any missing steps implemented +on a "when we have time" basis. + +## CI + +Every PR will run this suite but only on `@critical` tags. Each night the rest of the suite will run except `@long-running`. +Once a week over the weekend `@long-running` scenarios will run. \ No newline at end of file diff --git a/integration_tests/cargo.toml b/integration_tests/cargo.toml new file mode 100644 index 00000000..80d3de09 --- /dev/null +++ b/integration_tests/cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "sha_p2pool_integration_tests" +authors = ["The Tari Development Community"] +repository = "https://github.com/tari-project/sha-p2pool" +license = "BSD-3-Clause" +version = "0.22.1" +edition = "2021" + +[dependencies] +# From tari base layer project +minotari_app_grpc = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +minotari_app_utilities = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +minotari_node = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +minotari_node_grpc_client = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_common = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_comms = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_comms_dht = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_p2p = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_common_types = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_core = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_script = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +tari_shutdown = { git = "https://github.com/tari-project/tari.git", rev = "53c1d47971994b2ac8795768e4b8a44800ea9988" } +# From the tari crypto project +tari_crypto = "0.22.0" +# From tari sha-p2pool project +sha_p2pool = { path = "../p2pool" } +# Other dependencies +cucumber = { version = "0.20.0", features = ["default", "libtest", "output-junit"] } +indexmap = "1.9.1" +libp2p = { version = "0.54.1", features = [ + "dns", + "identify", + "macros", + "tokio", + "serde", + "noise", + "tcp", + "yamux", + "mdns", + "gossipsub", + "request-response", + "json", + "cbor", + "relay", + "dcutr", + "autonat", + "memory-connection-limits", + "rsa", + "ecdsa", + "ping", + "quic", +] } +log = { version = "0.4.8", features = ["std"] } +rand = "0.8" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0.128" +thiserror = "^1.0.20" +tonic = "0.12.3" +tokio = { version = "1.41.0", features = ["full"] } + +[[test]] +name = "cucumber" # this should be the same as the filename of your test target +harness = false # allows Cucumber to print output instead of libtest + diff --git a/integration_tests/log4rs/cucumber.yml b/integration_tests/log4rs/cucumber.yml new file mode 100644 index 00000000..4e008ad5 --- /dev/null +++ b/integration_tests/log4rs/cucumber.yml @@ -0,0 +1,118 @@ +# See https://docs.rs/log4rs/1.1.1/log4rs/encode/pattern/index.html for deciphering the log pattern. +refresh_rate: 30 seconds +appenders: + + stdout: + kind: rolling_file + path: "{{log_dir}}/log/stdout.log" + policy: + kind: compound + trigger: + kind: size + limit: 100mb + roller: + kind: fixed_window + base: 1 + count: 2 + pattern: "{{log_dir}}/log/stdout.{}.log" + encoder: + pattern: "{m}" + + cucumber: + kind: rolling_file + path: "{{log_dir}}/log/cucumber.log" + policy: + kind: compound + trigger: + kind: size + limit: 100mb + roller: + kind: fixed_window + base: 1 + count: 2 + pattern: "{{log_dir}}/log/cucumber.{}.log" + encoder: + pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {l:5} {m} // {f}:{L}{n}" + + base_node: + kind: rolling_file + path: "{{log_dir}}/log/base_node.log" + policy: + kind: compound + trigger: + kind: size + limit: 100mb + roller: + kind: fixed_window + base: 1 + count: 2 + pattern: "{{log_dir}}/log/base_node.{}.log" + encoder: + pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {l:5} {m} // {f}:{L}{n}" + + other: + kind: rolling_file + path: "{{log_dir}}/log/other.log" + policy: + kind: compound + trigger: + kind: size + limit: 10mb + roller: + kind: fixed_window + base: 1 + count: 2 + pattern: "{{log_dir}}/log/other.{}.log" + encoder: + pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {l:5} {m} // {f}:{L}{n}" + +# We don't want prints during cucumber test, everything useful will in logs. +# root: +# level: warn +# appenders: +# - stdout + +root: + level: debug + appenders: + - stdout + +loggers: + # stdout + stdout: + level: info # we have only single print, and it's info + appenders: + - stdout + # cucumber + cucumber: + level: debug + appenders: + - cucumber + additive: false + # base_node + comms: + level: debug + appenders: + - base_node + additive: false + p2p: + level: debug + appenders: + - base_node + additive: false + c: + level: debug + appenders: + - base_node + additive: false + # other (we do not want these unless there are errors) + globset: + level: error + appenders: + - other + additive: false + hickory_proto: + level: error + appenders: + - other + additive: false diff --git a/integration_tests/src/base_node_process.rs b/integration_tests/src/base_node_process.rs new file mode 100644 index 00000000..2a8abc84 --- /dev/null +++ b/integration_tests/src/base_node_process.rs @@ -0,0 +1,237 @@ +// Copyright 2022. The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +use std::{ + fmt::{Debug, Formatter}, + net::TcpListener, + path::PathBuf, + str::FromStr, + sync::Arc, + time::Duration, +}; + +use cucumber::codegen::anyhow; +use log::debug; +use minotari_app_utilities::identity_management::save_as_json; +use minotari_node::{run_base_node, BaseNodeConfig, GrpcMethod}; +use minotari_node_grpc_client::BaseNodeGrpcClient; +use rand::rngs::OsRng; +use tari_common::configuration::{CommonConfig, MultiaddrList}; +use tari_comms::{multiaddr::Multiaddr, peer_manager::PeerFeatures, NodeIdentity}; +use tari_comms_dht::{DbConnectionUrl, DhtConfig}; +use tari_p2p::{auto_update::AutoUpdateConfig, Network, PeerSeedsConfig, TransportType}; +use tari_shutdown::Shutdown; +use tokio::task; +use tonic::transport::Channel; + +use crate::{get_base_node_peer_addresses, get_port, wait_for_service, TariWorld}; + +pub const LOG_TARGET: &str = "cucumber::base_node_process"; + +#[derive(Clone)] +pub struct BaseNodeProcess { + pub name: String, + pub port: u16, + pub grpc_port: u16, + pub identity: NodeIdentity, + pub temp_dir_path: PathBuf, + pub is_seed_node: bool, + pub seed_nodes: Vec, + pub config: BaseNodeConfig, + pub kill_signal: Shutdown, +} + +impl Drop for BaseNodeProcess { + fn drop(&mut self) { + self.kill(); + } +} + +// NOTE: implemented to skip `cx`, because BaseNodeContext doesn't implement Debug +impl Debug for BaseNodeProcess { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("BaseNodeProcess") + .field("name", &self.name) + .field("port", &self.port) + .field("grpc_port", &self.grpc_port) + .field("identity", &self.identity) + .field("temp_dir_path", &self.temp_dir_path) + .field("is_seed_node", &self.is_seed_node) + .finish() + } +} + +pub async fn spawn_base_node(world: &mut TariWorld, is_seed_node: bool, bn_name: String, peers: Vec) { + spawn_base_node_with_config(world, is_seed_node, bn_name, peers, BaseNodeConfig::default()).await; +} + +#[allow(clippy::too_many_lines)] +async fn spawn_base_node_with_config( + world: &mut TariWorld, + is_seed_node: bool, + bn_name: String, + peers: Vec, + mut base_node_config: BaseNodeConfig, +) { + let port: u16; + let grpc_port: u16; + let temp_dir_path: PathBuf; + let base_node_identity: NodeIdentity; + + if let Some(node_ps) = world.base_nodes.get(&bn_name) { + port = node_ps.port; + grpc_port = node_ps.grpc_port; + temp_dir_path = node_ps.temp_dir_path.clone(); + base_node_config = node_ps.config.clone(); + + base_node_identity = node_ps.identity.clone(); + } else { + // each spawned base node will use different ports + port = get_port(18000..18499).unwrap(); + grpc_port = get_port(18500..18999).unwrap(); + // create a new temporary directory + temp_dir_path = world + .current_base_dir + .as_ref() + .expect("Base dir on world") + .join("base_nodes") + .join(format!("{}_grpc_port_{}", bn_name.clone(), grpc_port)); + + let base_node_address = Multiaddr::from_str(&format!("/ip4/127.0.0.1/tcp/{}", port)).unwrap(); + base_node_identity = NodeIdentity::random(&mut OsRng, base_node_address, PeerFeatures::COMMUNICATION_NODE); + save_as_json(temp_dir_path.join("base_node.json"), &base_node_identity).unwrap(); + }; + + println!("Base node identity: {}", base_node_identity); + let identity = base_node_identity.clone(); + + let shutdown = Shutdown::new(); + let process = BaseNodeProcess { + name: bn_name.clone(), + port, + grpc_port, + identity, + temp_dir_path: temp_dir_path.clone(), + is_seed_node, + seed_nodes: peers.clone(), + config: base_node_config.clone(), + kill_signal: shutdown.clone(), + }; + + let name_cloned = bn_name.clone(); + + let peer_addresses = get_base_node_peer_addresses(world, &peers).await; + + let mut common_config = CommonConfig::default(); + common_config.base_path = temp_dir_path.clone(); + task::spawn(async move { + let mut base_node_config = minotari_node::ApplicationConfig { + common: common_config, + auto_update: AutoUpdateConfig::default(), + base_node: base_node_config, + peer_seeds: PeerSeedsConfig { + peer_seeds: peer_addresses.into(), + dns_seeds_use_dnssec: false, + ..Default::default() + }, + }; + + println!("Using base_node temp_dir: {}", temp_dir_path.clone().display()); + base_node_config.base_node.network = Network::LocalNet; + base_node_config.base_node.grpc_enabled = true; + base_node_config.base_node.grpc_address = Some(format!("/ip4/127.0.0.1/tcp/{}", grpc_port).parse().unwrap()); + base_node_config.base_node.report_grpc_error = true; + base_node_config.base_node.metadata_auto_ping_interval = Duration::from_secs(15); + + base_node_config.base_node.data_dir = temp_dir_path.to_path_buf(); + base_node_config.base_node.identity_file = PathBuf::from("base_node_id.json"); + base_node_config.base_node.tor_identity_file = PathBuf::from("base_node_tor_id.json"); + base_node_config.base_node.max_randomx_vms = 1; + + base_node_config.base_node.lmdb_path = temp_dir_path.to_path_buf(); + base_node_config.base_node.p2p.transport.transport_type = TransportType::Tcp; + base_node_config.base_node.p2p.transport.tcp.listener_address = + format!("/ip4/127.0.0.1/tcp/{}", port).parse().unwrap(); + base_node_config.base_node.p2p.public_addresses = MultiaddrList::from(vec![base_node_config + .base_node + .p2p + .transport + .tcp + .listener_address + .clone()]); + base_node_config.base_node.p2p.dht = DhtConfig::default_local_test(); + base_node_config.base_node.p2p.dht.database_url = DbConnectionUrl::file(format!("{}-dht.sqlite", port)); + base_node_config.base_node.p2p.dht.network_discovery.enabled = true; + base_node_config.base_node.p2p.allow_test_addresses = true; + base_node_config.base_node.storage.orphan_storage_capacity = 10; + if base_node_config.base_node.storage.pruning_horizon != 0 { + base_node_config.base_node.storage.pruning_interval = 1; + }; + base_node_config.base_node.grpc_server_allow_methods = GrpcMethod::ALL_VARIANTS.to_vec().into(); + + // Hierarchically set the base path for all configs + base_node_config.base_node.set_base_path(temp_dir_path.clone()); + + let msg = format!( + "Initializing base node: '{}', port: '{}', grpc_port: '{}', is_seed_node: '{}'", + name_cloned, port, grpc_port, is_seed_node + ); + debug!(target: LOG_TARGET, "{}", msg); + println!("{}", msg); + + let result = run_base_node(shutdown, Arc::new(base_node_identity), Arc::new(base_node_config)).await; + if let Err(e) = result { + panic!("{:?}", e); + } + }); + + // make the new base node able to be referenced by other processes + world.base_nodes.insert(bn_name.clone(), process); + if is_seed_node { + world.seed_nodes.push(bn_name); + } + + wait_for_service(port).await; + wait_for_service(grpc_port).await; +} + +impl BaseNodeProcess { + pub async fn get_grpc_client(&self) -> anyhow::Result> { + Ok(BaseNodeGrpcClient::connect(format!("http://127.0.0.1:{}", self.grpc_port)).await?) + } + + pub fn kill(&mut self) { + self.kill_signal.trigger(); + loop { + // lets wait till the port is cleared + if TcpListener::bind(("127.0.0.1", self.port)).is_ok() { + break; + } + } + loop { + // lets wait till the port is cleared + if TcpListener::bind(("127.0.0.1", self.grpc_port)).is_ok() { + break; + } + } + } +} diff --git a/integration_tests/src/lib.rs b/integration_tests/src/lib.rs new file mode 100644 index 00000000..7b1b832d --- /dev/null +++ b/integration_tests/src/lib.rs @@ -0,0 +1,75 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +pub mod p2pool_process; +pub use p2pool_process::P2PoolProcess; +pub mod base_node_process; +pub mod miner; +pub mod world; + +use std::{net::TcpListener, ops::Range, path::PathBuf, process, time::Duration}; + +pub use base_node_process::BaseNodeProcess; +use rand::Rng; +pub use world::TariWorld; + +pub fn get_port(range: Range) -> Option { + let min = range.clone().min().expect("A minimum possible port number"); + let max = range.max().expect("A maximum possible port number"); + + loop { + let port = rand::thread_rng().gen_range(min..max); + + if TcpListener::bind(("127.0.0.1", port)).is_ok() { + return Some(port); + } + } +} + +pub fn get_base_dir() -> PathBuf { + let crate_root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + crate_root.join(format!("tests/temp/cucumber_{}", process::id())) +} + +// The idea is that if the port is taken it means the service is running. +// If the port is not taken the service hasn't come up yet +pub async fn wait_for_service(port: u16) { + use tokio::net::TcpStream; + + let max_tries = 4 * 60; + let mut attempts = 0; + + loop { + if let Ok(stream) = TcpStream::connect(("127.0.0.1", port)).await { + drop(stream); // Explicitly drop the connection + return; + } + + if attempts >= max_tries { + panic!("Service on port {} never started", port); + } + + tokio::time::sleep(Duration::from_millis(250)).await; + attempts += 1; + } +} + +pub async fn get_p2pool_node_peer_address(world: &TariWorld, peers: &[String]) -> Vec { + peers + .iter() + .map(|peer_string| { + let peer = world.p2pool_nodes.get(peer_string.as_str()).unwrap().node_id; + peer.to_string() + }) + .collect() +} + +pub async fn get_base_node_peer_addresses(world: &TariWorld, peers: &[String]) -> Vec { + peers + .iter() + .map(|peer_string| { + let peer = world.base_nodes.get(peer_string.as_str()).unwrap().identity.to_peer(); + peer.to_short_string() + }) + .collect() +} diff --git a/integration_tests/src/miner.rs b/integration_tests/src/miner.rs new file mode 100644 index 00000000..6092d322 --- /dev/null +++ b/integration_tests/src/miner.rs @@ -0,0 +1,88 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +use log::debug; +use minotari_app_grpc::tari_rpc::{ + pow_algo::PowAlgos, + Block as GrpcBlock, + GetNewBlockRequest, + PowAlgo, + SubmitBlockRequest, +}; +use tari_common::configuration::Network; +use tari_common_types::tari_address::{TariAddress, TariAddressFeatures}; +use tari_core::{ + blocks::{Block, BlockHeader}, + proof_of_work::{sha3x_difficulty, Difficulty}, +}; +use tari_crypto::{compressed_key::CompressedKey, ristretto::RistrettoPublicKey}; + +use crate::TariWorld; + +pub const LOG_TARGET: &str = "cucumber::miner"; + +pub async fn mine_and_submit_tari_blocks(world: &mut TariWorld, number_of_blocks: u64, p2pool_name: String) { + debug!(target: LOG_TARGET, "add {} blocks to p2pool node '{}'", number_of_blocks, p2pool_name); + + let mut p2pool_client = world + .get_p2pool_grpc_client(&p2pool_name) + .await + .expect("Couldn't get the p2pool node grpc client"); + + for i in 0..number_of_blocks { + let block = p2pool_client + .get_new_block(GetNewBlockRequest { + pow: Some(PowAlgo { + pow_algo: PowAlgos::Sha3x as i32, + }), + coinbase_extra: i.to_string(), + wallet_payment_address: new_random_dual_tari_address().to_hex(), + }) + .await + .unwrap(); + + let block_response = block.into_inner(); + let target_difficulty = block_response.target_difficulty; + let block_result = block_response.block.unwrap(); + let grpc_block = block_result.block.unwrap(); + let mut block = Block::try_from(grpc_block).unwrap(); + + debug!(target: LOG_TARGET, "mining block '{}' with target difficulty '{}' (?'{}')", i, Difficulty::min(), target_difficulty); + find_sha3x_header_with_achieved_difficulty(&mut block.header, Difficulty::min()); + + p2pool_client + .submit_block(SubmitBlockRequest { + block: Some(GrpcBlock::try_from(block).unwrap()), + wallet_payment_address: new_random_dual_tari_address().to_hex(), + }) + .await + .unwrap(); + } + + debug!(target: LOG_TARGET, "{} blocks added to p2pool node '{}'", number_of_blocks, p2pool_name); +} + +pub fn new_random_dual_tari_address() -> TariAddress { + let mut rng = rand::thread_rng(); + let (_, view) = CompressedKey::::random_keypair(&mut rng); + let (_, spend) = CompressedKey::::random_keypair(&mut rng); + TariAddress::new_dual_address( + view, + spend, + Network::LocalNet, + TariAddressFeatures::create_interactive_and_one_sided(), + ) +} + +pub fn find_sha3x_header_with_achieved_difficulty(header: &mut BlockHeader, achieved_difficulty: Difficulty) { + let mut num_tries = 0; + + while sha3x_difficulty(header).unwrap() != achieved_difficulty { + header.nonce += 1; + num_tries += 1; + if num_tries > 10_000_000 { + // Just in case we burn a hole in the CI server + panic!("Could not find a nonce for achieved difficulty in time"); + } + } +} diff --git a/integration_tests/src/p2pool_process.rs b/integration_tests/src/p2pool_process.rs new file mode 100644 index 00000000..2f232114 --- /dev/null +++ b/integration_tests/src/p2pool_process.rs @@ -0,0 +1,400 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +use std::{ + fs, + net::TcpListener, + path::PathBuf, + process::{Child, Command}, + time::Duration, +}; + +use cucumber::codegen::anyhow; +use libp2p::PeerId; +use log::debug; +use minotari_app_grpc::{ + authentication::ClientAuthenticationInterceptor, + tari_rpc::sha_p2_pool_client::ShaP2PoolClient, +}; +use sha_p2pool::{LibP2pInfo, ShaP2PoolConfig, StartArgs}; +use tari_common::{configuration::Network, network_check::set_network_if_choice_valid}; +use tonic::{codegen::InterceptedService, transport::Channel as TonicChannel}; + +use crate::{get_port, wait_for_service, TariWorld}; + +pub const LOG_TARGET: &str = "cucumber::p2pool_process"; +pub const LIBP2P_INFO_FILE: &str = "libp2p_info.json"; + +pub type ShaP2PoolGrpcClient = ShaP2PoolClient>; + +#[derive(Debug)] +pub struct P2PoolProcess { + pub name: String, + pub temp_dir_path: PathBuf, + pub is_seed_node: bool, + pub config: ShaP2PoolConfig, + pub node_id: PeerId, + pub squad: String, + pub running_instance: Option, + pub grpc_port: u16, + pub p2p_port: u16, +} + +impl Drop for P2PoolProcess { + fn drop(&mut self) { + self.kill(); + } +} + +pub async fn spawn_p2pool_node( + world: &mut TariWorld, + is_seed_node: bool, + seed_name: String, + squad: Option, + base_node_name: String, +) { + spawn_p2pool_node_with_config( + world, + is_seed_node, + seed_name, + squad, + ShaP2PoolConfig::default(), + base_node_name, + ) + .await; +} + +#[allow(clippy::too_many_lines)] +async fn spawn_p2pool_node_with_config( + world: &mut TariWorld, + is_seed_node: bool, + name: String, + squad: Option, + mut node_config: ShaP2PoolConfig, + base_node_name: String, +) { + std::env::set_var("TARI_NETWORK", "localnet"); + set_network_if_choice_valid(Network::LocalNet).unwrap(); + + let grpc_port: u16; + let p2p_port: u16; + let temp_dir_path: PathBuf; + + if let Some(node_ps) = world.p2pool_nodes.get(&name) { + grpc_port = node_ps.config.grpc_port; + p2p_port = node_ps.config.p2p_port; + temp_dir_path = node_ps.temp_dir_path.clone(); + node_config = node_ps.config.clone(); + } else { + // Each spawned p2pool node will use different ports + p2p_port = get_port(18000..18499).unwrap(); + node_config.p2p_port = p2p_port; + grpc_port = get_port(18500..18999).unwrap(); + node_config.grpc_port = grpc_port; + // Create a new temporary directory + temp_dir_path = world + .current_base_dir + .as_ref() + .expect("p2pool dir on world") + .join("p2pool_nodes") + .join(format!("{}_grpc_port_{}", name.clone(), grpc_port)); + match fs::exists(temp_dir_path.clone()) { + Ok(false) => { + if let Err(err) = fs::create_dir_all(&temp_dir_path) { + panic!( + "Failed to create temp_dir_path at: '{}', error: {}", + temp_dir_path.display(), + err + ); + } + if let Err(err) = fs::create_dir_all(temp_dir_path.join("configs")) { + panic!( + "Failed to create configs dir at: '{}', error: {}", + temp_dir_path.join("configs").display(), + err + ); + } + }, + Err(err) => { + panic!( + "Failed to check if temp_dir_path exists at: '{}', error: {}", + temp_dir_path.display(), + err + ); + }, + _ => {}, + } + }; + + let msg = format!( + "Initializing p2pool node: '{}', p2p_port; '{}', grpc_port: '{}', is_seed_node: '{}', base_dir: '{}'", + name, + p2p_port, + grpc_port, + is_seed_node, + temp_dir_path.display() + ); + debug!(target: LOG_TARGET, "{}", msg); + println!("{}", msg); + + let base_node_address = if let Some(base_node_process) = world.base_nodes.get(&base_node_name) { + format!("http://127.0.0.1:{}", base_node_process.grpc_port) + // format!("/ip4/127.0.0.1/tcp/{}", base_node_process.grpc_port) + } else if let Some(base_node_process) = world.base_nodes.get_index(0) { + format!("http://127.0.0.1:{}", base_node_process.1.grpc_port) + // format!("/ip4/127.0.0.1/tcp/{}", base_node_process.1.grpc_port) + } else { + let msg = format!( + "No base node found for p2pool node '{}' to connect to; at least one base node must be spawned before any \ + p2pool nodes can be spawned", + name + ); + debug!(target: LOG_TARGET, "{}", msg); + panic!("{}", msg) + }; + + // Find seed peers in world + // - /ip4/127.0.0.1/tcp/ + let seed_peers = world + .p2pool_nodes + .iter() + .filter(|(_, process)| process.is_seed_node && process.squad == squad.clone().unwrap_or_default()) + .map(|(_, value)| format!("/ip4/127.0.0.1/tcp/{}/p2p/{}", value.p2p_port, value.node_id)) + .collect::>(); + + let args = StartArgs { + base_dir: Some(temp_dir_path.clone()), + grpc_port: Some(grpc_port), + p2p_port: Some(p2p_port), + stats_server_port: None, + external_address: None, + base_node_address, + seed_peers: if seed_peers.is_empty() { None } else { Some(seed_peers) }, + no_default_seed_peers: true, + stable_peer: true, + squad_prefix: "A".to_string(), + squad_override: squad, + num_squads: 1, + private_key_folder: PathBuf::default(), + is_seed_peer: is_seed_node, + mdns_disabled: true, + relay_server_disabled: true, + relay_server_max_circuits: None, + relay_server_max_circuits_per_peer: None, + http_server_disabled: true, + user_agent: None, + peer_publish_interval: None, + debug_print_chain: true, + max_connections: None, + randomx_disabled: false, + sha3x_disabled: false, + block_time: None, + share_window: None, + export_libp2p_info: Some(temp_dir_path.join(LIBP2P_INFO_FILE).clone()), + }; + debug!(target: LOG_TARGET, "start args: {:?}", args); + + let name_cloned = name.clone(); + let temp_dir_path_clone = temp_dir_path.clone(); + let running_instance = { + let mut command = Command::new(get_p2pool_exe_path()); + command.current_dir(temp_dir_path_clone.clone()); + command.env("TARI_NETWORK", "localnet"); + command.arg("start"); + for arg in to_args_command_line(args) { + command.arg(arg); + } + match command.spawn() { + Ok(child) => child, + Err(err) => panic!("Failed to start p2pool node '{}': {}", name_cloned, err), + } + }; + + let libp2p_info = + LibP2pInfo::read_from_file(&temp_dir_path.join(LIBP2P_INFO_FILE), Duration::from_secs(30)).unwrap(); + + let process = P2PoolProcess { + name: name.clone(), + temp_dir_path: temp_dir_path.clone(), + is_seed_node, + config: node_config, + node_id: libp2p_info.peer_id, + squad: libp2p_info.squad, + running_instance: Some(running_instance), + grpc_port, + p2p_port, + }; + debug!(target: LOG_TARGET, "Initialized: {:?}", process); + + world.p2pool_nodes.insert(name, process); + if !is_seed_node { + wait_for_service(p2p_port).await; + wait_for_service(grpc_port).await; + } +} + +impl P2PoolProcess { + pub async fn get_grpc_client(&self) -> anyhow::Result> { + let dst = format!("http://127.0.0.1:{}", self.config.grpc_port); + debug!(target: LOG_TARGET, "get_grpc_client: trying to connect to '{}'", dst); + Ok(ShaP2PoolClient::connect(dst).await?) + } + + pub fn kill(&mut self) { + if let Some(child) = &mut self.running_instance { + if let Err(e) = child.kill() { + println!( + "Failed to kill p2pool node: '{}', process id: {}, '{}'", + self.name.clone(), + child.id(), + e + ); + } + } + + // Wait till the ports are cleared + let mut p2p_port_closed = false; + let mut grpc_port_closed = false; + let mut attempts = 0; + loop { + if !p2p_port_closed && TcpListener::bind(("127.0.0.1", self.config.p2p_port)).is_ok() { + p2p_port_closed = true; + } + if !grpc_port_closed && TcpListener::bind(("127.0.0.1", self.config.grpc_port)).is_ok() { + grpc_port_closed = true; + } + attempts += 1; + if attempts >= 20 { + break; + } + } + } +} + +pub fn to_args_command_line(args: StartArgs) -> Vec { + let mut args_vec = Vec::new(); + + if let Some(base_dir) = args.base_dir { + args_vec.push(format!("--base-dir={}", base_dir.display())); + } + + if let Some(grpc_port) = args.grpc_port { + args_vec.push(format!("--grpc-port={}", grpc_port)); + } + + if let Some(p2p_port) = args.p2p_port { + args_vec.push(format!("--p2p-port={}", p2p_port)); + } + + if let Some(stats_server_port) = args.stats_server_port { + args_vec.push(format!("--stats-server-port={}", stats_server_port)); + } + + if let Some(external_address) = args.external_address { + args_vec.push(format!("--external-address={}", external_address)); + } + + args_vec.push(format!("--base-node-address={}", args.base_node_address)); + + if let Some(seed_peers) = args.seed_peers { + args_vec.push(format!("--seed-peers={}", seed_peers.join(","))); + } + + if args.no_default_seed_peers { + args_vec.push("--no-default-seed-peers".to_string()); + } + + if args.stable_peer { + args_vec.push("--stable-peer".to_string()); + } + + args_vec.push(format!("--squad-prefix={}", args.squad_prefix)); + + if let Some(squad_override) = args.squad_override { + args_vec.push(format!("--squad-override={}", squad_override)); + } + + args_vec.push(format!("--num-squads={}", args.num_squads)); + + if args.private_key_folder != PathBuf::default() { + args_vec.push(format!("--private-key-folder={}", args.private_key_folder.display())); + } + + if args.is_seed_peer { + args_vec.push("--is-seed-peer".to_string()); + } + + if args.mdns_disabled { + args_vec.push("--mdns-disabled".to_string()); + } + + if args.relay_server_disabled { + args_vec.push("--relay-server-disabled".to_string()); + } + + if let Some(relay_server_max_circuits) = args.relay_server_max_circuits { + args_vec.push(format!("--relay-server-max-circuits={}", relay_server_max_circuits)); + } + + if let Some(relay_server_max_circuits_per_peer) = args.relay_server_max_circuits_per_peer { + args_vec.push(format!( + "--relay-server-max-circuits-per-peer={}", + relay_server_max_circuits_per_peer + )); + } + + if args.http_server_disabled { + args_vec.push("--http-server-disabled".to_string()); + } + + if let Some(user_agent) = args.user_agent { + args_vec.push(format!("--user-agent={}", user_agent)); + } + + if let Some(peer_publish_interval) = args.peer_publish_interval { + args_vec.push(format!("--peer-publish-interval={}", peer_publish_interval)); + } + + if args.debug_print_chain { + args_vec.push("--debug-print-chain".to_string()); + } + + if let Some(max_connections) = args.max_connections { + args_vec.push(format!("--max-connections={}", max_connections)); + } + + if args.randomx_disabled { + args_vec.push("--randomx-disabled".to_string()); + } + + if args.sha3x_disabled { + args_vec.push("--sha3x-disabled".to_string()); + } + + if let Some(block_time) = args.block_time { + args_vec.push(format!("--block-time={}", block_time)); + } + + if let Some(share_window) = args.share_window { + args_vec.push(format!("--share-window={}", share_window)); + } + + if let Some(path) = args.export_libp2p_info { + args_vec.push(format!("--export-libp2p-info={}", path.display())); + } + + args_vec +} + +pub fn get_p2pool_exe_path() -> PathBuf { + #[cfg(windows)] + { + let crate_root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + crate_root.join("../target/release/sha_p2pool.exe") + } + #[cfg(not(windows))] + { + let crate_root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); + crate_root.join("../target/release/sha_p2pool") + } +} diff --git a/integration_tests/src/world.rs b/integration_tests/src/world.rs new file mode 100644 index 00000000..d903e878 --- /dev/null +++ b/integration_tests/src/world.rs @@ -0,0 +1,133 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +use std::{ + collections::VecDeque, + fmt::{Debug, Formatter}, + path::PathBuf, +}; + +use cucumber::{ + codegen::anyhow, + gherkin::{Feature, Scenario}, +}; +use indexmap::IndexMap; +use log::error; +use minotari_app_grpc::tari_rpc::sha_p2_pool_client::ShaP2PoolClient; +use minotari_node_grpc_client::BaseNodeGrpcClient; +use tari_core::blocks::Block; +use thiserror::Error; +use tonic::transport::Channel as TonicChannel; + +use crate::{base_node_process::BaseNodeProcess, get_base_dir, P2PoolProcess}; + +pub const LOG_TARGET: &str = "cucumber::world"; + +#[derive(Error, Debug)] +pub enum TariWorldError { + #[error("P2Pool process not found: {0}")] + P2PoolProcessNotFound(String), + #[error("P2Pool client found: {0}")] + P2PoolNotFound(String), + #[error("Base node process not found: {0}")] + BaseNodeProcessNotFound(String), +} + +#[derive(cucumber::World)] +pub struct TariWorld { + pub current_scenario_name: Option, + pub current_feature_name: Option, + pub current_base_dir: Option, + pub p2pool_nodes: IndexMap, + pub base_nodes: IndexMap, + pub seed_nodes: Vec, + pub blocks: IndexMap, + pub errors: VecDeque, +} + +impl Default for TariWorld { + fn default() -> Self { + println!("\nWorld initialized - remove this line when called!\n"); + Self { + current_scenario_name: None, + current_feature_name: None, + current_base_dir: None, + p2pool_nodes: Default::default(), + base_nodes: Default::default(), + seed_nodes: vec![], + blocks: Default::default(), + errors: Default::default(), + } + } +} + +impl Debug for TariWorld { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Client") + .field("p2pool_nodes", &self.p2pool_nodes) + .field("blocks", &self.blocks) + .finish() + } +} + +impl TariWorld { + pub async fn get_p2pool_grpc_client + std::fmt::Display>( + &self, + name: &S, + ) -> anyhow::Result> { + self.get_p2pool_node(name).inspect_err(|e| { + error!(target: LOG_TARGET, "p2pool node '{}' not found: {}", name, e.to_string()) + })?.get_grpc_client().await.inspect_err(|e| { + error!(target: LOG_TARGET, "Could not connect p2pool node '{}' grpc client: {}", name, e.to_string()) + }) + } + + pub async fn get_base_node_client + std::fmt::Display>( + &self, + name: &S, + ) -> anyhow::Result> { + self.get_base_node(name).inspect_err(|e| { + error!(target: LOG_TARGET, "p2pool node '{}' not found: {}", name, e.to_string()) + })?.get_grpc_client().await.inspect_err(|e| { + error!(target: LOG_TARGET, "Could not connect p2pool node '{}' grpc client: {}", name, e.to_string()) + }) + } + + pub fn get_p2pool_node>(&self, node_name: &S) -> anyhow::Result<&P2PoolProcess> { + Ok(self + .p2pool_nodes + .get(node_name.as_ref()) + .ok_or_else(|| TariWorldError::P2PoolProcessNotFound(node_name.as_ref().to_string()))?) + } + + pub fn get_base_node>(&self, node_name: &S) -> anyhow::Result<&BaseNodeProcess> { + Ok(self + .base_nodes + .get(node_name.as_ref()) + .ok_or_else(|| TariWorldError::BaseNodeProcessNotFound(node_name.as_ref().to_string()))?) + } + + pub fn all_seed_nodes(&self) -> &[String] { + self.seed_nodes.as_slice() + } + + pub async fn before(&mut self, feature: &Feature, scenario: &Scenario) { + self.current_feature_name = Some(feature.name.clone()); + self.current_scenario_name = Some(scenario.name.clone()); + let mut base_dir = get_base_dir().join(feature.name.clone()).join(scenario.name.clone()); + base_dir = PathBuf::from(base_dir.to_string_lossy().replace(" ", "_")); + self.current_base_dir = Some(base_dir); + } + + pub async fn after(&mut self, _scenario: &Scenario) { + for (name, mut p) in self.p2pool_nodes.drain(..) { + println!("Shutting down p2pool node {}", name); + p.kill(); + } + for (name, mut p) in self.base_nodes.drain(..) { + println!("Shutting down base node {}", name); + // You have explicitly trigger the shutdown now because of the change to use Arc/Mutex in tari_shutdown + p.kill_signal.trigger(); + } + } +} diff --git a/integration_tests/tests/cucumber.rs b/integration_tests/tests/cucumber.rs new file mode 100644 index 00000000..de6522df --- /dev/null +++ b/integration_tests/tests/cucumber.rs @@ -0,0 +1,158 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause +#![feature(internal_output_capture)] + +use std::{ + fs, + io, + io::Write, + path::PathBuf, + process::Command, + str::{self}, + sync::{Arc, Mutex}, +}; + +use cucumber::{event::ScenarioFinished, writer, writer::Verbosity, World as _}; +use log::*; +use sha_p2pool_integration_tests::{p2pool_process::get_p2pool_exe_path, TariWorld}; +use tari_common::{configuration::Network, initialize_logging, network_check::set_network_if_choice_valid}; +use tokio::runtime::Runtime; +pub mod steps; + +pub const LOG_TARGET: &str = "cucumber"; +pub const LOG_TARGET_STDOUT: &str = "stdout"; + +fn flush_stdout(buffer: &Arc>>) { + // After each test we flush the stdout to the logs. + info!( + target: LOG_TARGET_STDOUT, + "{}", + str::from_utf8(&buffer.lock().unwrap()).unwrap() + ); + buffer.lock().unwrap().clear(); +} + +fn _flush_stdout(buffer: &Arc>>) { + // After each test we flush the stdout to the logs. + let mut buffer = buffer.lock().unwrap(); + io::stdout().write_all(&buffer).unwrap(); + // io::stdout().flush().unwrap(); + info!( + target: LOG_TARGET_STDOUT, + "{}", + str::from_utf8(&buffer).unwrap() + ); + buffer.clear(); +} + +fn main() { + std::env::set_var("TARI_TARGET_NETWORK", "localnet"); + std::env::set_var("TARI_NETWORK", "localnet"); + if let Err(err) = set_network_if_choice_valid(Network::LocalNet) { + let msg = format!("Error setting network: {}", err); + error!(target: LOG_TARGET, "{}", msg); + panic!("{}", msg); + } + + let p2pool_exe = get_p2pool_exe_path(); + match fs::exists(&p2pool_exe) { + Ok(exists) => { + if exists { + println!("Found sha_p2pool executable at: '{}'", p2pool_exe.display()); + } else { + println!( + "sha_p2pool executable not found at: '{}'. Building in release mode...", + p2pool_exe.display() + ); + if std::env::var("DO_NOT_REBUILD_SHA_P2POOL").map_or(true, |val| val != "0") { + let output = Command::new("cargo") + .current_dir(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("..")) + .env("TARI_TARGET_NETWORK", "localnet") + .arg("build") + .arg("--release") + .arg("--bin") + .arg("sha_p2pool") + .output() + .expect("Failed to build sha_p2pool in release mode"); + if !output.status.success() { + panic!( + "Failed to build sha_p2pool in release mode: {}", + String::from_utf8_lossy(&output.stderr) + ); + } + } else { + println!("Secondary build omitted due to DO_NOT_REBUILD_SHA_P2POOL environment variable."); + } + } + }, + Err(err) => { + panic!( + "Failed to check if sha_p2pool executable exists at: '{}', error: {}", + p2pool_exe.display(), + err + ); + }, + } + + initialize_logging( + &PathBuf::from("log4rs/cucumber.yml"), + &PathBuf::from("./"), + include_str!("../log4rs/cucumber.yml"), + ) + .expect("logging not configured"); + let stdout_buffer = Arc::new(Mutex::new(Vec::::new())); + #[cfg(test)] + std::io::set_output_capture(Some(stdout_buffer.clone())); + // Never move this line below the runtime creation!!! It will cause that any new thread created via task::spawn will + // not be affected by the output capture. + // let stdout_buffer_clone = stdout_buffer.clone(); + let runtime = Runtime::new().unwrap(); + runtime.block_on(async { + let world = TariWorld::cucumber() + .repeat_failed() + // following config needed to use eprint statements in the tests + .max_concurrent_scenarios(5) + .after(move |_feature, _rule, scenario, ev, maybe_world| { + // let stdout_buffer = stdout_buffer_clone.clone(); + Box::pin(async move { + // flush_stdout(&stdout_buffer); + match ev { + ScenarioFinished::StepFailed(_capture_locations, _location, _error) => { + error!(target: LOG_TARGET, "Scenario failed"); + }, + ScenarioFinished::StepPassed => { + info!(target: LOG_TARGET, "Scenario was successful."); + }, + ScenarioFinished::StepSkipped => { + warn!(target: LOG_TARGET, "Some steps were skipped."); + }, + ScenarioFinished::BeforeHookFailed(_info) => { + error!(target: LOG_TARGET, "Before hook failed!"); + }, + } + if let Some(maybe_world) = maybe_world { + maybe_world.after(scenario).await; + } + }) + }) + .before(move |feature, _rule, scenario, world| { + Box::pin(async move { + println!("{} : {}", scenario.keyword, scenario.name); // This will be printed into the stdout_buffer + info!(target: LOG_TARGET, "Starting {} {}", scenario.keyword, scenario.name); + + world.before(feature, scenario).await; + }) + }); + let file = fs::File::create("cucumber-output-junit.xml").unwrap(); + world + // .fail_on_skipped() + // .fail_fast() - Not yet supported in 0.18 + .with_writer(writer::Tee::new(writer::JUnit::new(file, Verbosity::ShowWorldAndDocString), + writer::Summarize::new(writer::Basic::new(io::stdout(), writer::Coloring::Auto, Verbosity::ShowWorldAndDocString)))) + .run("tests/features/") + .await; + }); + + // If by any chance we have anything in the stdout buffer just log it. + flush_stdout(&stdout_buffer); +} diff --git a/integration_tests/tests/features/Sync.feature b/integration_tests/tests/features/Sync.feature new file mode 100644 index 00000000..00950f03 --- /dev/null +++ b/integration_tests/tests/features/Sync.feature @@ -0,0 +1,15 @@ +# Copyright 2024 The Tari Project +# SPDX-License-Identifier: BSD-3-Clause + +@sync +Feature: Sync p2pool nodes + + Scenario: New node should sync to tip of the network when starting up + Given I have a base node BASE_NODE_A + And I have a p2pool seed node SEED in squad DEFAULT connected to base node BASE_NODE_A + And I have a p2pool node NODE_A in squad DEFAULT connected to base node BASE_NODE_A + And I have a p2pool node NODE_B in squad DEFAULT connected to base node BASE_NODE_A + And I add 10 blocks to p2pool node NODE_A + And I have a p2pool node NODE_C in squad DEFAULT connected to base node BASE_NODE_A + When I wait 120 seconds + diff --git a/integration_tests/tests/steps/base_node_steps.rs b/integration_tests/tests/steps/base_node_steps.rs new file mode 100644 index 00000000..c7278b88 --- /dev/null +++ b/integration_tests/tests/steps/base_node_steps.rs @@ -0,0 +1,29 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +use cucumber::{given, when}; +use log::*; +use sha_p2pool_integration_tests::{base_node_process::spawn_base_node, TariWorld}; + +pub const LOG_TARGET: &str = "cucumber::base_node_steps"; + +#[given(expr = "I have a base node seed {word}")] +#[when(expr = "I have a base node seed {word}")] +async fn start_seed_base_node(world: &mut TariWorld, name: String) { + spawn_base_node(world, true, name.clone(), vec![]).await; + debug!(target: LOG_TARGET, "start_seed_base_node: spawned '{}'", name); +} + +#[given(expr = "I have a base node {word}")] +#[when(expr = "I have a base node {word}")] +async fn start_base_node(world: &mut TariWorld, name: String) { + spawn_base_node(world, false, name.clone(), vec![]).await; + debug!(target: LOG_TARGET, "start_seed_base_node: spawned '{}'", name); +} + +#[given(expr = "I have a base node {word} connected to all seed nodes")] +#[when(expr = "I have a base node {word} connected to all seed nodes")] +async fn start_base_node_connected_to_all_seed_nodes(world: &mut TariWorld, name: String) { + spawn_base_node(world, false, name.clone(), world.all_seed_nodes().to_vec()).await; + debug!(target: LOG_TARGET, "start_base_node_connected_to_all_seed_nodes: spawned '{}'", name); +} diff --git a/integration_tests/tests/steps/mod.rs b/integration_tests/tests/steps/mod.rs new file mode 100644 index 00000000..c299b157 --- /dev/null +++ b/integration_tests/tests/steps/mod.rs @@ -0,0 +1,33 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +use std::time::Duration; + +use cucumber::{then, when}; +use sha_p2pool_integration_tests::TariWorld; + +pub mod base_node_steps; +pub mod p2pool_steps; + +pub const CONFIRMATION_PERIOD: u64 = 4; +pub const TWO_MINUTES_WITH_HALF_SECOND_SLEEP: u64 = 240; +pub const HALF_SECOND: u64 = 500; + +#[when(expr = "I wait {int} seconds")] +async fn wait_seconds(_world: &mut TariWorld, seconds: u64) { + tokio::time::sleep(Duration::from_secs(seconds)).await; +} + +#[then(regex = r"I receive an error containing '(.*)'")] +async fn receive_an_error(world: &mut TariWorld, error: String) { + match world.errors.back() { + Some(err) => assert_eq!(err, &error), + None => panic!("Should have received an error"), + }; + + // No-op. + // Was not implemented in previous suite, gave it a quick try but missing other peices + + // assert!(world.errors.len() > 1); + // assert!(world.errors.pop_front().unwrap().contains(&error)) +} diff --git a/integration_tests/tests/steps/p2pool_steps.rs b/integration_tests/tests/steps/p2pool_steps.rs new file mode 100644 index 00000000..0f838e1f --- /dev/null +++ b/integration_tests/tests/steps/p2pool_steps.rs @@ -0,0 +1,25 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +use cucumber::{given, when}; +use sha_p2pool_integration_tests::{miner::mine_and_submit_tari_blocks, p2pool_process::spawn_p2pool_node, TariWorld}; + +pub const LOG_TARGET: &str = "cucumber::p2pool_steps"; + +#[given(expr = "I have a p2pool seed node {word} in squad {word} connected to base node {word}")] +#[when(expr = "I have a p2pool seed node {word} in squad {word} connected to base node {word}")] +async fn start_p2pool_seed_node(world: &mut TariWorld, p2pool_name: String, squad: String, base_node_name: String) { + spawn_p2pool_node(world, true, p2pool_name, Some(squad), base_node_name).await; +} + +#[given(expr = "I have a p2pool node {word} in squad {word} connected to base node {word}")] +#[when(expr = "I have a p2pool node {word} in squad {word} connected to base node {word}")] +async fn start_p2pool_node(world: &mut TariWorld, p2pool_name: String, squad: String, base_node_name: String) { + spawn_p2pool_node(world, false, p2pool_name, Some(squad), base_node_name).await; +} + +#[given(expr = "I add {int} blocks to p2pool node {word}")] +#[when(expr = "I add {int} blocks to p2pool node {word}")] +async fn add_blocks_to_p2pool_node(world: &mut TariWorld, number_of_blocks: u64, p2pool_name: String) { + mine_and_submit_tari_blocks(world, number_of_blocks, p2pool_name).await +} diff --git a/log4rs_sample.yml b/log4rs_sample.yml index b8a99d08..4ce538de 100644 --- a/log4rs_sample.yml +++ b/log4rs_sample.yml @@ -187,18 +187,19 @@ loggers: appenders: - new_tip_notify additive: false - # tari::p2pool::server::p2p: - # level: info - # appenders: - # - p2p - # - stdout - # additive: false + tari::p2pool::server::p2p: + level: debug + appenders: + - p2p + - stdout + additive: false + # For debugging only - # tari::p2pool::message_logging: - # level: debug - # appenders: - # - message_logging - # additive: false + tari::p2pool::message_logging: + level: debug + appenders: + - message_logging + additive: false # For Profiling # tari::profiling: diff --git a/Cargo.toml b/p2pool/Cargo.toml similarity index 90% rename from Cargo.toml rename to p2pool/Cargo.toml index e0c7c9f1..885c63a6 100644 --- a/Cargo.toml +++ b/p2pool/Cargo.toml @@ -1,7 +1,10 @@ [package] -edition = "2021" name = "sha_p2pool" +authors = ["The Tari Development Community"] +repository = "https://github.com/tari-project/sha-p2pool" +license = "BSD-3-Clause" version = "0.22.2" +edition = "2021" [dependencies] anyhow = "1.0" @@ -67,3 +70,11 @@ bincode = "1.3.3" [package.metadata.cargo-machete] ignored = ["log4rs"] + +[lib] +name = "sha_p2pool" +path = "src/lib.rs" + +[[bin]] +name = "sha_p2pool" +path = "src/main.rs" \ No newline at end of file diff --git a/src/cli/args.rs b/p2pool/src/cli/args.rs similarity index 86% rename from src/cli/args.rs rename to p2pool/src/cli/args.rs index 4a841e0b..cf0c2c32 100644 --- a/src/cli/args.rs +++ b/p2pool/src/cli/args.rs @@ -13,10 +13,10 @@ use crate::cli::{ #[allow(clippy::struct_excessive_bools)] #[derive(Clone, Parser, Debug)] -pub(crate) struct StartArgs { +pub struct StartArgs { /// (Optional) base dir. #[arg(short, long, value_name = "base-dir")] - base_dir: Option, + pub base_dir: Option, /// (Optional) gRPC port to use. #[arg(short, long, value_name = "grpc-port")] @@ -137,6 +137,10 @@ pub(crate) struct StartArgs { #[arg(long, value_name = "sw")] pub share_window: Option, + + /// Export libp2p info to a file - useful for testing where file handshake is required, e.g. cucumber. + #[arg(long)] + pub export_libp2p_info: Option, } #[derive(Clone, Parser, Debug)] @@ -170,7 +174,7 @@ pub enum Commands { }, } -#[derive(Clone, Parser)] +#[derive(Clone, Debug, Parser)] #[command(version)] #[command(styles = cli_styles())] #[command(about = "⛏ Decentralized mining pool for Tari network ⛏", long_about = None)] @@ -203,18 +207,25 @@ impl Cli { pub async fn handle_command(&self, cli_shutdown: ShutdownSignal) -> anyhow::Result<()> { let cli_ref = Arc::new(self.clone()); - match &self.command { - Commands::Start { args } => { - commands::handle_start(cli_ref.clone(), args, cli_shutdown.clone()).await?; - }, - Commands::GenerateIdentity => { - commands::handle_generate_identity().await?; - }, - Commands::ListSquads { args, list_squad_args } => { - commands::handle_list_squads(cli_ref.clone(), args, list_squad_args, cli_shutdown.clone()).await?; - }, - } + run_with_cli(&self.command, cli_ref, cli_shutdown).await?; Ok(()) } } + +/// Run with provided CLI command. +pub async fn run_with_cli(command: &Commands, cli_ref: Arc, cli_shutdown: ShutdownSignal) -> anyhow::Result<()> { + match command { + Commands::Start { args } => { + commands::handle_start(cli_ref.clone(), args, cli_shutdown.clone()).await?; + }, + Commands::GenerateIdentity => { + commands::handle_generate_identity().await?; + }, + Commands::ListSquads { args, list_squad_args } => { + commands::handle_list_squads(cli_ref.clone(), args, list_squad_args, cli_shutdown.clone()).await?; + }, + } + + Ok(()) +} diff --git a/src/cli/commands/generate_identity.rs b/p2pool/src/cli/commands/generate_identity.rs similarity index 100% rename from src/cli/commands/generate_identity.rs rename to p2pool/src/cli/commands/generate_identity.rs diff --git a/src/cli/commands/list_squads.rs b/p2pool/src/cli/commands/list_squads.rs similarity index 100% rename from src/cli/commands/list_squads.rs rename to p2pool/src/cli/commands/list_squads.rs diff --git a/src/cli/commands/mod.rs b/p2pool/src/cli/commands/mod.rs similarity index 81% rename from src/cli/commands/mod.rs rename to p2pool/src/cli/commands/mod.rs index 7da8e693..a7bcc92a 100644 --- a/src/cli/commands/mod.rs +++ b/p2pool/src/cli/commands/mod.rs @@ -8,4 +8,6 @@ pub use start::*; mod generate_identity; mod list_squads; mod start; +pub use handle_start; mod util; +pub use util::LibP2pInfo; diff --git a/src/cli/commands/start.rs b/p2pool/src/cli/commands/start.rs similarity index 100% rename from src/cli/commands/start.rs rename to p2pool/src/cli/commands/start.rs diff --git a/src/cli/commands/util.rs b/p2pool/src/cli/commands/util.rs similarity index 75% rename from src/cli/commands/util.rs rename to p2pool/src/cli/commands/util.rs index d849e3fa..f3aa23ea 100644 --- a/src/cli/commands/util.rs +++ b/p2pool/src/cli/commands/util.rs @@ -1,10 +1,23 @@ // Copyright 2024 The Tari Project // SPDX-License-Identifier: BSD-3-Clause -use std::{collections::HashMap, env, fs, sync::Arc}; +use std::{ + cmp::min, + collections::HashMap, + env, + fs, + fs::File, + io, + io::{BufReader, BufWriter}, + path::Path, + sync::Arc, + thread::sleep, + time::{Duration, Instant}, +}; -use libp2p::identity::Keypair; -use log::info; +use libp2p::{identity::Keypair, PeerId}; +use log::{info, warn}; +use serde::{Deserialize, Serialize}; use tari_common::{configuration::Network, initialize_logging}; use tari_core::{ consensus::ConsensusManager, @@ -39,12 +52,13 @@ pub async fn server( if let Err(e) = initialize_logging( &cli.base_dir().join("configs/logs.yml"), &cli.base_dir(), - include_str!("../../../log4rs_sample.yml"), + include_str!("../../../../log4rs_sample.yml"), ) { eprintln!("{}", e); return Err(e.into()); } } + info!(target: LOG_TARGET, "{:?}", &cli); let mut config_builder = main_server::Config::builder(); if let Some(grpc_port) = args.grpc_port { @@ -129,8 +143,11 @@ pub async fn server( let consensus_manager = ConsensusManager::builder(Network::get_current_or_user_setting_or_default()).build()?; let genesis_block_hash = *consensus_manager.get_genesis_block().hash(); - info!(target: "p2pool::server", "Consensus manager initialized with network: {}, and genesis hash {}", Network::get_current_or_user_setting_or_default(), -genesis_block_hash.to_hex()); + info!( + target: "p2pool::server", "Consensus manager initialized with network: {}, and genesis hash {}", + Network::get_current_or_user_setting_or_default(), + genesis_block_hash.to_hex() + ); let block_validation_params = Arc::new(BlockValidationParams::new( randomx_factory, consensus_manager.clone(), @@ -145,10 +162,19 @@ genesis_block_hash.to_hex()); let swarm = crate::server::p2p::setup::new_swarm(&config).await?; let squad = config.p2p_service.squad_override.clone().unwrap_or_else(|| { let squad_id = - (*swarm.local_peer_id().to_bytes().last().unwrap_or(&0) as usize) % config.p2p_service.num_squads; + (*swarm.local_peer_id().to_bytes().last().unwrap_or(&0) as usize) % min(1, config.p2p_service.num_squads); format!("{}_{}", config.p2p_service.squad_prefix.clone(), squad_id) }); info!(target: LOG_TARGET, "Swarm created. Our id: {}, our squad:{}", swarm.local_peer_id(), squad); + if let Some(path) = args.export_libp2p_info.clone() { + let libp2p_info = LibP2pInfo { + peer_id: *swarm.local_peer_id(), + squad: squad.clone(), + }; + if let Err(err) = libp2p_info.save_to_file(&path) { + warn!(target: LOG_TARGET, "Failed to save libp2p info to file: '{}'", err); + } + } let share_chain_sha3x = InMemoryShareChain::new( config.clone(), PowAlgorithm::Sha3x, @@ -178,3 +204,40 @@ genesis_block_hash.to_hex()); ) .await } + +#[derive(Serialize, Deserialize)] +pub struct LibP2pInfo { + pub peer_id: PeerId, + pub squad: String, +} + +impl LibP2pInfo { + pub fn save_to_file(&self, path: &Path) -> io::Result<()> { + if let Some(parent) = path.parent() { + if let Ok(false) = fs::exists(parent) { + fs::create_dir_all(parent)?; + } + } + let file = File::create(path)?; + let writer = BufWriter::new(file); + serde_json::to_writer(writer, &self)?; + Ok(()) + } + + pub fn read_from_file(path: &Path, timeout: Duration) -> io::Result { + let start = Instant::now(); + while !path.exists() { + if start.elapsed() >= timeout { + return Err(io::Error::new( + io::ErrorKind::TimedOut, + format!("Timeout waiting for '{}' to be created", path.display()), + )); + } + sleep(Duration::from_millis(100)); + } + let file = File::open(path)?; + let reader = BufReader::new(file); + let libp2p_info = serde_json::from_reader(reader)?; + Ok(libp2p_info) + } +} diff --git a/p2pool/src/cli/mod.rs b/p2pool/src/cli/mod.rs new file mode 100644 index 00000000..d2b8afae --- /dev/null +++ b/p2pool/src/cli/mod.rs @@ -0,0 +1,9 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +mod args; +pub use args::{run_with_cli, Cli, Commands, StartArgs}; +mod commands; +pub use commands::handle_start; +mod util; +pub use crate::cli::commands::LibP2pInfo; diff --git a/src/cli/util.rs b/p2pool/src/cli/util.rs similarity index 100% rename from src/cli/util.rs rename to p2pool/src/cli/util.rs diff --git a/p2pool/src/lib.rs b/p2pool/src/lib.rs new file mode 100644 index 00000000..f4495b18 --- /dev/null +++ b/p2pool/src/lib.rs @@ -0,0 +1,14 @@ +// Copyright 2024 The Tari Project +// SPDX-License-Identifier: BSD-3-Clause + +mod cli; +pub use cli::{handle_start, run_with_cli, Cli, Commands, LibP2pInfo, StartArgs}; +mod server; +pub use server::{ + p2p::util::{generate_identity, GenerateIdentityResult}, + Config as ShaP2PoolConfig, +}; +mod sharechain; +pub use sharechain::{lmdb_block_storage::LmdbBlockStorage, p2block::P2BlockBuilder, p2chain::P2Chain}; + +pub const PROFILING_LOG_TARGET: &str = "tari::profiling"; diff --git a/src/main.rs b/p2pool/src/main.rs similarity index 94% rename from src/main.rs rename to p2pool/src/main.rs index 07eabca1..df3791f9 100644 --- a/src/main.rs +++ b/p2pool/src/main.rs @@ -10,16 +10,9 @@ use std::{ use clap::Parser; use log::error; +use sha_p2pool::Cli; use tari_shutdown::Shutdown; -use crate::cli::Cli; - -mod cli; -mod server; -mod sharechain; - -pub const PROFILING_LOG_TARGET: &str = "tari::profiling"; - fn format_system_time(time: SystemTime) -> String { let datetime = time.duration_since(UNIX_EPOCH).unwrap(); let seconds = datetime.as_secs(); diff --git a/src/server/config.rs b/p2pool/src/server/config.rs similarity index 99% rename from src/server/config.rs rename to p2pool/src/server/config.rs index 7d7ccbc5..37186d6c 100644 --- a/src/server/config.rs +++ b/p2pool/src/server/config.rs @@ -8,7 +8,7 @@ use libp2p::identity::Keypair; use crate::server::{http, p2p}; /// Config is the server configuration struct. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Config { pub base_node_address: String, pub p2p_port: u16, diff --git a/src/server/grpc/base_node.rs b/p2pool/src/server/grpc/base_node.rs similarity index 100% rename from src/server/grpc/base_node.rs rename to p2pool/src/server/grpc/base_node.rs diff --git a/src/server/grpc/error.rs b/p2pool/src/server/grpc/error.rs similarity index 100% rename from src/server/grpc/error.rs rename to p2pool/src/server/grpc/error.rs diff --git a/src/server/grpc/mod.rs b/p2pool/src/server/grpc/mod.rs similarity index 100% rename from src/server/grpc/mod.rs rename to p2pool/src/server/grpc/mod.rs diff --git a/src/server/grpc/p2pool.rs b/p2pool/src/server/grpc/p2pool.rs similarity index 100% rename from src/server/grpc/p2pool.rs rename to p2pool/src/server/grpc/p2pool.rs diff --git a/src/server/grpc/util.rs b/p2pool/src/server/grpc/util.rs similarity index 100% rename from src/server/grpc/util.rs rename to p2pool/src/server/grpc/util.rs diff --git a/src/server/http/health.rs b/p2pool/src/server/http/health.rs similarity index 100% rename from src/server/http/health.rs rename to p2pool/src/server/http/health.rs diff --git a/src/server/http/mod.rs b/p2pool/src/server/http/mod.rs similarity index 100% rename from src/server/http/mod.rs rename to p2pool/src/server/http/mod.rs diff --git a/src/server/http/server.rs b/p2pool/src/server/http/server.rs similarity index 100% rename from src/server/http/server.rs rename to p2pool/src/server/http/server.rs diff --git a/src/server/http/stats/handlers.rs b/p2pool/src/server/http/stats/handlers.rs similarity index 100% rename from src/server/http/stats/handlers.rs rename to p2pool/src/server/http/stats/handlers.rs diff --git a/src/server/http/stats/mod.rs b/p2pool/src/server/http/stats/mod.rs similarity index 100% rename from src/server/http/stats/mod.rs rename to p2pool/src/server/http/stats/mod.rs diff --git a/src/server/http/stats/models.rs b/p2pool/src/server/http/stats/models.rs similarity index 100% rename from src/server/http/stats/models.rs rename to p2pool/src/server/http/stats/models.rs diff --git a/src/server/http/stats_collector.rs b/p2pool/src/server/http/stats_collector.rs similarity index 100% rename from src/server/http/stats_collector.rs rename to p2pool/src/server/http/stats_collector.rs diff --git a/src/server/http/version.rs b/p2pool/src/server/http/version.rs similarity index 100% rename from src/server/http/version.rs rename to p2pool/src/server/http/version.rs diff --git a/src/server/mod.rs b/p2pool/src/server/mod.rs similarity index 100% rename from src/server/mod.rs rename to p2pool/src/server/mod.rs diff --git a/src/server/p2p/client.rs b/p2pool/src/server/p2p/client.rs similarity index 100% rename from src/server/p2p/client.rs rename to p2pool/src/server/p2p/client.rs diff --git a/src/server/p2p/messages.rs b/p2pool/src/server/p2p/messages.rs similarity index 100% rename from src/server/p2p/messages.rs rename to p2pool/src/server/p2p/messages.rs diff --git a/src/server/p2p/mod.rs b/p2pool/src/server/p2p/mod.rs similarity index 100% rename from src/server/p2p/mod.rs rename to p2pool/src/server/p2p/mod.rs diff --git a/src/server/p2p/network.rs b/p2pool/src/server/p2p/network.rs similarity index 99% rename from src/server/p2p/network.rs rename to p2pool/src/server/p2p/network.rs index a986062b..b19ec2df 100644 --- a/src/server/p2p/network.rs +++ b/p2pool/src/server/p2p/network.rs @@ -110,7 +110,7 @@ const NUM_PEERS_TO_PEER_INFO_EXCHANGE: usize = 8; #[derive(Clone, Debug)] #[allow(clippy::struct_excessive_bools)] -pub(crate) struct Config { +pub struct Config { pub external_addr: Option, pub seed_peers: Vec, pub peer_info_publish_interval: Duration, @@ -144,7 +144,7 @@ impl Default for Config { seed_peers: vec![], peer_info_publish_interval: Duration::from_secs(60 * 15), stable_peer: true, - private_key_folder: PathBuf::from("."), + private_key_folder: PathBuf::from("../../../.."), private_key: None, mdns_enabled: false, relay_server_disabled: false, @@ -988,7 +988,7 @@ where S: ShareChain } // Once we have peer info from the seed peers, disconnect from them. if self.network_peer_store.read().await.is_seed_peer(&peer_id) { - warn!(target: LOG_TARGET, "Disconnecting from seed peer {}", peer_id); + info!(target: LOG_TARGET, "Disconnecting from seed peer {}", peer_id); let _ = self.swarm.disconnect_peer_id(peer_id); return; } @@ -1079,12 +1079,12 @@ where S: ShareChain if num_peers_added > 0 { self.initiate_direct_peer_exchange(&peer_id).await; } else { - debug!(target: PEER_INFO_LOGGING_LOG_TARGET, "No peers added from peer"); + debug!(target: PEER_INFO_LOGGING_LOG_TARGET, "No peers added from peer {}", peer_id); } // Once we have peer info from the seed peers, disconnect from them. if self.network_peer_store.read().await.is_seed_peer(&peer_id) { - warn!(target: LOG_TARGET, "Disconnecting from seed peer {}", peer_id); + info!(target: LOG_TARGET, "Disconnecting from seed peer {}", peer_id); let _ = self.swarm.disconnect_peer_id(peer_id); } }, diff --git a/src/server/p2p/peer_store.rs b/p2pool/src/server/p2p/peer_store.rs similarity index 100% rename from src/server/p2p/peer_store.rs rename to p2pool/src/server/p2p/peer_store.rs diff --git a/src/server/p2p/relay_store.rs b/p2pool/src/server/p2p/relay_store.rs similarity index 100% rename from src/server/p2p/relay_store.rs rename to p2pool/src/server/p2p/relay_store.rs diff --git a/src/server/p2p/setup.rs b/p2pool/src/server/p2p/setup.rs similarity index 100% rename from src/server/p2p/setup.rs rename to p2pool/src/server/p2p/setup.rs diff --git a/src/server/p2p/util.rs b/p2pool/src/server/p2p/util.rs similarity index 100% rename from src/server/p2p/util.rs rename to p2pool/src/server/p2p/util.rs diff --git a/src/server/server.rs b/p2pool/src/server/server.rs similarity index 100% rename from src/server/server.rs rename to p2pool/src/server/server.rs diff --git a/src/sharechain/error.rs b/p2pool/src/sharechain/error.rs similarity index 100% rename from src/sharechain/error.rs rename to p2pool/src/sharechain/error.rs diff --git a/src/sharechain/in_memory.rs b/p2pool/src/sharechain/in_memory.rs similarity index 100% rename from src/sharechain/in_memory.rs rename to p2pool/src/sharechain/in_memory.rs diff --git a/src/sharechain/lmdb_block_storage.rs b/p2pool/src/sharechain/lmdb_block_storage.rs similarity index 99% rename from src/sharechain/lmdb_block_storage.rs rename to p2pool/src/sharechain/lmdb_block_storage.rs index c0ff6769..048c06bb 100644 --- a/src/sharechain/lmdb_block_storage.rs +++ b/p2pool/src/sharechain/lmdb_block_storage.rs @@ -43,12 +43,11 @@ use tari_utilities::ByteArray; use super::P2Block; const LOG_TARGET: &str = "tari::p2pool::sharechain::lmdb_block_storage"; -pub(crate) struct LmdbBlockStorage { +pub struct LmdbBlockStorage { file_handle: Arc>>, } impl LmdbBlockStorage { - #[cfg(test)] pub fn new_from_temp_dir() -> Self { use rand::{distributions::Alphanumeric, Rng}; use tempfile::Builder; diff --git a/src/sharechain/mod.rs b/p2pool/src/sharechain/mod.rs similarity index 100% rename from src/sharechain/mod.rs rename to p2pool/src/sharechain/mod.rs diff --git a/src/sharechain/p2block.rs b/p2pool/src/sharechain/p2block.rs similarity index 99% rename from src/sharechain/p2block.rs rename to p2pool/src/sharechain/p2block.rs index 76782c42..3060e32e 100644 --- a/src/sharechain/p2block.rs +++ b/p2pool/src/sharechain/p2block.rs @@ -37,7 +37,7 @@ lazy_static! { } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] -pub(crate) struct P2Block { +pub struct P2Block { #[serde(default)] pub version: u64, pub squad: String, @@ -177,7 +177,6 @@ impl P2BlockBuilder { } } - #[cfg(test)] pub fn new_from_block(block_arg: Option<&P2Block>) -> Self { let mut block = P2Block::default(); if let Some(b) = block_arg { @@ -218,7 +217,6 @@ impl P2BlockBuilder { Ok(self) } - #[cfg(test)] pub fn with_tari_block(mut self, block: Block) -> Result { self.block.populate_tari_data(block)?; Ok(self) diff --git a/src/sharechain/p2chain.rs b/p2pool/src/sharechain/p2chain.rs similarity index 100% rename from src/sharechain/p2chain.rs rename to p2pool/src/sharechain/p2chain.rs diff --git a/src/sharechain/p2chain_level.rs b/p2pool/src/sharechain/p2chain_level.rs similarity index 99% rename from src/sharechain/p2chain_level.rs rename to p2pool/src/sharechain/p2chain_level.rs index 71cca697..ca14a3bf 100644 --- a/src/sharechain/p2chain_level.rs +++ b/p2pool/src/sharechain/p2chain_level.rs @@ -34,7 +34,7 @@ use super::lmdb_block_storage::BlockCache; use crate::sharechain::{error::ShareChainError, p2block::P2Block}; #[derive(Clone)] -pub(crate) struct P2BlockHeader { +pub struct P2BlockHeader { pub height: u64, pub hash: FixedHash, pub prev_hash: FixedHash, diff --git a/src/cli/mod.rs b/src/cli/mod.rs deleted file mode 100644 index 52879fc0..00000000 --- a/src/cli/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2024 The Tari Project -// SPDX-License-Identifier: BSD-3-Clause - -pub use args::Cli; - -mod args; -mod commands; -mod util;