diff --git a/Cargo.lock b/Cargo.lock index cf8fb89453f..81294b3686b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -468,6 +468,7 @@ checksum = "a61ff12b19d89c752c213316b87fdb4a587f073d219b893cc56974b8c9f39bf7" dependencies = [ "digest", "either", + "futures", "hex", "libc", "memmap2", @@ -481,6 +482,8 @@ dependencies = [ "ssri", "tempfile", "thiserror", + "tokio", + "tokio-stream", "walkdir", ] @@ -5894,14 +5897,15 @@ dependencies = [ [[package]] name = "tentacle" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6218c3269605008b5e88f4e91fa2e98e20491213c464dc6da8370858db89d92b" +checksum = "19a42caa9f5a8bf3f40b75b4e8e4bf1dcacf92998463afce9cfe5e5e4824de9a" dependencies = [ "async-trait", "bytes", "futures", "futures-timer", + "httparse", "igd-next", "js-sys", "libc", @@ -5938,9 +5942,9 @@ dependencies = [ [[package]] name = "tentacle-secio" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99df015b8649588f2958d4853eee221860f95d2721995857e9dde1462ceb3dc4" +checksum = "53d53673d63399e1d557c2e884b045d242811079d3b2f17a569310e5c3f1db33" dependencies = [ "bs58", "bytes", @@ -6234,9 +6238,9 @@ dependencies = [ [[package]] name = "tokio-yamux" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208cecd45a38868bfc0a45aac52cb1aea4583c6b801bf57f351e9d531b23cb86" +checksum = "966579a01e6900c22634f5915fda56358496e71067f3dd26572f9fbe85f4b62e" dependencies = [ "bytes", "futures", diff --git a/notify/Cargo.toml b/notify/Cargo.toml index 49a3ff5d81b..013ea4c282f 100644 --- a/notify/Cargo.toml +++ b/notify/Cargo.toml @@ -10,10 +10,15 @@ repository = "https://github.com/nervosnetwork/ckb" [dependencies] ckb-logger = { path = "../util/logger", version = "= 0.120.0-pre" } -ckb-app-config = { path = "../util/app-config", version = "= 0.120.0-pre" } +ckb-app-config = { path = "../util/app-config", version = "= 0.120.0-pre" } ckb-types = { path = "../util/types", version = "= 0.120.0-pre" } ckb-stop-handler = { path = "../util/stop-handler", version = "= 0.120.0-pre" } ckb-async-runtime = { path = "../util/runtime", version = "= 0.120.0-pre" } + +[target.'cfg(target_family = "wasm")'.dependencies] tokio = { version = "1", features = ["sync"] } +[target.'cfg(not(target_family = "wasm"))'.dependencies] +tokio = { version = "1", features = ["sync", "process"] } + [dev-dependencies] diff --git a/resource/ckb.toml b/resource/ckb.toml index 68cf8e2fd84..3df8e09dde7 100644 --- a/resource/ckb.toml +++ b/resource/ckb.toml @@ -63,8 +63,8 @@ cache_size = 268435456 options_file = "default.db-options" [network] -listen_addresses = ["/ip4/0.0.0.0/tcp/8115"] # {{ -# _ => listen_addresses = ["/ip4/0.0.0.0/tcp/{p2p_port}"] +listen_addresses = ["/ip4/0.0.0.0/tcp/8115", "/ip4/0.0.0.0/tcp/8115/ws"] # {{ +# _ => listen_addresses = ["/ip4/0.0.0.0/tcp/{p2p_port}", "/ip4/0.0.0.0/tcp/{p2p_port}/ws"] # }} ### Specify the public and routable network addresses # public_addresses = [] diff --git a/spec/Cargo.toml b/spec/Cargo.toml index f7694c62a59..9ad6c386dec 100644 --- a/spec/Cargo.toml +++ b/spec/Cargo.toml @@ -25,7 +25,10 @@ ckb-traits = { path = "../traits", version = "= 0.120.0-pre" } ckb-logger = { path = "../util/logger", version = "= 0.120.0-pre" } [target.'cfg(not(target_family = "wasm"))'.dependencies] -cacache = { version = "13.0.0", default-features = false, features = ["mmap"] } +cacache = { version = "13.0.0", default-features = false, features = [ + "tokio-runtime", + "mmap", +] } [dev-dependencies] tempfile.workspace = true diff --git a/util/app-config/src/tests/app_config.rs b/util/app-config/src/tests/app_config.rs index 52fcd4b1633..68d1de7218c 100644 --- a/util/app-config/src/tests/app_config.rs +++ b/util/app-config/src/tests/app_config.rs @@ -55,7 +55,10 @@ fn test_export_dev_config_files() { ); assert_eq!( ckb_config.network.listen_addresses, - vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()] + vec![ + "/ip4/0.0.0.0/tcp/8000".parse().unwrap(), + "/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap() + ] ); assert_eq!(ckb_config.network.connect_outbound_interval_secs, 15); assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000"); @@ -148,7 +151,10 @@ fn test_export_testnet_config_files() { ); assert_eq!( ckb_config.network.listen_addresses, - vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()] + vec![ + "/ip4/0.0.0.0/tcp/8000".parse().unwrap(), + "/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap() + ] ); assert_eq!(ckb_config.network.connect_outbound_interval_secs, 15); assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000"); @@ -200,7 +206,10 @@ fn test_export_integration_config_files() { ); assert_eq!( ckb_config.network.listen_addresses, - vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()] + vec![ + "/ip4/0.0.0.0/tcp/8000".parse().unwrap(), + "/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap() + ] ); assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000"); } @@ -252,7 +261,10 @@ fn test_export_dev_config_files_assembly() { ); assert_eq!( ckb_config.network.listen_addresses, - vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()] + vec![ + "/ip4/0.0.0.0/tcp/8000".parse().unwrap(), + "/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap() + ] ); assert_eq!(ckb_config.network.connect_outbound_interval_secs, 15); assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000"); diff --git a/util/metrics-service/Cargo.toml b/util/metrics-service/Cargo.toml index 8a351a49c22..3cc68975bb2 100644 --- a/util/metrics-service/Cargo.toml +++ b/util/metrics-service/Cargo.toml @@ -19,4 +19,4 @@ hyper = { version = "1", features = ["http1", "http2", "server"] } http-body-util = "0.1" hyper-util = { version = "0.1", features = ["server-auto", "server-graceful"] } ckb-stop-handler = { path = "../stop-handler", version = "= 0.120.0-pre" } -tokio = { version = "1", features = ["sync"] } +tokio = { version = "1", features = ["sync", "macros"] }