diff --git a/AVR_Miner.py b/AVR_Miner.py index b6c2b514..5f730f7f 100644 --- a/AVR_Miner.py +++ b/AVR_Miner.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Duino-Coin Official AVR Miner 3.2 © MIT licensed +Duino-Coin Official AVR Miner 3.3 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2022 @@ -18,7 +18,7 @@ from pathlib import Path from json import load as jsonload -import json +from random import choice from locale import LC_ALL, getdefaultlocale, getlocale, setlocale import zipfile @@ -109,10 +109,10 @@ def port_num(com): class Settings: - VER = '3.2' + VER = '3.3' SOC_TIMEOUT = 15 REPORT_TIME = 120 - AVR_TIMEOUT = 7 # diff 16 * 100 / 258 h/s = 6.2 s + AVR_TIMEOUT = 10 BAUDRATE = 115200 DATA_DIR = "Duino-Coin AVR Miner " + str(VER) SEPARATOR = "," @@ -182,7 +182,6 @@ def check_updates(): "avr_timeout": float(config["AVR Miner"]["avr_timeout"]), "discord_presence": config["AVR Miner"]["discord_presence"], "periodic_report": int(config["AVR Miner"]["periodic_report"]), - "shuffle_ports": config["AVR Miner"]["shuffle_ports"], "mining_key": config["AVR Miner"]["mining_key"] } @@ -271,14 +270,14 @@ def check_mining_key(user_settings): user_settings = user_settings["AVR Miner"] if user_settings["mining_key"] != "None": - key = b64.b64decode(user_settings["mining_key"]).decode('utf-8') + key = "&k=" + b64.b64decode(user_settings["mining_key"]).decode('utf-8') else: key = '' response = requests.get( "https://server.duinocoin.com/mining_key" + "?u=" + user_settings["username"] - + "&k=" + key, + + key, timeout=10 ).json() @@ -463,7 +462,6 @@ def start(donation_level): hashrate_mean = [] ping_mean = [] diff = 0 -shuffle_ports = "y" donator_running = False job = '' debug = 'n' @@ -623,7 +621,6 @@ def load_config(): global debug global rig_identifier global discord_presence - global shuffle_ports global SOC_TIMEOUT if not Path(str(Settings.DATA_DIR) + '/Settings.cfg').is_file(): @@ -733,10 +730,9 @@ def load_config(): 'identifier': rig_identifier, 'debug': 'n', "soc_timeout": 45, - "avr_timeout": 7, + "avr_timeout": 10, "discord_presence": "y", "periodic_report": 60, - "shuffle_ports": "y", "mining_key": mining_key} with open(str(Settings.DATA_DIR) @@ -758,7 +754,6 @@ def load_config(): Settings.SOC_TIMEOUT = int(config["AVR Miner"]["soc_timeout"]) Settings.AVR_TIMEOUT = float(config["AVR Miner"]["avr_timeout"]) discord_presence = config["AVR Miner"]["discord_presence"] - shuffle_ports = config["AVR Miner"]["shuffle_ports"] Settings.REPORT_TIME = int(config["AVR Miner"]["periodic_report"]) hashrate_list = [0] * len(avrport) @@ -961,13 +956,14 @@ def mine_avr(com, threadid, fastest_pool): try: ser.close() pretty_print('sys' + port_num(com), - f"Closed COM port {com}", 'success') + f"No response from the board. Closed port {com}", + 'success') sleep(2) except: pass try: ser = Serial(com, baudrate=int(Settings.BAUDRATE), - timeout=float(Settings.AVR_TIMEOUT)) + timeout=int(Settings.AVR_TIMEOUT)) """ Sleep after opening the port to make sure the board resets properly after @@ -1039,9 +1035,58 @@ def mine_avr(com, threadid, fastest_pool): + get_string('mining_algorithm') + str(com) + ')', 'success') + # Perform a hash test to assign the starting diff + prev_hash = "ba29a15896fd2d792d5c4b60668bf2b9feebc51d" + exp_hash = "d0beba883d7e8cd119ea2b0e09b78f60f29e0968" + exp_result = 50 while True: try: + debug_output(com + ': Sending hash test to the board') + ser.write(bytes(str(prev_hash + + Settings.SEPARATOR + + exp_hash + + Settings.SEPARATOR + + "10" + + Settings.SEPARATOR), + encoding=Settings.ENCODING)) + debug_output(com + ': Reading hash test from the board') + result = ser.read_until(b'\n').decode().strip().split(',') + ser.flush() + + if result[0] and result[1]: + _ = int(result[0], 2) + debug_output(com + f': Result: {result[0]}') + else: + raise Exception("No data received from the board") + if int(result[0], 2) != exp_result: + raise Exception(com + f': Incorrect result received!') + + computetime = round(int(result[1], 2) / 1000000, 5) + num_res = int(result[0], 2) + hashrate_test = round(num_res / computetime, 2) + break + except Exception as e: + debug_output(str(e)) + + start_diff = "AVR" + if hashrate_test > 5500: + start_diff = "ESP8266" + elif hashrate_test > 3000: + start_diff = "DUE" + elif hashrate_test > 1000: + start_diff = "ARM" + elif hashrate_test > 300: + start_diff = "MEGA" + + pretty_print('sys' + port_num(com), + get_string('hashrate_test') + + get_prefix("H/s", hashrate_test, 2) + + Fore.RESET + + get_string('hashrate_test_diff') + + start_diff) + while True: + try: if config["AVR Miner"]["mining_key"] != "None": key = b64.b64decode(config["AVR Miner"]["mining_key"]).decode() else: @@ -1052,7 +1097,7 @@ def mine_avr(com, threadid, fastest_pool): + Settings.SEPARATOR + str(username) + Settings.SEPARATOR - + 'AVR' + + start_diff + Settings.SEPARATOR + str(key) ) @@ -1089,7 +1134,6 @@ def mine_avr(com, threadid, fastest_pool): encoding=Settings.ENCODING)) debug_output(com + ': Reading result from the board') result = ser.read_until(b'\n').decode().strip().split(',') - ser.flush() if result[0] and result[1]: _ = int(result[0], 2) @@ -1099,6 +1143,7 @@ def mine_avr(com, threadid, fastest_pool): raise Exception("No data received from AVR") except Exception as e: debug_output(com + f': Retrying data read: {e}') + ser.flush() retry_counter += 1 continue @@ -1106,7 +1151,7 @@ def mine_avr(com, threadid, fastest_pool): break try: - computetime = round(int(result[1], 2) / 1000000, 3) + computetime = round(int(result[1], 2) / 1000000, 5) num_res = int(result[0], 2) hashrate_t = round(num_res / computetime, 2) diff --git a/ESP32_Code/ESP32_Code.ino b/ESP32_Code/ESP32_Code.ino index c03684ef..0bff7a0d 100644 --- a/ESP32_Code/ESP32_Code.ino +++ b/ESP32_Code/ESP32_Code.ino @@ -3,7 +3,7 @@ ( _ \( )( )(_ _)( \( )( _ )___ / __)( _ )(_ _)( \( ) )(_) ))(__)( _)(_ ) ( )(_)((___)( (__ )(_)( _)(_ ) ( (____/(______)(____)(_)\_)(_____) \___)(_____)(____)(_)\_) - Official code for ESP32 boards version 3.18 + Official code for ESP32 boards version 3.3 Duino-Coin Team & Community 2019-2022 © MIT Licensed https://duinocoin.com @@ -15,9 +15,9 @@ /***************** START OF MINER CONFIGURATION SECTION *****************/ // Change the part in brackets to your WiFi name -const char *SSID = "My cool Wi-Fi"; +const char *SSID = "my_cool_wifi"; // Change the part in brackets to your WiFi password -const char *WIFI_PASS = "My secret pass"; +const char *WIFI_PASS = "my_wifi_password"; // Change the part in brackets to your Duino-Coin username const char *DUCO_USER = "my_cool_username"; // Change the part in brackets if you want to set a custom miner name (use Auto to autogenerate, None for no name) @@ -47,7 +47,6 @@ const char* MINER_KEY = "None"; Adafruit_AHTX0 aht; #endif -#define BLINK_SHARE_FOUND 1 #define BLINK_SETUP_COMPLETE 2 #define BLINK_CLIENT_CONNECT 3 #define BLINK_RESET_DEVICE 5 @@ -76,9 +75,12 @@ const int mqtt_port = 1883; /* If you're using the ESP32-CAM board or other board that doesn't support OTA (Over-The-Air programming) comment the ENABLE_OTA definition line (#define ENABLE_OTA) - NOTE: enabling OTA support could decrease hashrate (up to 40%) */ + NOTE: enabling OTA support may decrease the hashrate */ // #define ENABLE_OTA +/* If you don't want to use the web dashboard comment the line below */ +#define WEB_DASHBOARD + /* If you don't want to use the Serial interface comment the ENABLE_SERIAL definition line (#define ENABLE_SERIAL)*/ #define ENABLE_SERIAL @@ -155,7 +157,7 @@ SemaphoreHandle_t xMutex; const char * DEVICE = "ESP32"; const char * POOLPICKER_URL[] = {"https://server.duinocoin.com/getPool"}; const char * MINER_BANNER = "Official ESP32 Miner"; -const char * MINER_VER = "3.18"; +const char * MINER_VER = "3.3"; String pool_name = ""; String host = ""; String node_id = ""; @@ -469,11 +471,13 @@ void WiFireconnect(void *pvParameters) { for (;;) { wifi_state = WiFi.status(); -#ifdef ENABLE_OTA - ArduinoOTA.handle(); -#endif - - server.handleClient(); + #ifdef ENABLE_OTA + ArduinoOTA.handle(); + #endif + + #ifdef WEB_DASHBOARD + server.handleClient(); + #endif if (ota_state) // If OTA is working, reset the watchdog esp_task_wdt_reset(); @@ -491,17 +495,19 @@ void WiFireconnect(void *pvParameters) { Serial.println("Rig name: " + String(RIG_IDENTIFIER)); Serial.println(); - if (!MDNS.begin(RIG_IDENTIFIER)) { - Serial.println("mDNS unavailable"); - } - MDNS.addService("http", "tcp", 80); - Serial.print("Configured mDNS for dashboard on http://" - + String(RIG_IDENTIFIER) - + ".local (or http://" - + WiFi.localIP().toString() - + ")"); - server.on("/", dashboard); - server.begin(); + #ifdef WEB_DASHBOARD + if (!MDNS.begin(RIG_IDENTIFIER)) { + Serial.println("mDNS unavailable"); + } + MDNS.addService("http", "tcp", 80); + Serial.print("Configured mDNS for dashboard on http://" + + String(RIG_IDENTIFIER) + + ".local (or http://" + + WiFi.localIP().toString() + + ")"); + server.on("/", dashboard); + server.begin(); + #endif // Notify Setup Complete blink(BLINK_SETUP_COMPLETE);// Sucessfull connection with wifi network @@ -700,6 +706,7 @@ void TaskMining(void *pvParameters) { bool ignoreHashrate = false; // Try to find the nonce which creates the expected hash + digitalWrite(LED_BUILTIN, HIGH); for (unsigned long nonceCalc = 0; nonceCalc <= TaskThreadData[taskId].difficulty; nonceCalc++) { // Define hash under Test hashUnderTest = previousHash + String(nonceCalc); @@ -716,12 +723,13 @@ void TaskMining(void *pvParameters) { // Check if we have found the nonce for the expected hash if ( memcmp( shaResult, expectedHashBytes, sizeof(shaResult) ) == 0 ) { - // Found the nonce submit it to the server - Serial.println(String(taskCoreName + " found a correct hash using nonce: " + nonceCalc )); - + // Found the nonce - submit it to the server + digitalWrite(LED_BUILTIN, LOW); + // Calculate mining time float elapsedTime = (micros() - startTime) / 1000.0 / 1000.0; // Total elapsed time in seconds TaskThreadData[taskId].hashrate = nonceCalc / elapsedTime; + Serial.println(String(taskCoreName + " found a correct hash (" + elapsedTime + "s)")); // Validate connection if (!jobClient.connected()) { @@ -757,20 +765,9 @@ void TaskMining(void *pvParameters) { TaskThreadData[taskId].shares++; if (LED_BLINKING) digitalWrite(LED_BUILTIN, HIGH); - // Validate Hashrate - if ( TaskThreadData[taskId].hashrate < 4000 && !ignoreHashrate) { - // Hashrate is low so restart esp - Serial.println(String(taskCoreName + " has low hashrate: " + (TaskThreadData[taskId].hashrate / 1000) + "kH/s, job feedback: " + feedback + " - restarting...")); - jobClient.flush(); - jobClient.stop(); - blink(BLINK_RESET_DEVICE); - esp_restart(); - } - else { - // Print statistics - Serial.println(String(taskCoreName + " retrieved job feedback: " + feedback + ", hashrate: " + (TaskThreadData[taskId].hashrate / 1000) + "kH/s, share #" + TaskThreadData[taskId].shares)); - } - + // Print statistics + Serial.println(String(taskCoreName + " retrieved job feedback: " + feedback + ", hashrate: " + (TaskThreadData[taskId].hashrate / 1000) + "kH/s, share #" + TaskThreadData[taskId].shares)); + // Stop current loop and ask for a new job break; } diff --git a/ESP8266_Code/ESP8266_Code.ino b/ESP8266_Code/ESP8266_Code.ino index a5cd0d8a..417ce91e 100644 --- a/ESP8266_Code/ESP8266_Code.ino +++ b/ESP8266_Code/ESP8266_Code.ino @@ -3,7 +3,7 @@ ( _ \( )( )(_ _)( \( )( _ )___ / __)( _ )(_ _)( \( ) )(_) ))(__)( _)(_ ) ( )(_)((___)( (__ )(_)( _)(_ ) ( (____/(______)(____)(_)\_)(_____) \___)(_____)(____)(_)\_) - Official code for ESP8266 boards version 3.18 + Official code for ESP8266 boards version 3.3 Duino-Coin Team & Community 2019-2022 © MIT Licensed https://duinocoin.com @@ -135,22 +135,22 @@ namespace { // Change the part in brackets to your WiFi name - const char *SSID = "My cool wifi name"; + const char *SSID = "my_cool_wifi"; // Change the part in brackets to your WiFi password - const char *PASSWORD = "My secret wifi pass"; + const char *PASSWORD = "my_wifi_password"; // Change the part in brackets to your Duino-Coin username const char *USERNAME = "my_cool_username"; // Change the part in brackets if you want to set a custom miner name (use Auto to autogenerate, None for no name) const char *RIG_IDENTIFIER = "None"; - // Change the part in brackets to your mining key (if you enabled it in the wallet) + // Change the part in brackets to your mining key (if you have enabled it in the wallet) const char *MINER_KEY = "None"; - // Change false to true if using 160 MHz clock mode to not get the first share rejected - const bool USE_HIGHER_DIFF = false; - // Change true to false if you don't want to host the dashboard page - const bool WEB_DASHBOARD = true; - // Change false to true if you want to update hashrate in browser without reloading page + // Set to true to use the 160 MHz overclock mode (and not get the first share rejected) + const bool USE_HIGHER_DIFF = true; + // Set to true if you want to host the dashboard page (available on ESPs IP address) + const bool WEB_DASHBOARD = false; + // Set to true if you want to update hashrate in browser without reloading the page const bool WEB_HASH_UPDATER = false; - // Change true to false if you want to disable led blinking(But the LED will work in the beginning until esp connects to the pool) + // Set to false if you want to disable the onboard led blinking when finding shares const bool LED_BLINKING = true; /* Do not change the lines below. These lines are static and dynamic variables @@ -158,7 +158,7 @@ namespace const char * DEVICE = "ESP8266"; const char * POOLPICKER_URL[] = {"https://server.duinocoin.com/getPool"}; const char * MINER_BANNER = "Official ESP8266 Miner"; -const char * MINER_VER = "3.18"; +const char * MINER_VER = "3.3"; unsigned int share_count = 0; unsigned int port = 0; unsigned int difficulty = 0; @@ -413,7 +413,7 @@ String START_DIFF = ""; // Loop WDT... please don't feed me... // See lwdtcb() and lwdtFeed() below Ticker lwdTimer; -#define LWD_TIMEOUT 60000 +#define LWD_TIMEOUT 20000 unsigned long lwdCurrentMillis = 0; unsigned long lwdTimeOutMillis = LWD_TIMEOUT; @@ -423,7 +423,6 @@ unsigned long lwdTimeOutMillis = LWD_TIMEOUT; #define LED_BUILTIN 2 -#define BLINK_SHARE_FOUND 1 #define BLINK_SETUP_COMPLETE 2 #define BLINK_CLIENT_CONNECT 3 #define BLINK_RESET_DEVICE 5 @@ -484,6 +483,8 @@ void blink(uint8_t count, uint8_t pin = LED_BUILTIN) { digitalWrite(pin, state ^= HIGH); delay(50); } + } else { + digitalWrite(LED_BUILTIN, HIGH); } } @@ -554,7 +555,7 @@ void ConnectToServer() { return; Serial.println("\n\nConnecting to the Duino-Coin server..."); - while (!client.connect(host, port)); + while (!client.connect(host.c_str(), port)); waitForClientData(); Serial.println("Connected to the server. Server version: " + client_buffer ); @@ -625,8 +626,8 @@ void setup() { lwdtFeed(); lwdTimer.attach_ms(LWD_TIMEOUT, lwdtcb); - if (USE_HIGHER_DIFF) START_DIFF = "ESP8266H"; - else START_DIFF = "ESP8266"; + if (USE_HIGHER_DIFF) START_DIFF = "ESP8266NH"; + else START_DIFF = "ESP8266N"; if(WEB_DASHBOARD) { if (!MDNS.begin(RIG_IDENTIFIER)) { @@ -700,12 +701,18 @@ void loop() { waitForClientData(); String last_block_hash = getValue(client_buffer, SEP_TOKEN, 0); - String expected_hash = getValue(client_buffer, SEP_TOKEN, 1); + String expected_hash_str = getValue(client_buffer, SEP_TOKEN, 1); difficulty = getValue(client_buffer, SEP_TOKEN, 2).toInt() * 100 + 1; - int job_len = last_block_hash.length() + expected_hash.length() + String(difficulty).length(); - Serial.println("Received job with size of " + String(job_len) + " bytes"); - expected_hash.toUpperCase(); + if (USE_HIGHER_DIFF) system_update_cpu_freq(160); + + int job_len = last_block_hash.length() + expected_hash_str.length() + String(difficulty).length(); + + Serial.println("Received job with size of " + String(job_len) + " bytes: " + last_block_hash + " " + expected_hash_str + " " + difficulty); + + uint8_t expected_hash[20]; + experimental::TypeConversion::hexStringToUint8Array(expected_hash_str, expected_hash, 20); + br_sha1_init(&sha1_ctx_base); br_sha1_update(&sha1_ctx_base, last_block_hash.c_str(), last_block_hash.length()); @@ -713,21 +720,22 @@ void loop() { max_micros_elapsed(start_time, 0); String result = ""; - digitalWrite(LED_BUILTIN, HIGH); + if (LED_BLINKING) digitalWrite(LED_BUILTIN, LOW); for (unsigned int duco_numeric_result = 0; duco_numeric_result < difficulty; duco_numeric_result++) { // Difficulty loop sha1_ctx = sha1_ctx_base; duco_numeric_result_str = String(duco_numeric_result); + br_sha1_update(&sha1_ctx, duco_numeric_result_str.c_str(), duco_numeric_result_str.length()); br_sha1_out(&sha1_ctx, hashArray); - result = experimental::TypeConversion::uint8ArrayToHexString(hashArray, 20); - if (result == expected_hash) { + + if (memcmp(expected_hash, hashArray, 20) == 0) { // If result is found + if (LED_BLINKING) digitalWrite(LED_BUILTIN, HIGH); unsigned long elapsed_time = micros() - start_time; float elapsed_time_s = elapsed_time * .000001f; hashrate = duco_numeric_result / elapsed_time_s; share_count++; - blink(BLINK_SHARE_FOUND); client.print(String(duco_numeric_result) + "," + String(hashrate) @@ -756,8 +764,5 @@ void loop() { if (max_micros_elapsed(micros(), 500000)) { handleSystemEvents(); } - else { - delay(0); - } } } diff --git a/PC_Miner.py b/PC_Miner.py index 1a30d10f..f3da8505 100644 --- a/PC_Miner.py +++ b/PC_Miner.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Duino-Coin Official PC Miner 3.2 © MIT licensed +Duino-Coin Official PC Miner 3.3 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2022 @@ -136,7 +136,7 @@ class Settings: """ ENCODING = "UTF8" SEPARATOR = "," - VER = 3.2 + VER = 3.3 DATA_DIR = "Duino-Coin PC Miner " + str(VER) TRANSLATIONS = ("https://raw.githubusercontent.com/" + "revoxhere/" @@ -648,14 +648,14 @@ def get_string(string_name): def check_mining_key(user_settings): if user_settings["mining_key"] != "None": - key = b64.b64decode(user_settings["mining_key"]).decode('utf-8') + key = '&k=' + b64.b64decode(user_settings["mining_key"]).decode('utf-8') else: key = '' response = requests.get( "https://server.duinocoin.com/mining_key" + "?u=" + user_settings["username"] - + "&k=" + key, + + key, timeout=Settings.SOC_TIMEOUT ).json() @@ -676,6 +676,7 @@ def check_mining_key(user_settings): pretty_print(get_string("mining_key_required"), "warning") mining_key = input("\t\t" + get_string("ask_mining_key") + Style.BRIGHT + Fore.YELLOW) + if mining_key == "": mining_key = "None" #replace empty input with "None" key user_settings["mining_key"] = b64.b64encode( mining_key.encode("utf-8")).decode('utf-8') configparser["PC Miner"] = user_settings @@ -691,6 +692,7 @@ def check_mining_key(user_settings): retry = input(get_string("key_retry")) if not retry or retry == "y" or retry == "Y": mining_key = input(get_string("ask_mining_key")) + if mining_key == "": mining_key = "None" #replace empty input with "None" key user_settings["mining_key"] = b64.b64encode( mining_key.encode("utf-8")).decode('utf-8') configparser["PC Miner"] = user_settings @@ -1215,7 +1217,6 @@ def init(): + "How-to-compile-fasthash-accelerations\n" + f"(Libducohash couldn't be loaded: {str(e)})" ).replace("\n", "\n\t\t"), 'warning', 'sys0') - sleep(15) def load(): if os.name == 'nt': @@ -1248,7 +1249,6 @@ def load(): + "How-to-compile-fasthash-accelerations\n" + f"(Invalid processor architecture: {osprocessor()})" ).replace("\n", "\n\t\t"), 'warning', 'sys0') - sleep(15) return if not Path("libducohasher.so").is_file(): pretty_print(get_string("fasthash_download"), "info") @@ -1264,7 +1264,6 @@ def load(): + "How-to-compile-fasthash-accelerations\n" + f"(Invalid OS: {os.name})" ).replace("\n", "\n\t\t"), 'warning', 'sys0') - sleep(15) return diff --git a/README.md b/README.md index c325d55f..3e8e78f5 100644 --- a/README.md +++ b/README.md @@ -79,10 +79,7 @@ There are no dependencies required. If you need help, you can take a look at the official getting started guides located on the official website.
FAQ and troubleshooting help can be found in the [Wikis](https://github.com/revoxhere/duino-coin/wiki).
- -### Manual installation - -#### Linux +#### Linux (manual installation) ```BASH sudo apt update @@ -94,7 +91,7 @@ python3 -m pip install -r requirements.txt # Install pip dependencies After doing this, you are good to go with launching the software (e.g. `python3 PC_Miner.py`). -#### Windows +#### Windows (manual installation) 1. Download and install [Python 3](https://www.python.org/downloads/) (make sure you add Python and Pip to your PATH) 2. Download [the Duino-Coin repository](https://github.com/revoxhere/duino-coin/archive/master.zip) @@ -103,27 +100,17 @@ After doing this, you are good to go with launching the software (e.g. `python3 After doing this, you are good to go with launching the software (just double click on desired `.py` files or type `py PC_Miner.py` in the command prompt). -### Automatic installation - -#### Raspberry Pi - -Note: If this script doesn't work try installing manually. +#### Raspberry Pi (automatic installation) ```BASH -# Download the script file wget https://raw.githubusercontent.com/revoxhere/duino-coin/master/Tools/duco-install-rpi.sh - -# Change the file permissions sudo chmod a+x duco-install-rpi.sh - -# Run the script ./duco-install-rpi.sh ``` -## DUCO & wDUCO - -Duino-Coin is a hybrid currency, meaning that it can be converted to wDUCO which is DUCO wrapped on the [Tron](https://tron.network) network (as a token). Currently there aren't many uses for it, other than just storing funds in an external wallet or exchanging wDUCO to another token on JustSwap. A tutorial on using wDUCO is available in the [wDUCO wiki](https://github.com/revoxhere/duino-coin/wiki/wDUCO-tutorial). +## DUCO, wDUCO, bscDUCO, maticDUCO & celoDUCO +Duino-Coin is a hybrid currency providing support both to centralized and decentralized ways of storing funds. Duino-Coins can be converted to wDUCO, bscDUCO or others which are the same Duino-Coins but "wrapped" (stored) on other networks as tokens. An example tutorial on using wDUCO is available in the [wDUCO wiki](https://github.com/revoxhere/duino-coin/wiki/wDUCO-tutorial). Coins can be wrapped directly from your web Wallet - click the Wrap Coins button to start. ## Development @@ -143,50 +130,44 @@ Server source code, documentation for API calls and official libraries for devel ## Benchmarks of officially tested devices and boards -
- - Since that table is getting really long, it's collapsed by default. Click this text to expand it! - - - ### Please note that the rewards depend on a lot of factors and the table below is just for orientation purposes. +### Please note that the rewards depend on a lot of factors and the table below is just for orientation purposes. | Device/CPU/SBC/MCU/chip | Average hashrate
(all threads) | Mining
threads | Power
usage | Average
DUCO/day | |-----------------------------------------------------------|-----------------------------------|-------------------|----------------|---------------------| - | Arduino Pro Mini, Uno, Nano etc.
(Atmega 328p/pb/16u2) | 258 H/s | 1 | 0.2 W | 10-13 | - | Teensy 4.1 (soft cryptography) | 80 kH/s | 1 | 0.5 W | - | + | Arduino Pro Mini, Uno, Nano etc.
(Atmega 328p/pb/16u2) | 258 H/s | 1 | 0.2 W | 15-20 | + | Raspberry Pi Pico | 5 kH/s | 1 | 0.3 W | 10 | + | Teensy 4.1 (soft cryptography) | 80 kH/s | 1 | 0.5 W | ? | | NodeMCU, Wemos D1 etc.
(ESP8266) | 9-10 kH/s (160MHz) 5 kH/s (80Mhz) | 1 | 0.6 W | 3-6 | | ESP32 | 40-42 kH/s | 2 | 1 W | 6-9 | - | Raspberry Pi Zero | 18 kH/s | 1 | 1.1 W | - | - | Raspberry Pi 3 | 440 kH/s | 4 | 5.1 W | 4-5 | - | Raspberry Pi 4 | 740 kH/s (32bit) | 4 | 6.4 W | 10 | - | ODROID XU4 | 1.0 MH/s | 8 | 5 W | 9 | - | Atomic Pi | 690 kH/s | 4 | 6 W | - | - | Orange Pi Zero 2 | 740 kH/s | 4 | 2.55 W | - | - | Khadas Vim 2 Pro | 1.12 MH/s | 8 | 6.2 W | - | - | Libre Computers Tritium H5CC | 480 kH/s | 4 | 5 W | - | - | Libre Computers Le Potato | 410 kH/s | 4 | 5 W | - | - | Pine64 ROCK64 | 640 kH/s | 4 | 5 W | - | - | Intel Celeron G1840 | 1.25 MH/s | 2 | - | 3.3 | - | Intel Core i5-2430M | 1.18 MH/s | 4 | - | 6.5 | - | Intel Core i5-3230M | 1.52 MH/s | 4 | - | 7.2 | - | Intel Core i5-5350U | 1.35 MH/s | 4 | - | 6.0 | - | Intel Core i5-7200U | 1.62 MH/s | 4 | - | 7.5 | - | Intel Core i5-8300H | 3.67 MH/s | 8 | - | 9.1 | - | Intel Core i3-4130 | 1.45 MH/s | 4 | - | 3.7 | - | AMD Ryzen 5 2600 | 4.9 MH/s | 12 | 67 W | 15.44 | - - All tests were performed using the DUCO-S1 algorithm **without fasthash accelerations**. This table will be actively updated. -
+ | Raspberry Pi Zero | 18 kH/s | 1 | 1.1 W | ? | + | Raspberry Pi 3 **(32bit)** | 440 kH/s | 4 | 5.1 W | 4-5 | + | Raspberry Pi 4 **(32bit)** | 740 kH/s | 4 | 6.4 W | ? | + | Raspberry Pi 4 **(64bit, fasthash)** | 6.8 MH/s | 4 | 6.4 W | 5 | + | ODROID XU4 | 1.0 MH/s | 8 | 5 W | 6 | + | Atomic Pi | 690 kH/s | 4 | 6 W | ? | + | Orange Pi Zero 2 | 740 kH/s | 4 | 2.55 W | ? | + | Khadas Vim 2 Pro | 1.12 MH/s | 8 | 6.2 W | ? | + | Libre Computers Tritium H5CC | 480 kH/s | 4 | 5 W | ? | + | Libre Computers Le Potato | 410 kH/s | 4 | 5 W | ? | + | Pine64 ROCK64 | 640 kH/s | 4 | 5 W | ? | + | Intel Celeron G1840 | 1.25 MH/s | 2 | 53 W | 3.3 | + | Intel Core i5-2430M | 1.18 MH/s | 4 | 35 W | 6.5 | + | Intel Core i5-3230M | 1.52 MH/s | 4 | 35 W | 7.2 | + | Intel Core i5-5350U | 1.35 MH/s | 4 | 15 W | 6.0 | + | Intel Core i5-7200U | 1.62 MH/s | 4 | 15 W | 7.5 | + | Intel Core i5-8300H | 3.67 MH/s | 8 | 45 W | 9.1 | + | Intel Core i3-4130 | 1.45 MH/s | 4 | 54 W | 3.7 | + | AMD Ryzen 5 2600 | 4.9 MH/s | 12 | 65 W | 15.44 | + | AMD Ryzen R1505G **(fasthash)** | 8.5 MH/s | 4 | 35 W | - | + | Intel Core i7-11370H **(fasthash)** | 17.3 MH/s | 8 | 35 W | 4.28 | + +All tests were performed using the DUCO-S1 algorithm **without fasthash accelerations** unless stated otherwise. This table will be actively updated. + ## Community-made softwares -
- - Since that list is getting really long, it's collapsed by default. Click this text to expand it - - - Please note that these softwares are not developed by us and we do not give any guarantees that use of them will not result in an account getting banned. Treat them as a curiosity. It's worth noting that using [nonceMiner](https://github.com/colonelwatch/nonceMiner) by colonelwatch **will get you banned**. +### Please note that these softwares are not developed by us and we do not give any guarantees that use of them will not result in an account getting banned. Treat them as a curiosity. ### Other miners known to work with Duino-Coin: * [DuinoCoinEthernetMiner](https://github.com/Pumafron/DuinoCoinEthernetMiner) - Arduino Ethernet shield Miner by Pumafron @@ -230,8 +211,7 @@ Server source code, documentation for API calls and official libraries for devel * [DuCoWallet](https://github.com/viktor02/DuCoWallet) GUI Wallet by viktor02 * [Duco-widget-ios](https://github.com/naphob/duco-widget-ios) - a Duino-Coin iOS widget by Naphob - You may also view a similar list on the [website](https://duinocoin.com/apps). -
+ You may also view a similar list on the [website](https://duinocoin.com/apps). ## License diff --git a/Resources/AVR_Miner_langs.json b/Resources/AVR_Miner_langs.json index edc0e3b7..64f664a1 100644 --- a/Resources/AVR_Miner_langs.json +++ b/Resources/AVR_Miner_langs.json @@ -89,7 +89,9 @@ "incorrect_username": "The username you provided doesn't exist!", "system_threads_notice": "Warning: you're trying to use more threads than you have.\n\t\tThis will cause unintended side effects such as your system becoming unresponsive.\n\t\tStarting in 10s", "using_config": "Config file: ", - "motd": "Server message of the day: " + "motd": "Server message of the day: ", + "hashrate_test": "Hashrate test ended with ", + "hashrate_test_diff": ", assigned starting difficulty: " }, "indonesian": { "translation_autor": "rezafauzan945", @@ -235,7 +237,7 @@ "retrying": " Zkusím to znovu za 10s", "mining_user": " Uživatel ", "mining_not_exist": " neexistuje.", - "mining_not_exist_warning": " Ujisti se, že jsi zadal uživatelské jméno správně. Zkontroluj prosím soubor konfigurace. Zkusím to znovu za 10s", + "mining_not_exist_warning": " Ujisti se, že jsi zadal uživatelské jméno správně. Zkontroluj prosím soubor konfigurace. Zkusím to znovu za 10 sekund", "load_config_error": " Chyba při načítání konfiguračního souboru (", "load_config_error_warning": "/Miner_config.cfg). Zkus ho odstranit a program spustit znovu. Zavírám za 10s", "connection_search": "Hledám nejrychlejší těžební uzel", @@ -258,8 +260,17 @@ "node_picker_unavailable": "Výběrčí uzlů nejspíš nedopovídá tak, jak by měl - zkusím to znovu za ", "node_picker_error": "Fatální chyba při získávání serveru od výběrčího uzlů - zkusím to znovu za ", "connecting_node": " Získaný těžební uzel: ", - "new_version": "A new version is available, you want to update miner [Y/n] ? ", - "updating": "The miner is outdated. Updating...." + "new_version": "Je dostupná nová verze programu. Chceš ho hned teď aktualizovat [Y/n] ? ", + "updating": "Těžící program je zastaralý. Instaluji aktualizaci....", + "ask_mining_key": "Zadej svůj těžební klíč (jen pokud sis ho dříve nastavil ve webové peněžence - stiskni enter k přeskočení): ", + "mining_key_required": "Těžební klíč je nutný pro těžbu na tomto účtě", + "invalid_mining_key": "Zadaný těžební klíč není správný", + "incorrect_username": "Zadané uživatelské jméno neexistuje", + "system_threads_notice": "Varování: pokoušíš se k těžbě využít více jader, než které máš ve své těžební desce.\n\t\tTento krok způsobí nežádoucí efekty jako neresponzivnost systému.\n\t\tTěžba začne za 10s", + "using_config": "Konfigurační soubor: ", + "motd": "Serverová zpráva dne: ", + "hashrate_test": "Test hashratu skončil s výsledkem ", + "hashrate_test_diff": ", systém přiřadil těžební obtížnost: " }, "korean": { "translation_autor": "hotmoist, roroxxn, hj-k66 ", diff --git a/Resources/README_TRANSLATIONS/README_es_LATAM.md b/Resources/README_TRANSLATIONS/README_es_LATAM.md index b0671eed..df58d37c 100644 --- a/Resources/README_TRANSLATIONS/README_es_LATAM.md +++ b/Resources/README_TRANSLATIONS/README_es_LATAM.md @@ -75,7 +75,7 @@ #### La forma fácil para comenzar con Duino-Coin es descargar [la ultima versión](https://github.com/revoxhere/duino-coin/releases/latest) para tu Sistema Operativo (SO). -Después de descargar la versión, extráe y ejecuta el programa deseado.
+Después de descargar la versión, extrae y ejecuta el programa deseado.
No hay dependencias extras requeridas. Si necesitas ayuda, puedes mirar las guías oficiales para comenzar en el sitio web oficial.
@@ -110,7 +110,7 @@ Luego de hacer esto, ya puedes ejecutar el programa deseado (haciendo doble clic #### Raspberry Pi -Nota: Si este script no funciona instenta instalarlo manualmente. +Nota: Si este script no funciona intenta instalarlo manualmente. ```BASH # Descarga el script @@ -264,23 +264,23 @@ Algunos archivos de terceros incluídos pueden tener distintas licencias - por f ## Políticas de Privacidad 1. En el servidor maestro solo son guardados nombres de usuarios, contraseñas encryptadas (con la ayuda de bcrypt) y e-mails de los usuarios así como la información de su cuenta.
2. Los e-mails no son disponibles públicamente y son solo utilizados para contactar al usuario cuando es necesario, confirmar intercambios en DUCO-Exchange y recibir un boletín informativo ocasional (planeado para el futuro).
-3. Balances, transacciones e información relacionada al minado está totalmente disponible para el público JSON APIs.
+3. Balances, transacciones e información relacionada al minado está totalmente disponible para el público API JSON.
4. La política de privacidad puede ser cambiada en el futuro con notificación previa. ## Mantenedores activos del proyecto -* [@revoxhere](https://github.com/revoxhere/) - robik123.345@gmail.com (Python dev Jefe, fundador del proyecto) -* [@Bilaboz](https://github.com/bilaboz/) (NodeJS dev Jefe) -* [@connorhess](https://github.com/connorhess) (Python dev Jefe, Dueño de Node-S) -* [@JoyBed](https://github.com/JoyBed) (AVR dev Jefe) +* [@revoxhere](https://github.com/revoxhere/) - robik123.345@gmail.com (Desarrollador jefe en Python, fundador del proyecto) +* [@Bilaboz](https://github.com/bilaboz/) (Desarrollador jefe en NodeJS) +* [@connorhess](https://github.com/connorhess) (Desarrollador jefe en python, Dueño de Node-S) +* [@JoyBed](https://github.com/JoyBed) (Desarrollador jefe de AVR) * [@Yennefer](https://www.instagram.com/vlegle/) (Manager Social Jefe) * [@Tech1k](https://github.com/Tech1k/) - kristian@beyondcoin.io (Webmaster Jefe y Desarrollador de DUCO) -* [@ygboucherk](https://github.com/ygboucherk) ([wDUCO](https://github.com/ygboucherk/wrapped-duino-coin-v2) dev) -* [@Lulaschkas](https://github.com/Lulaschkas) (Dev) -* [@joaquinbvw](https://github.com/joaquinbvw) (AVR dev) +* [@ygboucherk](https://github.com/ygboucherk) (Desarrollador de [wDUCO](https://github.com/ygboucherk/wrapped-duino-coin-v2)) +* [@Lulaschkas](https://github.com/Lulaschkas) (Desarrollador) +* [@joaquinbvw](https://github.com/joaquinbvw) (Desarrollador de AVR) -Grandes gracias a todos los [contribuyentes](https://github.com/revoxhere/duino-coin/graphs/contributors) que ayudaron al desarrollo de Duino-Coin. +Muchas gracias a todos los [contribuyentes](https://github.com/revoxhere/duino-coin/graphs/contributors) que han ayudado al desarrollo de Duino-Coin.
diff --git a/Unofficial miners/Minimal_PC_Miner.py b/Unofficial miners/Minimal_PC_Miner.py index 52809ab2..f401bdbd 100644 --- a/Unofficial miners/Minimal_PC_Miner.py +++ b/Unofficial miners/Minimal_PC_Miner.py @@ -9,7 +9,8 @@ from socket import socket import sys # Only python3 included libraries import time -import requests +from urllib.request import Request, urlopen +from json import loads soc = socket() @@ -32,9 +33,7 @@ def current_time(): def fetch_pools(): while True: try: - response = requests.get( - "https://server.duinocoin.com/getPool" - ).json() + response = loads(urlopen(Request("https://server.duinocoin.com/getPool")).read().decode()) NODE_ADDRESS = response["ip"] NODE_PORT = response["port"]