JayDDee / cpuminer-opt

Optimized multi algo CPU miner
Other
765 stars 543 forks source link

Need some help #331

Closed rubenh2905 closed 2 years ago

rubenh2905 commented 2 years ago

hi, i want make java based Sugarchain miner, but i don't know how to simplify your source to re write it on java (i'm not c & cpp developer), but i know some thing about stratum protocol, can you help me how to make a simple Sugarchain miner ?

JayDDee commented 2 years ago

cpuminer-opt already supports sugarchain, scroll down to yespower parameters: https://github.com/JayDDee/cpuminer-opt/wiki/Supported--Algorithms

I'm not a Java programmer so I can't help you anyway but Java is not suitable for a miner. Java is designed primarilly for portability at the expense of performance. Performance is critical for CPU mining software.

Java is also an object oriented language, cpuminer-opt is written in C which is not OO. It's not a simple conversion, it's a complete rewrite.

If I knew more about Java I'd probably find more reasons why it's a bad idea.

YetAnotherRussian commented 2 years ago

hi, i want make java based Sugarchain miner, but i don't know how to simplify your source to re write it on java (i'm not c & cpp developer), but i know some thing about stratum protocol, can you help me how to make a simple Sugarchain miner ?

Use an existing yescrypt (https://github.com/HashEngineering/myriadcoinj/blob/master/core/src/main/java/com/hashengineering/crypto/Yescrypt.java) as a reference, search for changes in latest yescrypt & yespower versions, then ugrade that code.

But yes, that's a bad idea. Miners should be written in ASM, C, C++ or (at least) Go. Interpreter, VM or JIT is a bad idea by design. There's an access to vectorization in Java and .NET, but this won't help in case of Yescrypt/Yespower...