Skip to content

Commit 0a7a0da

Browse files
authored
refactor config params (#52)
1 parent fafd62c commit 0a7a0da

File tree

3 files changed

+139
-4
lines changed

3 files changed

+139
-4
lines changed

node/src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build_config! {
1313
(log_contract_address, (String), "".to_string())
1414
(log_sync_start_block_number, (u64), 0)
1515
(force_log_sync_from_start_block_number, (bool), false)
16-
(confirmation_block_count, (u64), 3)
16+
(confirmation_block_count, (u64), 1)
1717
(log_page_size, (u64), 999)
1818
(max_cache_data_size, (usize), 100 * 1024 * 1024) // 100 MB
1919
(cache_tx_seq_ttl, (usize), 500)

run/config_example.toml

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ stream_ids = ["000000000000000000000000000000000000000000000000000000000000f2bd"
1313

1414
# Directory to store data.
1515
db_dir = "db"
16+
1617
# Directory to store KV Metadata.
17-
kv_db_dir = "kv.DB"
18+
kv_db_file = "kv.DB"
19+
20+
# Cache capacity for merkle tree nodes in bytes (default 32 MB).
21+
# merkle_node_cache_capacity = 33554432
1822

1923
#######################################################################
2024
### Log Sync Config Options ###
@@ -24,6 +28,45 @@ blockchain_rpc_endpoint = ""
2428
log_contract_address = ""
2529
log_sync_start_block_number = 0
2630

31+
# Force resync from start block number, ignoring any previously synced progress.
32+
# force_log_sync_from_start_block_number = false
33+
34+
# Number of confirmations required before a block is considered final.
35+
# confirmation_block_count = 1
36+
37+
# Number of logs to fetch per RPC query page.
38+
# log_page_size = 999
39+
40+
# Maximum size of cached data in bytes (default 100 MB).
41+
# max_cache_data_size = 104857600
42+
43+
# TTL for cached transaction sequences.
44+
# cache_tx_seq_ttl = 500
45+
46+
# Number of retries on RPC rate limit errors.
47+
# rate_limit_retries = 100
48+
49+
# Number of retries on RPC timeout errors.
50+
# timeout_retries = 100
51+
52+
# Initial backoff in milliseconds for RPC retries.
53+
# initial_backoff = 500
54+
55+
# Delay in milliseconds between recovery queries.
56+
# recover_query_delay = 50
57+
58+
# Number of blocks from the latest to consider as finalized.
59+
# default_finalized_block_count = 100
60+
61+
# Interval in minutes to remove finalized block data.
62+
# remove_finalized_block_interval_minutes = 30
63+
64+
# Wait time in milliseconds for the watch loop.
65+
# watch_loop_wait_time_ms = 500
66+
67+
# Timeout in seconds for blockchain RPC calls.
68+
# blockchain_rpc_timeout_secs = 120
69+
2770
#######################################################################
2871
### RPC Config Options ###
2972
#######################################################################
@@ -35,19 +78,44 @@ rpc_enabled = true
3578
rpc_listen_address = "0.0.0.0:6789"
3679

3780
# Indexer endpoint to fetch storage node locations. Leave empty to use zgs_node_urls instead.
38-
indexer_url = "https://indexer-storage-turbo-testnet.0g.ai"
81+
indexer_url = ""
82+
3983
# Static ZGS node list (used when indexer_url is empty).
4084
zgs_node_urls = ""
85+
86+
# Number of chunks per segment for RPC responses.
87+
# rpc_chunks_per_segment = 1024
88+
89+
# Maximum query length in bytes (default 256 KB).
90+
# max_query_len_in_bytes = 262144
91+
92+
# Maximum response body size in bytes (default 30 MB).
93+
# max_response_body_in_bytes = 31457280
94+
95+
# Timeout in seconds for ZGS node RPC calls.
96+
# zgs_rpc_timeout = 5
97+
98+
#######################################################################
99+
### Encryption Options ###
100+
#######################################################################
101+
102+
# Encryption key for data decryption during download and replay.
103+
# Must be a 64-character hex string (32 bytes). Optional 0x prefix is allowed.
104+
# encryption_key = ""
105+
41106
#######################################################################
42107
### Stream Data Sync Options ###
43108
#######################################################################
44109

45110
# Max retries before skipping a failed download. 0 means retry forever.
46111
# max_download_retries = 0
112+
47113
# Timeout for waiting for file locations from indexer/nodes in milliseconds.
48114
# download_timeout_ms = 300000
115+
49116
# Interval between download retry attempts in milliseconds.
50117
# download_retry_interval_ms = 5000
118+
51119
# Wait time between polling iterations in the data fetcher and replayer in milliseconds.
52120
# retry_wait_ms = 1000
53121

run/config_testnet_turbo.toml

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ stream_ids = ["000000000000000000000000000000000000000000000000000000000000f2bd"
1313

1414
# Directory to store data.
1515
db_dir = "db"
16+
1617
# Directory to store KV Metadata.
17-
kv_db_dir = "kv.DB"
18+
kv_db_file = "kv.DB"
19+
20+
# Cache capacity for merkle tree nodes in bytes (default 32 MB).
21+
# merkle_node_cache_capacity = 33554432
1822

1923
#######################################################################
2024
### Log Sync Config Options ###
@@ -24,6 +28,45 @@ blockchain_rpc_endpoint = "https://evmrpc-testnet.0g.ai"
2428
log_contract_address = "0x22E03a6A89B950F1c82ec5e74F8eCa321a105296"
2529
log_sync_start_block_number = 1
2630

31+
# Force resync from start block number, ignoring any previously synced progress.
32+
# force_log_sync_from_start_block_number = false
33+
34+
# Number of confirmations required before a block is considered final.
35+
# confirmation_block_count = 1
36+
37+
# Number of logs to fetch per RPC query page.
38+
# log_page_size = 999
39+
40+
# Maximum size of cached data in bytes (default 100 MB).
41+
# max_cache_data_size = 104857600
42+
43+
# TTL for cached transaction sequences.
44+
# cache_tx_seq_ttl = 500
45+
46+
# Number of retries on RPC rate limit errors.
47+
# rate_limit_retries = 100
48+
49+
# Number of retries on RPC timeout errors.
50+
# timeout_retries = 100
51+
52+
# Initial backoff in milliseconds for RPC retries.
53+
# initial_backoff = 500
54+
55+
# Delay in milliseconds between recovery queries.
56+
# recover_query_delay = 50
57+
58+
# Number of blocks from the latest to consider as finalized.
59+
# default_finalized_block_count = 100
60+
61+
# Interval in minutes to remove finalized block data.
62+
# remove_finalized_block_interval_minutes = 30
63+
64+
# Wait time in milliseconds for the watch loop.
65+
# watch_loop_wait_time_ms = 500
66+
67+
# Timeout in seconds for blockchain RPC calls.
68+
# blockchain_rpc_timeout_secs = 120
69+
2770
#######################################################################
2871
### RPC Config Options ###
2972
#######################################################################
@@ -36,19 +79,43 @@ rpc_listen_address = "0.0.0.0:6789"
3679

3780
# Indexer endpoint to fetch storage node locations. Leave empty to use zgs_node_urls instead.
3881
indexer_url = "https://indexer-storage-turbo-testnet.0g.ai"
82+
3983
# Static ZGS node list (used when indexer_url is empty).
4084
zgs_node_urls = ""
4185

86+
# Number of chunks per segment for RPC responses.
87+
# rpc_chunks_per_segment = 1024
88+
89+
# Maximum query length in bytes (default 256 KB).
90+
# max_query_len_in_bytes = 262144
91+
92+
# Maximum response body size in bytes (default 30 MB).
93+
# max_response_body_in_bytes = 31457280
94+
95+
# Timeout in seconds for ZGS node RPC calls.
96+
# zgs_rpc_timeout = 5
97+
98+
#######################################################################
99+
### Encryption Options ###
100+
#######################################################################
101+
102+
# Encryption key for data decryption during download and replay.
103+
# Must be a 64-character hex string (32 bytes). Optional 0x prefix is allowed.
104+
# encryption_key = ""
105+
42106
#######################################################################
43107
### Stream Data Sync Options ###
44108
#######################################################################
45109

46110
# Max retries before skipping a failed download. 0 means retry forever.
47111
# max_download_retries = 3
112+
48113
# Timeout for waiting for file locations from indexer/nodes in milliseconds.
49114
# download_timeout_ms = 10000
115+
50116
# Interval between download retry attempts in milliseconds.
51117
# download_retry_interval_ms = 1000
118+
52119
# Wait time between polling iterations in the data fetcher and replayer in milliseconds.
53120
# retry_wait_ms = 1000
54121

0 commit comments

Comments
 (0)