3

What does it mean in the bitcoin.conf file when it states:

  server=1 tells Bitcoin-Qt to accept JSON-RPC commands?  

If all one needs to do to solo mine is type setgenerate true in the console, then what is at stake with accepting JSON-RPC commands? Does this allow other software to interact with Bitcoin-Qt, or something akin to that? Can someone explain?

4
  • 1
    Unless this is just for testing purposes, going for solo mining and especially with the setgenerate option (which might be OK for Quarkcoin that is CPU-based but definitely isn't anything close to efficient for Bitcoin) will just waste your electricity and will never pay a satoshi back.
    – user11221
    Apr 20, 2014 at 22:26
  • @George This post is only designed to confirm solo mining protocol with bitcoin-qt. I concur with your sentiments, but feel it is important to master basic concepts, however inefficient those methods might be ... Regards, oemb1905
    – oemb1905
    Apr 20, 2014 at 22:41
  • 1
    No doubt that it will serve its purpose just fine for mastering the basics, especially if you give it a go in testnet.
    – user11221
    Apr 20, 2014 at 22:47
  • Update: After solo mining, I decided to mine share, which I did from 2014 - 2018 for 'pennies.' I forgot about the shares and had a nice $2000 surprise this past Spring 2021. Glad to see this post about fundamentals of solo mining and the JSON api has had so much viewership!
    – oemb1905
    Jul 7, 2021 at 2:05

3 Answers 3

4

The JSON-RPC API can be used by other programs to communicate with the Bitcoin client. That could include external mining programs, "e-commerce" software to automatically make and receive payments, or any other software that wants to interact with the Bitcoin network.

It is true that you do not need this feature simply to solo mine using setgenerate true. However, you should be aware that setgenerate true enables an inefficient CPU miner which is obsolete technology and should be used for testing only. It will cost you far more in electricity than you can ever expect to earn in mining revenue, and with very high probability you will never successfully mine a single block. The current state of the art in mining is dedicated ASIC hardware. Such hardware would normally be controlled by a separate piece of software, which would then communicate with the Bitcoin client over the RPC API.

5
  • Thanks, I am aware that ASIC is the current technology and that CPU mining is obsolete. Just wanted to confirm this part of the bitcoin.conf file. You mention that the hardware, an ASIC miner, would be controlled by software, e.g., rpgminer, and would communicate with bitcoin-qt using RPC API. Does your answer suggest that I would keep Bitcoin-Qt running in th background while mining with rpgminer?
    – oemb1905
    Apr 20, 2014 at 22:19
  • @oemb1905: Yes. You could also use the headless client, bitcoind, if you didn't want the extra window on your desktop. Apr 20, 2014 at 22:20
  • Can you direct me to the site to download bitcoind? Thanks, and I will consider that for my set up.
    – oemb1905
    Apr 20, 2014 at 22:28
  • @oemb1905: You get it from the same place you got bitcoin-qt. Depending on what you downloaded, you may have already installed it together with bitcoin-qt. Apr 20, 2014 at 22:30
  • I heard that they are bundled together now, so perhaps I did. I will revisit the .org site. Thanks again!
    – oemb1905
    Apr 20, 2014 at 22:36
2

One reason you might use server=1 is when you're using a third-party mining program like cgminer.

Example bitcoin.conf:

server=1
rpcuser=SOMEUSER
rpcpassword=SOMEPASSWORD

Note: Don't set gen=1, because you don't want to use CPU mining. Instead, install cgminer and run:

cgminer -o http://127.0.0.1:8332 -u SOMEUSER -p SOMEPASSWORD
1
  • This is actually great - and still relevant for Litecoin mining I would imagine.
    – oemb1905
    Jul 7, 2021 at 2:07
1

Yes. if you set server=1 in your bitcoin.conf file your wallet will run a server that listens for and accepts commands passed to it. These can be used to externally control the wallet. By default only requests from your local machine are accepted. JSON is the formatting language the commands are issued in. JSON_RPC is a standardized way of issuing these commands using the json format. When you run the client you can use the Console available from the help menu to run the same set of commands directly. As people mentioned its been quite a while since its been practical to use the client as a miner.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.