From 9c12bd15e0f9914d7c8c960c96ce4ec4218d04b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos?= <164224824+marcospb19-cw@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:13:32 -0300 Subject: [PATCH] chore: change default number of connections (#560) and give warning in case it is just one, because it might cause failures --- config/importer-online.env.local | 2 +- config/run-with-importer.env.local | 2 +- config/state-validator.env.local | 2 +- config/stratus.env.local | 2 +- src/lib.rs | 5 +++++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config/importer-online.env.local b/config/importer-online.env.local index aa5ccb293..7dd3fd08d 100644 --- a/config/importer-online.env.local +++ b/config/importer-online.env.local @@ -4,7 +4,7 @@ EVMS=1 EXTERNAL_RPC=http://spec.testnet.cloudwalk.network:9934/ PERM_STORAGE=inmemory -PERM_STORAGE_CONNECTIONS=1 +PERM_STORAGE_CONNECTIONS=2 PERM_STORAGE_TIMEOUT=1000 TEMP_STORAGE=inmemory \ No newline at end of file diff --git a/config/run-with-importer.env.local b/config/run-with-importer.env.local index d8a34b2b9..6f0b72f75 100644 --- a/config/run-with-importer.env.local +++ b/config/run-with-importer.env.local @@ -4,7 +4,7 @@ EVMS=1 EXTERNAL_RPC=http://spec.testnet.cloudwalk.network:9934/ PERM_STORAGE=rocks -PERM_STORAGE_CONNECTIONS=1 +PERM_STORAGE_CONNECTIONS=2 PERM_STORAGE_TIMEOUT=1000 TEMP_STORAGE=inmemory diff --git a/config/state-validator.env.local b/config/state-validator.env.local index 6adebe497..32dedac5d 100644 --- a/config/state-validator.env.local +++ b/config/state-validator.env.local @@ -2,7 +2,7 @@ METHOD=http://spec.testnet.cloudwalk.network:9934/ # storages PERM_STORAGE=inmemory -PERM_STORAGE_CONNECTIONS=1 +PERM_STORAGE_CONNECTIONS=2 PERM_STORAGE_TIMEOUT=1000 TEMP_STORAGE=inmemory diff --git a/config/stratus.env.local b/config/stratus.env.local index e3c2dd536..476b92e15 100644 --- a/config/stratus.env.local +++ b/config/stratus.env.local @@ -2,7 +2,7 @@ CHAIN_ID=2008 EVMS=1 PERM_STORAGE=inmemory -PERM_STORAGE_CONNECTIONS=2 +PERM_STORAGE_CONNECTIONS=5 PERM_STORAGE_TIMEOUT=2000 TEMP_STORAGE=inmemory \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 3dd47d6de..0488e0ecb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +use std::env; use std::fmt::Debug; use crate::config::load_dotenv; @@ -18,6 +19,10 @@ where let config = T::parse(); println!("parsed configuration: {:?}", config); + if env::var_os("PERM_STORAGE_CONNECTIONS").is_some_and(|value| value == "1") { + println!("WARNING: env var PERM_STORAGE_CONNECTIONS is set to 1, if it cause connection problems, try increasing it"); + } + // init services infra::init_tracing(); #[cfg(feature = "metrics")]