1616#include < logging.h>
1717#include < sv2/template_provider.h>
1818#include < tinyformat.h>
19+ #include < util/chaintype.h>
1920#include < util/translation.h>
2021
2122#ifndef WIN32
@@ -131,6 +132,9 @@ MAIN_FUNCTION
131132 return EXIT_FAILURE;
132133 }
133134
135+ const ChainType chain_type = args.GetChainType ();
136+ LogPrintf (" Starting sv2-tp on %s network\n " , ChainTypeToString (chain_type));
137+
134138 ECC_Context ecc_context{};
135139 std::string sha256_algo = SHA256AutoDetect ();
136140 LogInfo (" Using the '%s' SHA256 implementation\n " , sha256_algo);
@@ -171,20 +175,23 @@ MAIN_FUNCTION
171175 assert (mine_init);
172176 std::unique_ptr<interfaces::Init> node_init;
173177 std::string address{args.GetArg (" -ipcconnect" , " unix" )};
178+
179+ LogPrintf (" Attempting IPC connection to bitcoin-node at %s\n " , address);
180+ LogPrintf (" Ensure Bitcoin Core is running with '-ipcbind=unix' and the correct network (%s)\n " ,
181+ ChainTypeToString (chain_type));
182+
174183 while (true ) {
175184 try {
176185 node_init = mine_init->ipc ()->connectAddress (address);
186+ LogPrintf (" Connected to bitcoin-node via IPC at: %s\n " , address);
177187 break ; // Success: break out of the loop
178188 } catch (const std::exception& exception) {
179189 LogPrintf (" IPC connection failed: %s\n " , exception.what ());
180- LogPrintf (" bitcoin-node might not be running or listening on a UNIX socket.\n " );
181- LogPrintf (" Retrying in 10 seconds...\n " );
182-
190+ LogPrintf (" Retrying in 10 seconds... (Ensure Bitcoin Core is running with '-ipcbind=unix')\n " );
183191 std::this_thread::sleep_for (std::chrono::seconds (10 ));
184192 }
185193 }
186194 assert (node_init);
187- tfm::format (std::cout, " Connected to bitcoin-node\n " );
188195 std::unique_ptr<interfaces::Mining> mining{node_init->makeMining ()};
189196 assert (mining);
190197
@@ -195,6 +202,9 @@ MAIN_FUNCTION
195202 return EXIT_FAILURE;
196203 }
197204
205+ LogPrintf (" sv2-tp listening for Stratum v2 connections on %s:%d\n " ,
206+ options.host , options.port );
207+
198208#ifndef WIN32
199209 registerSignalHandler (SIGTERM, HandleSIGTERM);
200210 registerSignalHandler (SIGINT, HandleSIGTERM);
0 commit comments