enhance default config value (#97)

This commit is contained in:
Bo QIU 2024-06-27 14:47:33 +08:00 committed by GitHub
parent 439314372b
commit 4ee782e4bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 17 deletions

View File

@ -24,12 +24,12 @@ impl ZgsConfig {
network_config.libp2p_port = self.network_libp2p_port;
network_config.disable_discovery = self.network_disable_discovery;
network_config.discovery_port = self.network_discovery_port;
network_config.enr_tcp_port = self.network_enr_tcp_port;
network_config.enr_udp_port = self.network_enr_udp_port;
network_config.enr_address = self
.network_enr_address
.as_ref()
.map(|x| x.parse::<std::net::IpAddr>().unwrap());
if let Some(addr) = &self.network_enr_address {
network_config.enr_tcp_port = Some(self.network_enr_tcp_port);
network_config.enr_udp_port = Some(self.network_enr_udp_port);
network_config.enr_address = Some(addr.parse().unwrap());
}
network_config.boot_nodes_multiaddr = self
.network_boot_nodes

View File

@ -10,8 +10,8 @@ build_config! {
(network_dir, (String), "network".to_string())
(network_listen_address, (String), "0.0.0.0".to_string())
(network_enr_address, (Option<String>), None)
(network_enr_tcp_port, (Option<u16>), None)
(network_enr_udp_port, (Option<u16>), None)
(network_enr_tcp_port, (u16), 1234)
(network_enr_udp_port, (u16), 1234)
(network_libp2p_port, (u16), 1234)
(network_discovery_port, (u16), 1234)
(network_target_peers, (usize), 50)
@ -34,7 +34,7 @@ build_config! {
(log_contract_address, (String), "".to_string())
(log_sync_start_block_number, (u64), 0)
(confirmation_block_count, (u64), 12)
(log_page_size, (u64), 1000)
(log_page_size, (u64), 999)
(max_cache_data_size, (usize), 100 * 1024 * 1024) // 100 MB
(cache_tx_seq_ttl, (usize), 500)
@ -49,7 +49,7 @@ build_config! {
// rpc
(rpc_enabled, (bool), true)
(rpc_listen_address, (String), "127.0.0.1:5678".to_string())
(rpc_listen_address, (String), "0.0.0.0:5678".to_string())
(rpc_listen_address_admin, (String), "127.0.0.1:5679".to_string())
(max_request_body_size, (u32), 100*1024*1024) // 100MB
(rpc_chunks_per_segment, (usize), 1024)

View File

@ -11,9 +11,8 @@
# IP address to listen on.
# network_listen_address = "0.0.0.0"
# The address to broadcast to peers about which address we are listening on. Empty indicates
# that no discovery address has been set. Generally, configure public IP address along with
# `network_enr_tcp_port` and `network_enr_udp_port` with default values to enable UDP discovery.
# The address to broadcast to peers about which address we are listening on. Empty indicates that
# no discovery address has been set. Generally, configure public IP address to enable UDP discovery.
# network_enr_address = ""
# The tcp port to broadcast to peers in order to reach back for libp2p services.
@ -31,8 +30,8 @@
# Target number of connected peers.
# network_target_peers = 50
# List of nodes to bootstrap UDP discovery. Note, `network_enr_address`, `network_enr_tcp_port`
# and `network_enr_udp_port` should be configured as well to enable UDP discovery.
# List of nodes to bootstrap UDP discovery. Note, `network_enr_address` should be
# configured as well to enable UDP discovery.
network_boot_nodes = ["/ip4/54.219.26.22/udp/1234/p2p/16Uiu2HAmPxGNWu9eVAQPJww79J32pTJLKGcpjRMb4Qb8xxKkyuG1","/ip4/52.52.127.117/udp/1234/p2p/16Uiu2HAm93Hd5azfhkGBbkx1zero3nYHvfjQYM2NtiW4R3r5bE2g"]
# List of libp2p nodes to initially connect to.
@ -90,7 +89,7 @@ log_sync_start_block_number = 512567
# confirmation_block_count = 12
# Maximum number of event logs to poll at a time.
log_page_size = 999
# log_page_size = 999
# Maximum data size to cache in memory (by default, 100MB).
# max_cache_data_size = 104857600
@ -128,7 +127,7 @@ log_page_size = 999
# rpc_enabled = true
# HTTP server address to bind for public RPC.
rpc_listen_address = "0.0.0.0:5678"
# rpc_listen_address = "0.0.0.0:5678"
# HTTP server address to bind for admin and debug RPC.
# rpc_listen_address_admin = "127.0.0.1:5679"