Skip to content

Commit 628634c

Browse files
authored
Merge pull request #4729 from driftluo/enable-ws-listen
feat: default listen on ws port
2 parents c5b308c + ba18485 commit 628634c

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

Cargo.lock

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resource/ckb.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ cache_size = 268435456
6363
options_file = "default.db-options"
6464

6565
[network]
66-
listen_addresses = ["/ip4/0.0.0.0/tcp/8115"] # {{
67-
# _ => listen_addresses = ["/ip4/0.0.0.0/tcp/{p2p_port}"]
66+
listen_addresses = ["/ip4/0.0.0.0/tcp/8115", "/ip4/0.0.0.0/tcp/8115/ws"] # {{
67+
# _ => listen_addresses = ["/ip4/0.0.0.0/tcp/{p2p_port}", "/ip4/0.0.0.0/tcp/{p2p_port}/ws"]
6868
# }}
6969
### Specify the public and routable network addresses
7070
# public_addresses = []

util/app-config/src/tests/app_config.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ fn test_export_dev_config_files() {
5555
);
5656
assert_eq!(
5757
ckb_config.network.listen_addresses,
58-
vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()]
58+
vec![
59+
"/ip4/0.0.0.0/tcp/8000".parse().unwrap(),
60+
"/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap()
61+
]
5962
);
6063
assert_eq!(ckb_config.network.connect_outbound_interval_secs, 15);
6164
assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000");
@@ -148,7 +151,10 @@ fn test_export_testnet_config_files() {
148151
);
149152
assert_eq!(
150153
ckb_config.network.listen_addresses,
151-
vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()]
154+
vec![
155+
"/ip4/0.0.0.0/tcp/8000".parse().unwrap(),
156+
"/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap()
157+
]
152158
);
153159
assert_eq!(ckb_config.network.connect_outbound_interval_secs, 15);
154160
assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000");
@@ -200,7 +206,10 @@ fn test_export_integration_config_files() {
200206
);
201207
assert_eq!(
202208
ckb_config.network.listen_addresses,
203-
vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()]
209+
vec![
210+
"/ip4/0.0.0.0/tcp/8000".parse().unwrap(),
211+
"/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap()
212+
]
204213
);
205214
assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000");
206215
}
@@ -252,7 +261,10 @@ fn test_export_dev_config_files_assembly() {
252261
);
253262
assert_eq!(
254263
ckb_config.network.listen_addresses,
255-
vec!["/ip4/0.0.0.0/tcp/8000".parse().unwrap()]
264+
vec![
265+
"/ip4/0.0.0.0/tcp/8000".parse().unwrap(),
266+
"/ip4/0.0.0.0/tcp/8000/ws".parse().unwrap()
267+
]
256268
);
257269
assert_eq!(ckb_config.network.connect_outbound_interval_secs, 15);
258270
assert_eq!(ckb_config.rpc.listen_address, "127.0.0.1:7000");

0 commit comments

Comments
 (0)