<p>It's not working because it does not have sufficient data to give you a reasonable estimation.</p>

<p>You will need a steady rate of transactions on the network for a sustained period of time. On regtest, that means you'll need to simulate those transactions as there is no network to provide them.</p>

<p>It's easier to see estimatesmartfee in action on testnet or mainnet.</p>

CC BY-SA 4.0
2019-09-20T00:25:04.800Z
yes, but, do i need to specify the keys when making the request, or do i just pass the values?
Jeffrey L. Roberts
CC BY-SA 4.0
2019-09-20T00:30:15.640Z
Both are allowed.
Pieter Wuille
CC BY-SA 4.0
2019-09-19T20:32:27.217Z
2019-09-19T20:32:27.217Z
Pieter Wuille
<p>I am attempting to use a PHP RPC Wrapper to connect to bitcoind for RPC API calls, estimatesmartfee, more specifically. </p>

<p>My question is, do I need to specify the argument keys, or just the values?</p>

<p>For example, the below is with just the values</p>

<pre><code>public function getSmartFeeEstimate($blocks)
{
    $command = new \Nbobtc\Command\Command('estimatesmartfee', [$blocks, 'CONSERVATIVE']);
    $response = $this-&gt;client-&gt;sendCommand($command);
    $contents = $response-&gt;getBody()-&gt;getContents();

    return $contents;
}
</code></pre>

<p>or do I need to specify the keys as well, for example...</p>

<pre><code>public function getSmartFeeEstimate($blocks)
{
    $command = new \Nbobtc\Command\Command('estimatesmartfee', ['conf_target' =&gt; $blocks, 'estimate_mode' =&gt; 'CONSERVATIVE']);
    $response = $this-&gt;client-&gt;sendCommand($command);
    $contents = $response-&gt;getBody()-&gt;getContents();

    return $contents;
}
</code></pre>

<p>Normally I would just try each one and see what the functions return, however, I am in regtest mode, and its returning the same thing for both, which leads me to believe that it's ignoring the arguments and just telling me its not working...</p>

<pre><code>{"result":{"errors":["Insufficient data or no feerate found"],"blocks":2},"error":null,"id":null}
</code></pre>

<bitcoind><json-rpc><fee-estimation>
Bitcoin RPC estimatesmartfee argument keys necessary?
Jeffrey L. Roberts
# Bitcoin RPC estimatesmartfee argument keys necessary?

(Asked by: username_0 on 2019-09-19)

I am attempting to use a PHP RPC Wrapper to connect to bitcoind for RPC API calls, estimatesmartfee, more specifically.

My question is, do I need to specify the argument keys, or just the values?

For example, the below is with just the values

```
public function getSmartFeeEstimate($blocks)
{
    $command = new \Nbobtc\Command\Command('estimatesmartfee', [$blocks, 'CONSERVATIVE']);
    $response = $this->client->sendCommand($command);
    $contents = $response->getBody()->getContents();

    return $contents;
}

```

or do I need to specify the keys as well, for example...

```
public function getSmartFeeEstimate($blocks)
{
    $command = new \Nbobtc\Command\Command('estimatesmartfee', ['conf_target' => $blocks, 'estimate_mode' => 'CONSERVATIVE']);
    $response = $this->client->sendCommand($command);
    $contents = $response->getBody()->getContents();

    return $contents;
}

```

Normally I would just try each one and see what the functions return, however, I am in regtest mode, and its returning the same thing for both, which leads me to believe that it's ignoring the arguments and just telling me its not working...

```
{"result":{"errors":["Insufficient data or no feerate found"],"blocks":2},"error":null,"id":null}

```

**Tags:** bitcoind, json-rpc, fee-estimation


---

## 1 answers

### Answer by username_1 on 2019-09-19. Score: 0 | Accepted answer

It's not working because it does not have sufficient data to give you a reasonable estimation.

You will need a steady rate of transactions on the network for a sustained period of time. On regtest, that means you'll need to simulate those transactions as there is no network to provide them.

It's easier to see estimatesmartfee in action on testnet or mainnet.

> **Comments:**
> **username_0**: yes, but, do i need to specify the keys when making the request, or do i just pass the values?  
> **username_1**: Both are allowed.  

---

