From 1c8971b0385462fe8ac49b4a8e75fcecea877372 Mon Sep 17 00:00:00 2001 From: Daniel Greenberg Date: Mon, 13 Aug 2018 08:43:54 -0400 Subject: [PATCH 1/3] Fixed issue in cryptonight.h file --- cryptonight.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptonight.h b/cryptonight.h index 091efee..526709e 100644 --- a/cryptonight.h +++ b/cryptonight.h @@ -3,7 +3,7 @@ struct cryptonight_ctx; -typedef void (cryptonight_func)(void *output, const void *input, const uint32_t inlen, struct cryptonight_ctx *ctx); +typedef void (cryptonight_func)(void *output, const void *input, const uint32_t inlen, struct cryptonight_ctx *ctx, int variant); cryptonight_func cryptonight_hash_dumb; cryptonight_func cryptonight_hash_aesni; From 5138cffbc8c972d4f8ceab516b55eb54c4a4cef8 Mon Sep 17 00:00:00 2001 From: Daniel Greenberg Date: Sun, 26 Aug 2018 10:27:50 -0400 Subject: [PATCH 2/3] Fixed some small warnings --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 764e3f1..0654931 100644 --- a/main.c +++ b/main.c @@ -632,7 +632,7 @@ int32_t SetupXMRTest(AlgoContext *HashData, OCLPlatform *OCL, uint32_t DeviceIdx Options = (char *)malloc(sizeof(char) * 32); - snprintf(Options, 31, "-I. -DWORKSIZE=%d", LocalThreads); + snprintf(Options, 31, "-I. -DWORKSIZE=%zd", LocalThreads); retval = clBuildProgram(HashData->Program, 1, &OCL->Devices[DeviceIdx].DeviceID, Options, NULL, NULL); @@ -1280,7 +1280,7 @@ void *MinerThreadProc(void *Info) MTInfo->AlgoCtx.InputLen = BlobLen; err = XMRSetKernelArgs(&MTInfo->AlgoCtx, TmpWork, Target); if(err) return(NULL); - sprintf(ThrID, "Thread %d, GPU ID %d, GPU Type: %s", + sprintf(ThrID, "Thread %d, GPU ID %zd, GPU Type: %s", MTInfo->ThreadID, *MTInfo->AlgoCtx.GPUIdxs, MTInfo->PlatformContext->Devices[*MTInfo->AlgoCtx.GPUIdxs].DeviceName); } else { ctx = cryptonight_ctx(); From 5064be31687326d528754929a05befcb2a6f0da5 Mon Sep 17 00:00:00 2001 From: Daniel Greenberg Date: Tue, 28 Aug 2018 14:34:19 -0400 Subject: [PATCH 3/3] Removed config file. New format: ./miner -u [--use-platform-dev|--use-platform-prod] --- main.c | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 0654931..ddde414 100644 --- a/main.c +++ b/main.c @@ -1698,16 +1698,53 @@ int main(int argc, char **argv) unsigned int tmp1, tmp2, tmp3, tmp4; int use_aesni = 0; int daemon = 0; + char* workerId; + char* poolURL; + char* algoName = "CryptoNight"; + char* poolPass = "x"; InitLogging(LOG_INFO); - - if(argc != 2) + + if(argc != 4) { - Log(LOG_CRITICAL, "Usage: %s ", argv[0]); + //Log(LOG_CRITICAL, "Usage: %s ", argv[0]); + Log(LOG_CRITICAL, "Not enough arguments"); return(0); } - - if(ParseConfigurationFile(argv[1], &Settings)) return(0); + + if (strcmp(argv[1],"-u") == 0) { + workerId = argv[2]; + } + + if (strcmp(argv[3], "--use-platform-dev") == 0) { + poolURL = "cn.devspare.io:443"; + } else if (strcmp(argv[3],"--use-platform-prod") == 0) { + poolURL = "cn.spare.io:443"; + } else { + return(0); + } + + Settings.NumGPUs = 1; + Settings.GPUSettings = (DeviceSettings *)malloc(sizeof(DeviceSettings) * Settings.NumGPUs); + Settings.TotalThreads = 2; + Settings.GPUSettings[0].Index = -1; + Settings.GPUSettings[0].rawIntensity = 16; + Settings.GPUSettings[0].Worksize = 16; + Settings.GPUSettings[0].Threads = 2; + Settings.PoolURLs = (char **)malloc(sizeof(char *) * (1 + 1)); + Settings.Workers = (WorkerInfo *)malloc(sizeof(WorkerInfo) * ((1 + 1))); + Settings.PoolCount = 1; + Settings.PoolURLs[0] = (char *)malloc(sizeof(char) * (strlen(poolURL) + 1)); + Settings.Workers[0].User = (char *)malloc(sizeof(char) * (strlen(workerId) + 1)); + Settings.Workers[0].Pass = (char *)malloc(sizeof(char) * (strlen(poolPass) + 1)); + Settings.AlgoName = (char *)malloc(sizeof(char) * (strlen(algoName) + 1)); + //Settings.PoolURLs[0] = poolURL; + Settings.PoolURLs[0] = "pool.supportxmr.com:3333"; + Settings.Workers[0].User = workerId; + Settings.Workers[0].Pass = poolPass; + Settings.Workers[0].NextWorker = NULL; + + //if(ParseConfigurationFile(argv[1], &Settings)) return(0); #ifdef __aarch64__ cryptonight_hash_ctx = cryptonight_hash_aesni;