<pre><code>var blockTemplate = CoinService.GetBlockTemplate( new { rules=new List&lt;string&gt; { &quot;segwit&quot; } });
</code></pre>
<p>This function call requires you to specify rules for the block you want to create and in newer Bitcoin Core version, you can only create blocks following the segwit softfork rules.</p>

CC BY-SA 4.0
2020-08-02T09:39:01.240Z
2020-08-02T09:39:01.240Z
Thorkil Værge
<p>How do I call <code>getblocktemplate</code> from the bitcoinlib package for C#?</p>
<p>This call does not work</p>
<pre><code>ICoinService CoinService = new BitcoinService(useTestnet: true);
var blockTemplate = CoinService.GetBlockTemplate();
</code></pre>

<mining-pools><block><c#>
How do I call getblocktemplate from C#'s bitcoinlib?
Thorkil Værge
# How do I call getblocktemplate from C#'s bitcoinlib?

(Asked by: username_0 on 2020-08-02)

How do I call `getblocktemplate` from the bitcoinlib package for C#?

This call does not work

```
ICoinService CoinService = new BitcoinService(useTestnet: true);
var blockTemplate = CoinService.GetBlockTemplate();

```

**Tags:** mining-pools, block, c#


---

## 1 answers

### Answer by username_0 on 2020-08-02. Score: 0 | Accepted answer

```
var blockTemplate = CoinService.GetBlockTemplate( new { rules=new List<string> { "segwit" } });

```

This function call requires you to specify rules for the block you want to create and in newer Bitcoin Core version, you can only create blocks following the segwit softfork rules.


---

