wip
This commit is contained in:
@@ -12,6 +12,14 @@ pacman -Syu
|
||||
# Install build tools and dependencies
|
||||
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-curl mingw-w64-x86_64-jansson mingw-w64-x86_64-openssl mingw-w64-x86_64-gmp mingw-w64-x86_64-zlib mingw-w64-x86_64-autotools mingw-w64-x86_64-pkg-config
|
||||
```
|
||||
C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw64 -c "pacman -S gcc autotools libcurl-devel mingw-w64-x86_64-curl gmp-devel jansson-devel zlib-devel"
|
||||
C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw64 -c "cd /f/projects/mines/rin/miner/cpuminer/cpuminer-opt-rin && ./configure --with-curl=/mingw64 --host=x86_64-w64-mingw32"
|
||||
C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw64 -c "cd /f/projects/mines/rin/miner/cpuminer/cpuminer-opt-rin && make -j8"
|
||||
|
||||
#
|
||||
C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw64 -c "cd /f/projects/mines/rin/miner/cpuminer/cpuminer-opt-rin && ./configure --with-curl=/mingw64 --host=x86_64-w64-mingw32"
|
||||
|
||||
./cpuminer-rinhash.exe -a rinhash -o stratum+tcp://192.168.0.188:3333 -u username.workername -p x -t 4
|
||||
|
||||
## Build Process
|
||||
|
||||
|
||||
Submodule rin/miner/cpuminer/cpuminer-opt-rin updated: dfbd6b03a6...b80452a98c
@@ -55,7 +55,7 @@ echo.
|
||||
REM Compile with NVCC (enable device linking for dynamic parallelism)
|
||||
nvcc -O3 -rdc=true -arch=sm_50 ^
|
||||
-gencode arch=compute_50,code=sm_50 ^
|
||||
-I. rinhash.cu sha3-256.cu ^
|
||||
-I. rinhash.cu ^
|
||||
-o rinhash-cuda-miner.exe ^
|
||||
-lcuda -lcudart -lcudadevrt
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#include <cuda_runtime.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// External functions from our CUDA implementation
|
||||
extern "C" void RinHash(
|
||||
const uint32_t* version,
|
||||
const uint32_t* prev_block,
|
||||
const uint32_t* merkle_root,
|
||||
const uint32_t* timestamp,
|
||||
const uint32_t* bits,
|
||||
const uint32_t* nonce,
|
||||
uint8_t* output
|
||||
);
|
||||
|
||||
extern "C" void RinHash_mine(
|
||||
const uint32_t* version,
|
||||
const uint32_t* prev_block,
|
||||
const uint32_t* merkle_root,
|
||||
const uint32_t* timestamp,
|
||||
const uint32_t* bits,
|
||||
uint32_t start_nonce,
|
||||
uint32_t num_nonces,
|
||||
uint32_t* found_nonce,
|
||||
uint8_t* target_hash,
|
||||
uint8_t* best_hash
|
||||
);
|
||||
|
||||
void print_hex(const char* label, const uint8_t* data, size_t len) {
|
||||
printf("%s: ", label);
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
printf("%02x", data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
printf("RinHash CUDA Miner Test\n");
|
||||
printf("=======================\n\n");
|
||||
|
||||
// Initialize CUDA
|
||||
cudaError_t cudaStatus = cudaSetDevice(0);
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaSetDevice failed! Do you have a CUDA-capable GPU?\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Test data - sample block header
|
||||
uint32_t version = 0x20000000;
|
||||
uint32_t prev_block[8] = {
|
||||
0x12345678, 0x9abcdef0, 0x12345678, 0x9abcdef0,
|
||||
0x12345678, 0x9abcdef0, 0x12345678, 0x9abcdef0
|
||||
};
|
||||
uint32_t merkle_root[8] = {
|
||||
0xabcdef12, 0x34567890, 0xabcdef12, 0x34567890,
|
||||
0xabcdef12, 0x34567890, 0xabcdef12, 0x34567890
|
||||
};
|
||||
uint32_t timestamp = 0x5f123456;
|
||||
uint32_t bits = 0x1d00ffff;
|
||||
uint32_t nonce = 0x12345678;
|
||||
|
||||
uint8_t output[32];
|
||||
|
||||
printf("Testing single hash...\n");
|
||||
RinHash(&version, prev_block, merkle_root, ×tamp, &bits, &nonce, output);
|
||||
print_hex("Hash result", output, 32);
|
||||
|
||||
printf("\nTesting mining (trying 1000 nonces)...\n");
|
||||
uint32_t found_nonce;
|
||||
uint8_t target_hash[32];
|
||||
uint8_t best_hash[32];
|
||||
|
||||
// Set a target (easier than difficulty)
|
||||
memset(target_hash, 0xff, 32);
|
||||
|
||||
RinHash_mine(&version, prev_block, merkle_root, ×tamp, &bits,
|
||||
0, 1000, &found_nonce, target_hash, best_hash);
|
||||
|
||||
printf("Found nonce: 0x%08x\n", found_nonce);
|
||||
print_hex("Best hash", best_hash, 32);
|
||||
|
||||
printf("\nTest completed successfully!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -21,4 +21,31 @@ make -j$(nproc)
|
||||
|
||||
# Test the newly built binary
|
||||
./cpuminer -a rinhash -o stratum+tcp://192.168.0.188:3333 -u db.win -p x -t 4
|
||||
cpuminer-rinhash.exe -a rinhash -o stratum+tcp://192.168.0.188:3334 -u db.win -p x -t 4
|
||||
cpuminer-rinhash.exe -a rinhash -o stratum+tcp://192.168.0.188:3334 -u db.win -p x -t 4
|
||||
|
||||
|
||||
|
||||
|
||||
from https://github.com/StickyFingaz420/CPUminer-opt-rinhash
|
||||
|
||||
|
||||
|
||||
Option 1: Build from Source (Recommended)
|
||||
bash
|
||||
|
||||
Copy
|
||||
# Install build dependencies
|
||||
sudo apt update
|
||||
sudo apt install build-essential autotools-dev autoconf pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev zlib1g-dev git automake libtool
|
||||
|
||||
# Clone the repository (if you haven't already)
|
||||
git clone https://github.com/rplant8/cpuminer-opt-rinhash.git
|
||||
cd cpuminer-opt-rinhash
|
||||
|
||||
# Build it
|
||||
./autogen.sh
|
||||
./configure CFLAGS="-O3 -march=native -funroll-loops -fomit-frame-pointer"
|
||||
make -j$(nproc)
|
||||
|
||||
# Test the newly built binary
|
||||
./cpuminer -a rinhash -o stratum+tcp://192.168.0.188:3333 -u username.workername -p x -t 4
|
||||
Reference in New Issue
Block a user