@@ -123,6 +123,8 @@ class MinerCLI
123
123
node.stratumPort = ProgOpt::Get (" Node2" , " StratumPort" );
124
124
node.stratumPwd = ProgOpt::Get (" Node2" , " StratumPwd" );
125
125
m_nodes.push_back (node);
126
+
127
+ m_web3Url = ProgOpt::Get (" General" , " Web3Url" , " https://mainnet.infura.io/v3/7d1d166f63d84fc0865e5e410f583564" );
126
128
}
127
129
128
130
/* -----------------------------------------------------------------------------------
@@ -851,6 +853,9 @@ class MinerCLI
851
853
852
854
LogS << " Connecting to " << _nodeURL + " :" + _rpcPort << " ..." ;
853
855
856
+ // workRPC is used to get work and submit solutions
857
+ // nodeRPC is used to retrieve current ETH block number and query token balance
858
+
854
859
// if solo mining, both workRPC and nodeRPC point to the mainNet node (whatever the user specifies)
855
860
// if pool mining, workRPC points to the mining pool, and nodeRPC points to Infura
856
861
@@ -861,7 +866,7 @@ class MinerCLI
861
866
FarmClient* nodeRPC = &workRPC;
862
867
if (m_opMode == OperationMode::Pool)
863
868
{
864
- nodeClient = new jsonrpc::HttpClient (" https://mainnet.infura.io/J9KBwsJ0q1LMIQvzDlGC:8545 " );
869
+ nodeClient = new jsonrpc::HttpClient (m_web3Url );
865
870
nodeRPC = new FarmClient (*nodeClient, OperationMode::Solo, m_userAcct);
866
871
}
867
872
else
@@ -1090,7 +1095,7 @@ class MinerCLI
1090
1095
int maxRetries = failOverAvailable () ? m_maxFarmRetries : 0 ;
1091
1096
EthStratumClient* client = new EthStratumClient (_nodeURL, _stratumPort, maxRetries, m_worktimeout, m_userAcct);
1092
1097
1093
- jsonrpc::HttpClient rpcClient (" https://mainnet.infura.io/J9KBwsJ0q1LMIQvzDlGC:8545 " );
1098
+ jsonrpc::HttpClient rpcClient (m_web3Url );
1094
1099
FarmClient nodeRPC (rpcClient, OperationMode::Solo, m_userAcct);
1095
1100
1096
1101
int tokenBalance = nodeRPC.tokenBalance ();
@@ -1227,5 +1232,6 @@ class MinerCLI
1227
1232
bool m_shutdown = false ;
1228
1233
1229
1234
string m_userAcct;
1235
+ string m_web3Url;
1230
1236
1231
1237
};
0 commit comments