@@ -45,6 +45,7 @@ ABSL_FLAG(std::string, chaindata, silkrpc::common::kEmptyChainData, "chain data
4545ABSL_FLAG (std::string, local, silkrpc::common::kDefaultLocal , " HTTP JSON local binding as string <address>:<port>" );
4646ABSL_FLAG (std::string, target, silkrpc::common::kDefaultTarget , " TG Core gRPC service location as string <address>:<port>" );
4747ABSL_FLAG (uint32_t , numContexts, std::thread::hardware_concurrency() / 2, "number of running I/O contexts as 32-bit integer");
48+ ABSL_FLAG (uint32_t , numWorkers, std::thread::hardware_concurrency(), "number of worker threads as 32-bit integer");
4849ABSL_FLAG (uint32_t , timeout, silkrpc::common::kDefaultTimeout .count(), "gRPC call timeout as 32-bit integer");
4950ABSL_FLAG (silkrpc::LogLevel, logLevel, silkrpc::LogLevel::Critical, " logging level" );
5051
@@ -74,7 +75,7 @@ int main(int argc, char* argv[]) {
7475 auto chaindata{absl::GetFlag (FLAGS_chaindata)};
7576 if (!chaindata.empty () && !std::filesystem::exists (chaindata)) {
7677 SILKRPC_ERROR << " Parameter chaindata is invalid: [" << chaindata << " ]\n " ;
77- SILKRPC_ERROR << " Use --chaindata flag to specify the path of Turbo-Geth database\n " ;
78+ SILKRPC_ERROR << " Use --chaindata flag to specify the path of Erigon database\n " ;
7879 return -1 ;
7980 }
8081
@@ -88,20 +89,20 @@ int main(int argc, char* argv[]) {
8889 auto target{absl::GetFlag (FLAGS_target)};
8990 if (!target.empty () && target.find (" :" ) == std::string::npos) {
9091 SILKRPC_ERROR << " Parameter target is invalid: [" << target << " ]\n " ;
91- SILKRPC_ERROR << " Use --target flag to specify the location of Turbo-Geth running instance\n " ;
92+ SILKRPC_ERROR << " Use --target flag to specify the location of Erigon running instance\n " ;
9293 return -1 ;
9394 }
9495
9596 if (chaindata.empty () && target.empty ()) {
9697 SILKRPC_ERROR << " Parameters chaindata and target cannot be both empty, specify one of them\n " ;
97- SILKRPC_ERROR << " Use --chaindata or --target flag to specify the path or the location of Turbo-Geth instance\n " ;
98+ SILKRPC_ERROR << " Use --chaindata or --target flag to specify the path or the location of Erigon instance\n " ;
9899 return -1 ;
99100 }
100101
101102 auto timeout{absl::GetFlag (FLAGS_timeout)};
102103 if (timeout < 0 ) {
103104 SILKRPC_ERROR << " Parameter timeout is invalid: [" << timeout << " ]\n " ;
104- SILKRPC_ERROR << " Use --timeout flag to specify the timeout in msecs for Turbo-Geth KV gRPC I/F\n " ;
105+ SILKRPC_ERROR << " Use --timeout flag to specify the timeout in msecs for Erigon KV gRPC I/F\n " ;
105106 return -1 ;
106107 }
107108
@@ -112,6 +113,13 @@ int main(int argc, char* argv[]) {
112113 return -1 ;
113114 }
114115
116+ auto numWorkers{absl::GetFlag (FLAGS_numWorkers)};
117+ if (numWorkers < 0 ) {
118+ SILKRPC_ERROR << " Parameter numWorkers is invalid: [" << numWorkers << " ]\n " ;
119+ SILKRPC_ERROR << " Use --numWorkers flag to specify the number of worker threads executing long-run operations\n " ;
120+ return -1 ;
121+ }
122+
115123 if (chaindata.empty ()) {
116124 SILKRPC_LOG << " Silkrpc launched with target " << target << " using " << numContexts << " contexts\n " ;
117125 } else {
@@ -139,7 +147,7 @@ int main(int argc, char* argv[]) {
139147
140148 const auto http_host = local.substr (0 , local.find (kAddressPortSeparator ));
141149 const auto http_port = local.substr (local.find (kAddressPortSeparator ) + 1 , std::string::npos);
142- silkrpc::http::Server http_server{http_host, http_port, context_pool};
150+ silkrpc::http::Server http_server{http_host, http_port, context_pool, numWorkers };
143151
144152 auto & io_context = context_pool.get_io_context ();
145153 asio::signal_set signals{io_context, SIGINT, SIGTERM};
0 commit comments