Is a mining program necessary for mining, or can bitcoind mine by itself?

3

I'm having a hard time understanding the relationship between daemons (such as bitcoind or litecoind) and mining. Some things I read make it seem that you need a separate mining app and some things seem to suggest that the daemon itself does mining. Which is it? I'm thinking maybe the daemon can do mining but it needs to be enabled and if you don't enable it you can use a separate app instead? I'm confused.

RentFree

Posted 2013-05-02T16:54:02.803

Reputation: 2 391

Answers

4

The daemon can do mining using the -gen command line option, but it's CPU mining and is impractical nowadays.

Using a separate mining app is practical. That separate mining app connects to a running bitcoind via its JSON-RPC API in order to facilitate getwork or getblocktemplate requests necessary for hashing.

The JSON-RPC API is configured in bitcoin.conf or at the command line using these arguments:

-rpcuser=<user>        Username for JSON-RPC connections
-rpcpassword=<pw>      Password for JSON-RPC connections
-rpcport=<port>        Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)
-rpcallowip=<ip>       Allow JSON-RPC connections from specified IP address

Colin Dean

Posted 2013-05-02T16:54:02.803

Reputation: 6 559

Is -gen impractical for litecoin mining?RentFree 2013-05-03T12:38:36.683

Not yet, as far as I know. AFAIK, CPU mining is still profitable on Litecoin, but of course decreasingly so.Colin Dean 2013-05-03T15:12:11.290

Note that the mining functionality was removed in Bitcoin Core 0.13.0: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.13.0.md#removal-of-internal-miner

Murch 2018-10-16T20:01:42.350