<p>Unfortunately, the information presented on Bitcoin Wiki is misleading. All I had to do is to call <code>getblocktemplate</code> with</p>
<pre><code>{
  rules: [&quot;segwit&quot;]
}
</code></pre>
<p>JSON object (it happened to be crucial to pass exactly a JSON <strong>object</strong>, not a string). And for the work completion all I needed to do is to send <code>submitblock</code> request.</p>
<p>Hope it helps someone who's also struggling to find any info about solo mining with
Bitcoin RPC.</p>

CC BY-SA 4.0
2021-04-24T20:53:06.377Z
what to do with the data from `getblocktemplate` ? I could not find any code that makes use of the output. `libblkmaker` is severely outdated
Melih Yıldız'
CC BY-SA 4.0
2021-02-23T13:38:10.977Z
2021-02-23T13:38:10.977Z
Maksim I. Kuzmin
<p>I found this script: <a href="https://github.com/jgarzik/pyminer" rel="nofollow noreferrer">https://github.com/jgarzik/pyminer</a></p>
<p>But it uses <code>getwork</code> RPC call, which resulting me this:</p>
<pre><code>error code: -32601
error message:
Method not found
</code></pre>
<p>From <a href="https://en.bitcoin.it/wiki/Getblocktemplate" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Getblocktemplate</a>:</p>
<blockquote>
<p>It <strong>supercedes</strong> the old getwork mining protocol.</p>
</blockquote>
<p>Does it mean that <code>getwork</code> is no longer an option for miners? If so, how do I solo mine with <code>getblocktemplate</code>?</p>
<p>I never worked with this protocol, but from what I read on wiki, it apparently forces me to connect to pools. My task is to do solo mining by all means.</p>
<p>Could you please provide or refer to example Bitcoin RPC call, that would:</p>
<ol>
<li>Get a job to mine</li>
<li>Send mined block hash with all the mined info (nonce, etc.)</li>
</ol>
<hr />
<p>If possible, please, do not refer me to third-party software like bfgminer, etc. I'm implementing my own miner, and I need to know RPC calls to do it.</p>

<bitcoind><json-rpc><solo-mining>
How do I solo mine with bitcoind-rpc?
Maksim I. Kuzmin
# How do I solo mine with bitcoind-rpc?

(Asked by: username_0 on 2021-02-23)

I found this script: <https://github.com/jgarzik/pyminer>

But it uses `getwork` RPC call, which resulting me this:

```
error code: -32601
error message:
Method not found

```

From <https://en.bitcoin.it/wiki/Getblocktemplate>:

> It **supercedes** the old getwork mining protocol.

Does it mean that `getwork` is no longer an option for miners? If so, how do I solo mine with `getblocktemplate`?

I never worked with this protocol, but from what I read on wiki, it apparently forces me to connect to pools. My task is to do solo mining by all means.

Could you please provide or refer to example Bitcoin RPC call, that would:

1. Get a job to mine
2. Send mined block hash with all the mined info (nonce, etc.)

---

If possible, please, do not refer me to third-party software like bfgminer, etc. I'm implementing my own miner, and I need to know RPC calls to do it.

**Tags:** bitcoind, json-rpc, solo-mining


---

## 1 answers

### Answer by username_0 on 2021-02-23. Score: 1

Unfortunately, the information presented on Bitcoin Wiki is misleading. All I had to do is to call `getblocktemplate` with

```
{
  rules: ["segwit"]
}

```

JSON object (it happened to be crucial to pass exactly a JSON **object**, not a string). And for the work completion all I needed to do is to send `submitblock` request.

Hope it helps someone who's also struggling to find any info about solo mining with
Bitcoin RPC.

> **Comments:**
> **username_1**: what to do with the data from `getblocktemplate` ? I could not find any code that makes use of the output. `libblkmaker` is severely outdated  

---

