Skip to content

Commit

Permalink
feat: default listen on ws port
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo committed Dec 2, 2024
1 parent c5b308c commit 0a901a2
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 19 deletions.
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 29 additions & 9 deletions resource/ckb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -103,7 +103,19 @@ discovery_local_address = false # {{
bootnode_mode = false

# Supported protocols list, only "Sync" and "Identify" are mandatory, others are optional
support_protocols = ["Ping", "Discovery", "Identify", "Feeler", "DisconnectMessage", "Sync", "Relay", "Time", "Alert", "LightClient", "Filter"]
support_protocols = [
"Ping",
"Discovery",
"Identify",
"Feeler",
"DisconnectMessage",
"Sync",
"Relay",
"Time",
"Alert",
"LightClient",
"Filter",
]

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

# List of API modules: ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug", "Indexer", "RichIndexer"]
modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment"] # {{
modules = [
"Net",
"Pool",
"Miner",
"Chain",
"Stats",
"Subscription",
"Experiment",
] # {{
# dev => modules = ["Net", "Pool", "Miner", "Chain", "Stats", "Subscription", "Experiment", "Debug"]
# integration => modules = ["Net", "Pool", "Miner", "Chain", "Experiment", "Stats", "IntegrationTest"]
# }}
Expand All @@ -143,18 +163,18 @@ enable_deprecated_rpc = false # {{

[tx_pool]
max_tx_pool_size = 180_000_000 # 180mb
min_fee_rate = 1_000 # Here fee_rate are calculated directly using size in units of shannons/KB
min_fee_rate = 1_000 # Here fee_rate are calculated directly using size in units of shannons/KB
# min_rbf_rate > min_fee_rate means RBF is enabled
min_rbf_rate = 1_500 # Here fee_rate are calculated directly using size in units of shannons/KB
min_rbf_rate = 1_500 # Here fee_rate are calculated directly using size in units of shannons/KB
max_tx_verify_cycles = 70_000_000
max_ancestors_count = 25

[store]
header_cache_size = 4096
cell_data_cache_size = 128
header_cache_size = 4096
cell_data_cache_size = 128
block_proposals_cache_size = 30
block_tx_hashes_cache_size = 30
block_uncles_cache_size = 30
block_uncles_cache_size = 30

# [notify]
# # Execute command when the new tip block changes, first arg is block hash.
Expand Down
20 changes: 16 additions & 4 deletions util/app-config/src/tests/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 0a901a2

Please sign in to comment.