diff --git a/notify/Cargo.toml b/notify/Cargo.toml index 40402ff927..1492f77731 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-rc3" } -ckb-app-config = { path = "../util/app-config", version = "= 0.120.0-rc3" } +ckb-app-config = { path = "../util/app-config", version = "= 0.120.0-rc3" } ckb-types = { path = "../util/types", version = "= 0.120.0-rc3" } ckb-stop-handler = { path = "../util/stop-handler", version = "= 0.120.0-rc3" } ckb-async-runtime = { path = "../util/runtime", version = "= 0.120.0-rc3" } + +[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 68cf8e2fd8..3df8e09dde 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 7edc99523c..e805f89702 100644 --- a/spec/Cargo.toml +++ b/spec/Cargo.toml @@ -25,7 +25,10 @@ ckb-traits = { path = "../traits", version = "= 0.120.0-rc3" } ckb-logger = { path = "../util/logger", version = "= 0.120.0-rc3" } [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 52fcd4b163..68d1de7218 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 2d5ec446a0..2354d91f38 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-rc3" } -tokio = { version = "1", features = ["sync"] } +tokio = { version = "1", features = ["sync", "macros"] }