Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Cryptonightv7 updates,Autorig id,Error control, TLS ability for pools
Browse files Browse the repository at this point in the history
  • Loading branch information
whosliam committed Jun 8, 2018
1 parent 1f6a8b9 commit 38e62fd
Show file tree
Hide file tree
Showing 40 changed files with 180 additions and 264 deletions.
Binary file not shown.
39 changes: 24 additions & 15 deletions ETN_CPU_GPU_MINER/ETN_CPU_GPU_MINER/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 27 additions & 15 deletions ETN_CPU_GPU_MINER/ETN_CPU_GPU_MINER/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public Form1()
//Load Help tab
tabs.SelectedTab = tbHelp;
}

//Set TLS flag
chkTLS.Checked = registryManager.GetTLSFLAG();
//Spool up timers
InitTemps();

Expand Down Expand Up @@ -154,7 +155,7 @@ private void BtnStartMining_Click(object sender, EventArgs e)
if (!IsWalletValid())
return;
SpawnMiner(cpuorgpu.SelectedItem.ToString());
PushStatusMessage("config.txt updated", m_bDoLog);
PushStatusMessage("configs updated", m_bDoLog);
//Start header Timer for app run time
m_bStartTime = true;
stopwatch.Start();
Expand All @@ -178,7 +179,7 @@ private void SpawnMiner(string sComponent)
#region UPDATE CONFIG
#region House Keeping
string sConfig_Template_File_Name = "config_templates/config-etncraft.txt";
string sConfig_File_Name = "app_assets/config.txt";
string sConfig_File_Name = "app_assets/pools.txt";
#endregion
#region Delete and recreate config.txt
if (File.Exists(sConfig_File_Name))
Expand All @@ -196,6 +197,9 @@ private void SpawnMiner(string sComponent)
var CONFIG_CONTENTS = File.ReadAllText(sConfig_File_Name);
CONFIG_CONTENTS = CONFIG_CONTENTS.Replace("address_replace", m_MiningURL + ":" + port.Text);
CONFIG_CONTENTS = CONFIG_CONTENTS.Replace("wallet_replace", wallet_address.Text.Replace(" ", ""));
CONFIG_CONTENTS = CONFIG_CONTENTS.Replace("rig_id_replace", "ETNCRAFT_" + System.Environment.UserName.Replace(" ", "_"));
CONFIG_CONTENTS = CONFIG_CONTENTS.Replace("use_tls_replace", chkTLS.Checked.ToString().ToLower());

File.SetAttributes(Application.StartupPath + "\\" + sConfig_File_Name, FileAttributes.Normal);
File.WriteAllText(Application.StartupPath + "\\" + sConfig_File_Name, CONFIG_CONTENTS);
#endregion
Expand Down Expand Up @@ -489,6 +493,7 @@ private void SaveConfig()
registryManager.SetEnforceMaxUpTime(chkMaxUp.Checked);
registryManager.SetMaxUpTimeMin(maxUpTimeMin.Text.Length > 0 ? Convert.ToDouble(maxUpTimeMin.Text) : 0);
registryManager.SetScheduleData(m_sScheduleData);
registryManager.SetTLSFlag(chkTLS.Checked);
PushStatusMessage("Configuration Updated", m_bDoLog);
}

Expand Down Expand Up @@ -731,12 +736,12 @@ private bool IsWalletValid()
private void LoadPoolListFromWebsite()
{
//Set Path
string filepath = Application.StartupPath + "\\app_assets\\pools.txt";
string filepath = Application.StartupPath + "\\app_assets\\etnpools.txt";
//Download doc from website
try
{
WebClient webClient = new WebClient();
webClient.DownloadFile("http://liamthrower.com/pools.txt", filepath);
webClient.DownloadFile("http://liamthrower.com/etnpools.txt", filepath);
}
catch (Exception e)
{
Expand Down Expand Up @@ -780,17 +785,24 @@ private string CheckTempLimitEntry(string sText)
private string GetCurrentCoinPrice()
{
string sETNUSD = "";
var json = new WebClient().DownloadString("https://api.nanopool.org/v1/etn/prices");
if (!json.Equals(""))
try
{
var json = new WebClient().DownloadString("https://api.nanopool.org/v1/etn/prices");
if (!json.Equals(""))
{
PRICE_Rootobject r = JsonConvert.DeserializeObject<PRICE_Rootobject>(json);
sETNUSD = "Date: " + DateTime.Now.ToString("MMM dd @ hh:mm:ss") + "\r\n";
sETNUSD += "ETN Price USD: " + r.data.price_usd + "\r\n";
sETNUSD += "ETN Price BTN: " + r.data.price_btc + "\r\n";
sETNUSD += "ETN Price EUR: " + r.data.price_eur + "\r\n";
sETNUSD += "ETN Price RUR: " + r.data.price_rur + "\r\n";
sETNUSD += "ETN Price CNY: " + r.data.price_cny + "\r\n\r\n";
sETNUSD += "Source: Nanopool.org";
}
}
catch (Exception e)
{
PRICE_Rootobject r = JsonConvert.DeserializeObject<PRICE_Rootobject>(json);
sETNUSD = "Date: " + DateTime.Now.ToString("MMM dd @ hh:mm:ss") + "\r\n";
sETNUSD += "ETN Price USD: " + r.data.price_usd + "\r\n";
sETNUSD += "ETN Price BTN: " + r.data.price_btc + "\r\n";
sETNUSD += "ETN Price EUR: " + r.data.price_eur + "\r\n";
sETNUSD += "ETN Price RUR: " + r.data.price_rur + "\r\n";
sETNUSD += "ETN Price CNY: " + r.data.price_cny + "\r\n\r\n";
sETNUSD += "Source: Nanopool.org";
sETNUSD = e.Message;
}
return sETNUSD;
}
Expand Down
Loading

0 comments on commit 38e62fd

Please sign in to comment.