Skip to content

Commit 0a901a2

Browse files
committed
feat: default listen on ws port
1 parent c5b308c commit 0a901a2

File tree

3 files changed

+52
-19
lines changed

3 files changed

+52
-19
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: 29 additions & 9 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 = []
@@ -103,7 +103,19 @@ discovery_local_address = false # {{
103103
bootnode_mode = false
104104

105105
# Supported protocols list, only "Sync" and "Identify" are mandatory, others are optional
106-
support_protocols = ["Ping", "Discovery", "Identify", "Feeler", "DisconnectMessage", "Sync", "Relay", "Time", "Alert", "LightClient", "Filter"]
106+
support_protocols = [
107+
"Ping",
108+
"Discovery",
109+
"Identify",
110+
"Feeler",
111+
"DisconnectMessage",
112+
"Sync",
113+
"Relay",
114+
"Time",
115+
"Alert",
116+
"LightClient",
117+
"Filter",
118+
]
107119

108120
# [network.sync.header_map]
109121
# memory_limit = "256MB"
@@ -121,7 +133,15 @@ listen_address = "127.0.0.1:8114" # {{
121133
max_request_body_size = 10485760
122134

123135
# List of API modules: ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer", "RichIndexer"]
124-
modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment"] # {{
136+
modules = [
137+
"Net",
138+
"Pool",
139+
"Miner",
140+
"Chain",
141+
"Stats",
142+
"Subscription",
143+
"Experiment",
144+
] # {{
125145
# dev => modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug"]
126146
# integration => modules = ["Net", "Pool", "Miner", "Chain", "Experiment", "Stats", "IntegrationTest"]
127147
# }}
@@ -143,18 +163,18 @@ enable_deprecated_rpc = false # {{
143163

144164
[tx_pool]
145165
max_tx_pool_size = 180_000_000 # 180mb
146-
min_fee_rate = 1_000 # Here fee_rate are calculated directly using size in units of shannons/KB
166+
min_fee_rate = 1_000 # Here fee_rate are calculated directly using size in units of shannons/KB
147167
# min_rbf_rate > min_fee_rate means RBF is enabled
148-
min_rbf_rate = 1_500 # Here fee_rate are calculated directly using size in units of shannons/KB
168+
min_rbf_rate = 1_500 # Here fee_rate are calculated directly using size in units of shannons/KB
149169
max_tx_verify_cycles = 70_000_000
150170
max_ancestors_count = 25
151171

152172
[store]
153-
header_cache_size = 4096
154-
cell_data_cache_size = 128
173+
header_cache_size = 4096
174+
cell_data_cache_size = 128
155175
block_proposals_cache_size = 30
156176
block_tx_hashes_cache_size = 30
157-
block_uncles_cache_size = 30
177+
block_uncles_cache_size = 30
158178

159179
# [notify]
160180
# # Execute command when the new tip block changes, first arg is block hash.

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)