Pages:
Author

Topic: An (even more) optimized version of cpuminer (pooler's cpuminer, CPU-only) - page 2. (Read 1958601 times)

newbie
Activity: 3
Merit: 0
Hi All,

I am trying to understand under the hood working of bitcoin mining and going through the source code of cpuminer. The source code is really helpful, Thanks!

I have a basic question which I tried to ask in another forum, but I could not get clear answer, let me try here.

I feel that the cpuminer is not adding fees along with block-reward.

I am looking at coinbase transaction generation, code under section   /* build coinbase transaction */

Code:

      tmp = json_object_get( val, "coinbasevalue" );
      if ( !tmp || !json_is_number( tmp ) )
      {
         applog( LOG_ERR, "JSON invalid coinbasevalue" );
         goto out;
      }
      cbvalue = (int64_t) ( json_is_integer( tmp ) ? json_integer_value( tmp )
                                                   : json_number_value( tmp ) );


I feel it is missing the fees addition, below is the code I was expecting to compute and add fees.


      tmp = json_object_get( val, "coinbasevalue" );
      if ( !tmp || !json_is_number( tmp ) )
      {
         applog( LOG_ERR, "JSON invalid coinbasevalue" );
         goto out;
      }
      cbvalue = (int64_t) ( json_is_integer( tmp ) ? json_integer_value( tmp )
                                                   : json_number_value( tmp ) );

       /* add fee */
        int64_t total_fees=0;
        int64_t fee=0;

        for (i = 0; i < tx_count; i++) {
          const json_t *tx = json_array_get(txa, i);            
          tmp = json_object_get(tx, "fee");      
          if (!tmp || !json_is_number(tmp)) {
              applog(LOG_ERR, "JSON invalid Fee");
              goto out;
           }
           fee = json_is_integer(tmp) ? json_integer_value(tmp) : json_number_value(tmp);      
           total_fees = total_fees + fee;
       }

   cbvalue = cbvalue + total_fees;


Please let me know if I am missing anything.

Thanks & Regards,
Sandy
newbie
Activity: 2
Merit: 0
Hello. Is there any wiki or something for this tool?
I am trying to mine with binance, but while it connects, pool doesn't accept anything
full member
Activity: 938
Merit: 159
how do i exclude the complete tuning at the first start? it takes about 2 hours and a half , i tried with no-tune true but it doesn't work, little help with scripts?
newbie
Activity: 1
Merit: 0
Can anyone please direct me to CURRENT working instructions on how to compile this? I've reached dead end after dead end of old obsolete links.

I would prefer to be able to build through VSCODE but I'd settle for anything at this point. win10 64 system.

EDIT: here are the instructions I see on github:

Basic Windows build instructions, using MinGW:
   Install MinGW and the MSYS Developer Tool Kit (http://www.mingw.org/)
      * Make sure you have mstcpip.h in MinGW\include
   If using MinGW-w64, install pthreads-w64
   Install libcurl devel (http://curl.haxx.se/download.html)
      * Make sure you have libcurl.m4 in MinGW\share\aclocal
      * Make sure you have curl-config in MinGW\bin
   In the MSYS shell, run:
      ./autogen.sh   # only needed if building from git repo
      LIBCURL="-lcurldll" ./configure CFLAGS="-O3"
      make

MSYS Developer Tool Kit version 1.01 for 32bit systems from many years ago is the latest I could find.
I manually downloaded the mstcpip.h file and placed in the proper folder
Searching for pthreads-w64 led to a whole pile of Google garbage.

Getting burnt out at this point, the installation of curl led to a whole new compilation rabbit hole and I am pretty frustrated now. I'm hoping for an idiot proof version of how to do this.
newbie
Activity: 2
Merit: 0
Hello.

I tried to install CPUminer, on Windows 10, using the commands from the website below.

Website: https://github.com/pooler/cpuminer

Can this program be used on a cluster, with Debian? Text mode only.

I plan to create my Bitcoin farm. Programming is not a problem.
What initial steps?

Thanks.

Olá.

Tentei instalar o CPUminer, no Windows 10, usando os comandos do site abaixo.

Site: https://github.com/pooler/cpuminer

Esse programa pode ser usando em um cluster, com Debian? Somente modo texto.

Pretendo criar minha fazenda de Bitcoins. A programação não é problema.
Quais passos iniciais?

Obrigado.
newbie
Activity: 8
Merit: 0
I am trying to mine using this software like in the same way I use to mine other coins via CPU mining.

These are the steps I did:

1 - My bitcoin.conf file:


server=1
daemon=1
txindex=1

rpcport=8332
rpcuser=user
rpcpass=123456

2 - My conf file for minerd:

{
  "url": "http://127.0.0.1:8332",
  "userpass": "user:123456",
  "threads": "2",
  "algo": "sha256d",
  "debug": true,
  "no-longpoll": true,
  "no-stratum": true,
  "quiet": true
 }

3 - My Bitcoin core wallet is open, fully synchronized, and unlocked.

4 - I run the minerd with the command:

./minderd --config=./conf.json


But I get URL connection ERROR, what should I do different?



in the bitcoin.conf add
rpcallowip=127.0.0.1
and change
rpcpass=123456 to rpcpassword=123456

Thank you, the problem was with the rpcpass, the correct is rpcpassword. I had to set in my conf file for minerd the coinbase-addr, now it seems the minerd is running, however I only get something like this:

DEBUG: got new work in 1069 ms

Not sure if it is really working.


You're not actually trying to mine BTC with a cpu are you?
With this level of difficulty, even if you were the only person mining, you MIGHT get a block in 1,000 years, but up against the current hashrate, you'd have more chance of living to be a 1000 year old than mine a block.

Not the way to learn cpu mining...

I know I will get nothing, but I just would like to see this program working as it was planned to work since the beggining of Bitcoin mining. I mine others coins via CPU, I guess it would be the same way for Bitcoin as well, so I just wanted to see this working.
sr. member
Activity: 1249
Merit: 297
I am trying to mine using this software like in the same way I use to mine other coins via CPU mining.

These are the steps I did:

1 - My bitcoin.conf file:


server=1
daemon=1
txindex=1

rpcport=8332
rpcuser=user
rpcpass=123456

2 - My conf file for minerd:

{
  "url": "http://127.0.0.1:8332",
  "userpass": "user:123456",
  "threads": "2",
  "algo": "sha256d",
  "debug": true,
  "no-longpoll": true,
  "no-stratum": true,
  "quiet": true
 }

3 - My Bitcoin core wallet is open, fully synchronized, and unlocked.

4 - I run the minerd with the command:

./minderd --config=./conf.json


But I get URL connection ERROR, what should I do different?



in the bitcoin.conf add
rpcallowip=127.0.0.1
and change
rpcpass=123456 to rpcpassword=123456

Thank you, the problem was with the rpcpass, the correct is rpcpassword. I had to set in my conf file for minerd the coinbase-addr, now it seems the minerd is running, however I only get something like this:

DEBUG: got new work in 1069 ms

Not sure if it is really working.


You're not actually trying to mine BTC with a cpu are you?
With this level of difficulty, even if you were the only person mining, you MIGHT get a block in 1,000 years, but up against the current hashrate, you'd have more chance of living to be a 1000 year old than mine a block.

Not the way to learn cpu mining...
newbie
Activity: 8
Merit: 0
I am trying to mine using this software like in the same way I use to mine other coins via CPU mining.

These are the steps I did:

1 - My bitcoin.conf file:


server=1
daemon=1
txindex=1

rpcport=8332
rpcuser=user
rpcpass=123456

2 - My conf file for minerd:

{
  "url": "http://127.0.0.1:8332",
  "userpass": "user:123456",
  "threads": "2",
  "algo": "sha256d",
  "debug": true,
  "no-longpoll": true,
  "no-stratum": true,
  "quiet": true
 }

3 - My Bitcoin core wallet is open, fully synchronized, and unlocked.

4 - I run the minerd with the command:

./minderd --config=./conf.json


But I get URL connection ERROR, what should I do different?



in the bitcoin.conf add
rpcallowip=127.0.0.1
and change
rpcpass=123456 to rpcpassword=123456

Thank you, the problem was with the rpcpass, the correct is rpcpassword. I had to set in my conf file for minerd the coinbase-addr, now it seems the minerd is running, however I only get something like this:

DEBUG: got new work in 1069 ms

Not sure if it is really working.
sr. member
Activity: 1249
Merit: 297
I am trying to mine using this software like in the same way I use to mine other coins via CPU mining.

These are the steps I did:

1 - My bitcoin.conf file:


server=1
daemon=1
txindex=1

rpcport=8332
rpcuser=user
rpcpass=123456

2 - My conf file for minerd:

{
  "url": "http://127.0.0.1:8332",
  "userpass": "user:123456",
  "threads": "2",
  "algo": "sha256d",
  "debug": true,
  "no-longpoll": true,
  "no-stratum": true,
  "quiet": true
 }

3 - My Bitcoin core wallet is open, fully synchronized, and unlocked.

4 - I run the minerd with the command:

./minderd --config=./conf.json


But I get URL connection ERROR, what should I do different?



in the bitcoin.conf add
rpcallowip=127.0.0.1
and change
rpcpass=123456 to rpcpassword=123456
newbie
Activity: 8
Merit: 0
I am trying to mine using this software like in the same way I use to mine other coins via CPU mining.

These are the steps I did:

1 - My bitcoin.conf file:


server=1
daemon=1
txindex=1

rpcport=8332
rpcuser=user
rpcpass=123456

2 - My conf file for minerd:

{
  "url": "http://127.0.0.1:8332",
  "userpass": "user:123456",
  "threads": "2",
  "algo": "sha256d",
  "debug": true,
  "no-longpoll": true,
  "no-stratum": true,
  "quiet": true
 }

3 - My Bitcoin core wallet is open, fully synchronized, and unlocked.

4 - I run the minerd with the command:

./minderd --config=./conf.json


But I get URL connection ERROR, what should I do different?


newbie
Activity: 1
Merit: 0
can you make cpuminer version for mobile iOS, Android or Javascript web client?
full member
Activity: 1424
Merit: 225
Does Pooler work? cpuminer-multi? GPU miners?
It looks like a protocol change in the Bitcoin RPC. It's not worth fixing even if I knew how,
CPU mining BTC is long obsolete.
sr. member
Activity: 1249
Merit: 297

You can no longer solo mine to the BTC wallet.

You're thinking of the mining software built in to the wallet, that no longer exists. You can still mine solo using RPC,
it's required for any mining to be possible. It's just futile to do so with a CPU.

I think the user's problem is the firewall, Port 13000 needs to be opened for local clients.


I have just tried this with wallet 20.1 and i can't get it to work either...works perfect with Bitcoin Wallet 16
C:\Users\Miner_NVMe\Crypto\0 Miners\cpuminer-opt-3.15.4-windows>cpuminer-zen -a sha256d -o http://127.0.0.1:8332 -u xxxx
 -p xxxx -t 1 --coinbase-addr=aQimFGHgkiyRQMtTFEJ9GnCFHipT1AQMcy

         **********  cpuminer-opt 3.15.4  ***********
     A CPU miner with multi algo support and optimized for CPUs
     with AVX512, SHA and VAES extensions by JayDDee.
     BTC donation address: 12tdvfF7KmAsihBXQXynT6E6th2c2pByTT

CPU: AMD Ryzen 7 1800X Eight-Core Processor
SW built on Dec 15 2020 with GCC 9.3.0
CPU features:  AVX2    AES SHA
SW features:   AVX2    AES SHA
Algo features: AVX2

Starting miner with AVX2...

[2021-01-16 18:48:07] CPU affinity [!!!!!!!!!!!!!!!!]
[2021-01-16 18:48:07] 1 of 16 miner threads started using 'sha256d' algorithm
[2021-01-16 18:48:07] Miner thread priority 0 (nice 19)
[2021-01-16 18:48:08] Empty data received in json_rpc_call.
[2021-01-16 18:48:08] getblocktemplate failed, falling back to getwork
[2021-01-16 18:48:08] Empty data received in json_rpc_call.
[2021-01-16 18:48:08] json_rpc_call failed, retry after 10 seconds
[2021-01-16 18:48:18] Empty data received in json_rpc_call.
[2021-01-16 18:48:18] json_rpc_call failed, retry after 10 seconds
full member
Activity: 1424
Merit: 225

I have looked up how to get the firewall to allow the 13000 port, but do I set it for Inbound or Outbound traffic or for both?

Thank you
Abu.


Short answer, both.

Outbound is for clients and is usually allowed by default.
Inbound is for servers and should only be allowed under strict conditions.
newbie
Activity: 24
Merit: 8

You can no longer solo mine to the BTC wallet.

You're thinking of the mining software built in to the wallet, that no longer exists. You can still mine solo using RPC,
it's required for any mining to be possible. It's just futile to do so with a CPU.

I think the user's problem is the firewall, Port 13000 needs to be opened for local clients.


Can you kindly tell me how I open the 1300 Port, please?
I know it's futile, but still want to try Smiley

Configuring your firewall is not a mining issue and it depends on the OS you're using. Do a little research,
it shouldn't be too hard to find tutorials and howtos.

I have looked up how to get the firewall to allow the 13000 port, but do I set it for Inbound or Outbound traffic or for both?

Thank you
Abu.
newbie
Activity: 24
Merit: 8

You can no longer solo mine to the BTC wallet.

You're thinking of the mining software built in to the wallet, that no longer exists. You can still mine solo using RPC,
it's required for any mining to be possible. It's just futile to do so with a CPU.

I think the user's problem is the firewall, Port 13000 needs to be opened for local clients.


Can you kindly tell me how I open the 1300 Port, please?
I know it's futile, but still want to try Smiley

Configuring your firewall is not a mining issue and it depends on the OS you're using. Do a little research,
it shouldn't be too hard to find tutorials and howtos.

Thank you for this, I'll look it up.
full member
Activity: 1424
Merit: 225
Hi Jaydee....

I have tried using you're miner...works with BTC 16 and lower, but not higher


I don't know what you mean, follow up in my thread.
full member
Activity: 1424
Merit: 225

You can no longer solo mine to the BTC wallet.

You're thinking of the mining software built in to the wallet, that no longer exists. You can still mine solo using RPC,
it's required for any mining to be possible. It's just futile to do so with a CPU.

I think the user's problem is the firewall, Port 13000 needs to be opened for local clients.


Can you kindly tell me how I open the 1300 Port, please?
I know it's futile, but still want to try Smiley

Configuring your firewall is not a mining issue and it depends on the OS you're using. Do a little research,
it shouldn't be too hard to find tutorials and howtos.
sr. member
Activity: 1249
Merit: 297

You can no longer solo mine to the BTC wallet.

You're thinking of the mining software built in to the wallet, that no longer exists. You can still mine solo using RPC,
it's required for any mining to be possible. It's just futile to do so with a CPU.

I think the user's problem is the firewall, Port 13000 needs to be opened for local clients.


Hi Jaydee....

I have tried using you're miner...works with BTC 16 and lower, but not higher
newbie
Activity: 24
Merit: 8

You can no longer solo mine to the BTC wallet.

You're thinking of the mining software built in to the wallet, that no longer exists. You can still mine solo using RPC,
it's required for any mining to be possible. It's just futile to do so with a CPU.

I think the user's problem is the firewall, Port 13000 needs to be opened for local clients.


Can you kindly tell me how I open the 1300 Port, please?
I know it's futile, but still want to try Smiley
Pages:
Jump to: