mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-11-20 15:05:19 +00:00
enhance default config value (#97)
This commit is contained in:
parent
439314372b
commit
4ee782e4bc
@ -24,12 +24,12 @@ impl ZgsConfig {
|
|||||||
network_config.libp2p_port = self.network_libp2p_port;
|
network_config.libp2p_port = self.network_libp2p_port;
|
||||||
network_config.disable_discovery = self.network_disable_discovery;
|
network_config.disable_discovery = self.network_disable_discovery;
|
||||||
network_config.discovery_port = self.network_discovery_port;
|
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;
|
if let Some(addr) = &self.network_enr_address {
|
||||||
network_config.enr_address = self
|
network_config.enr_tcp_port = Some(self.network_enr_tcp_port);
|
||||||
.network_enr_address
|
network_config.enr_udp_port = Some(self.network_enr_udp_port);
|
||||||
.as_ref()
|
network_config.enr_address = Some(addr.parse().unwrap());
|
||||||
.map(|x| x.parse::<std::net::IpAddr>().unwrap());
|
}
|
||||||
|
|
||||||
network_config.boot_nodes_multiaddr = self
|
network_config.boot_nodes_multiaddr = self
|
||||||
.network_boot_nodes
|
.network_boot_nodes
|
||||||
|
@ -10,8 +10,8 @@ build_config! {
|
|||||||
(network_dir, (String), "network".to_string())
|
(network_dir, (String), "network".to_string())
|
||||||
(network_listen_address, (String), "0.0.0.0".to_string())
|
(network_listen_address, (String), "0.0.0.0".to_string())
|
||||||
(network_enr_address, (Option<String>), None)
|
(network_enr_address, (Option<String>), None)
|
||||||
(network_enr_tcp_port, (Option<u16>), None)
|
(network_enr_tcp_port, (u16), 1234)
|
||||||
(network_enr_udp_port, (Option<u16>), None)
|
(network_enr_udp_port, (u16), 1234)
|
||||||
(network_libp2p_port, (u16), 1234)
|
(network_libp2p_port, (u16), 1234)
|
||||||
(network_discovery_port, (u16), 1234)
|
(network_discovery_port, (u16), 1234)
|
||||||
(network_target_peers, (usize), 50)
|
(network_target_peers, (usize), 50)
|
||||||
@ -34,7 +34,7 @@ build_config! {
|
|||||||
(log_contract_address, (String), "".to_string())
|
(log_contract_address, (String), "".to_string())
|
||||||
(log_sync_start_block_number, (u64), 0)
|
(log_sync_start_block_number, (u64), 0)
|
||||||
(confirmation_block_count, (u64), 12)
|
(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
|
(max_cache_data_size, (usize), 100 * 1024 * 1024) // 100 MB
|
||||||
(cache_tx_seq_ttl, (usize), 500)
|
(cache_tx_seq_ttl, (usize), 500)
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ build_config! {
|
|||||||
|
|
||||||
// rpc
|
// rpc
|
||||||
(rpc_enabled, (bool), true)
|
(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())
|
(rpc_listen_address_admin, (String), "127.0.0.1:5679".to_string())
|
||||||
(max_request_body_size, (u32), 100*1024*1024) // 100MB
|
(max_request_body_size, (u32), 100*1024*1024) // 100MB
|
||||||
(rpc_chunks_per_segment, (usize), 1024)
|
(rpc_chunks_per_segment, (usize), 1024)
|
||||||
|
@ -11,9 +11,8 @@
|
|||||||
# IP address to listen on.
|
# IP address to listen on.
|
||||||
# network_listen_address = "0.0.0.0"
|
# network_listen_address = "0.0.0.0"
|
||||||
|
|
||||||
# The address to broadcast to peers about which address we are listening on. Empty indicates
|
# The address to broadcast to peers about which address we are listening on. Empty indicates that
|
||||||
# that no discovery address has been set. Generally, configure public IP address along with
|
# no discovery address has been set. Generally, configure public IP address to enable UDP discovery.
|
||||||
# `network_enr_tcp_port` and `network_enr_udp_port` with default values to enable UDP discovery.
|
|
||||||
# network_enr_address = ""
|
# network_enr_address = ""
|
||||||
|
|
||||||
# The tcp port to broadcast to peers in order to reach back for libp2p services.
|
# The tcp port to broadcast to peers in order to reach back for libp2p services.
|
||||||
@ -31,8 +30,8 @@
|
|||||||
# Target number of connected peers.
|
# Target number of connected peers.
|
||||||
# network_target_peers = 50
|
# network_target_peers = 50
|
||||||
|
|
||||||
# List of nodes to bootstrap UDP discovery. Note, `network_enr_address`, `network_enr_tcp_port`
|
# List of nodes to bootstrap UDP discovery. Note, `network_enr_address` should be
|
||||||
# and `network_enr_udp_port` should be configured as well to enable UDP discovery.
|
# 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"]
|
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.
|
# List of libp2p nodes to initially connect to.
|
||||||
@ -90,7 +89,7 @@ log_sync_start_block_number = 512567
|
|||||||
# confirmation_block_count = 12
|
# confirmation_block_count = 12
|
||||||
|
|
||||||
# Maximum number of event logs to poll at a time.
|
# 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).
|
# Maximum data size to cache in memory (by default, 100MB).
|
||||||
# max_cache_data_size = 104857600
|
# max_cache_data_size = 104857600
|
||||||
@ -128,7 +127,7 @@ log_page_size = 999
|
|||||||
# rpc_enabled = true
|
# rpc_enabled = true
|
||||||
|
|
||||||
# HTTP server address to bind for public RPC.
|
# 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.
|
# HTTP server address to bind for admin and debug RPC.
|
||||||
# rpc_listen_address_admin = "127.0.0.1:5679"
|
# rpc_listen_address_admin = "127.0.0.1:5679"
|
||||||
|
Loading…
Reference in New Issue
Block a user