<p>You're using the genesis file instead of the protocol-params-file.</p>
<p>Try using the protocol-params. You can get it using this command:</p>
<pre><code>cardano-cli query protocol-parameters --testnet-magic 1097911063 &gt; protocol-params.json
</code></pre>
<p>It works:</p>
<pre><code>cardano-cli transaction calculate-min-fee \
--tx-body-file tx.draft \
--protocol-params-file protocol-params.json \
--testnet-magic 1097911063 \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 1
</code></pre>

CC BY-SA 4.0
2021-10-28T00:08:39.733Z
Thanks for the help!  The tutorial specifically said protocol-params.json, but since I couldn't find it from the download sites, I thought maybe the tutorial had it wrong, so I assumed one of the genesis files.  That worked.
Omaha Cardano Pool
CC BY-SA 4.0
2021-10-26T15:26:44.877Z
2021-10-26T15:26:44.877Z
georgeos
<p>Download the latest files from <a href="https://hydra.iohk.io/build/7654130/download/1/index.html" rel="nofollow noreferrer">https://hydra.iohk.io/build/7654130/download/1/index.html</a></p>
<p>There was an update did you update your node? You should also get the latest config files</p>

CC BY-SA 4.0
2021-10-26T10:13:44.793Z
2021-10-26T10:13:44.793Z
Xpriens
<p>This is occurring on testnet. Trying to calculate a fee for a transaction that will include metada.</p>
<p>Here's the script:</p>
<pre><code>cardano-cli transaction calculate-min-fee \
    --tx-body-file tx.draft \
    --tx-in-count 1 \
    --tx-out-count 1 \
    --witness-count 1 \
    --byron-witness-count 0 \
    --testnet-magic 1097911063 \
    --protocol-params-file testnet-shelley-genesis.json
</code></pre>
<p>The error:</p>
<p>Command failed: transaction calculate-min-fee  Error: Error while decoding the protocol parameters at: &quot;testnet-shelley-genesis.json&quot; Error: &quot;Error in $: key &quot;protocolVersion&quot; not found&quot;</p>
<p>And the first part of the testnet-shelley-genesis.json file</p>
<pre><code>{
  &quot;activeSlotsCoeff&quot;: 0.05,
  &quot;protocolParams&quot;: {
    &quot;protocolVersion&quot;: {
      &quot;minor&quot;: 0,
      &quot;major&quot;: 2
    },
    &quot;decentralisationParam&quot;: 1,
    &quot;eMax&quot;: 18,
    &quot;extraEntropy&quot;: {
      &quot;tag&quot;: &quot;NeutralNonce&quot;
    },
    &quot;maxTxSize&quot;: 16384,
    &quot;maxBlockBodySize&quot;: 65536,
    &quot;maxBlockHeaderSize&quot;: 1100,
    &quot;minFeeA&quot;: 44,
    &quot;minFeeB&quot;: 155381,
    &quot;minUTxOValue&quot;: 1000000,
    &quot;poolDeposit&quot;: 500000000,
    &quot;minPoolCost&quot;: 340000000,
    &quot;keyDeposit&quot;: 2000000,
    &quot;nOpt&quot;: 150,
    &quot;rho&quot;: 0.003,
    &quot;tau&quot;: 0.20,
    &quot;a0&quot;: 0.3
  },
</code></pre>
<p>Checked <code>byron</code> and <code>alonzo</code> genesis files and they do not contain the <code>protocolVersion</code> element. Haven't made any updates to any of the genesis files.</p>
<p>Is there a different params file I should be using?</p>

<cardano-cli><blockchain><testnet><fee>
Error while decoding the protocol parameters
# Error while decoding the protocol parameters

(Asked by: username_0 on 2021-10-26)

This is occurring on testnet. Trying to calculate a fee for a transaction that will include metada.
Here's the script:
cardano-cli transaction calculate-min-fee \
    --tx-body-file tx.draft \
    --tx-in-count 1 \
    --tx-out-count 1 \
    --witness-count 1 \
    --byron-witness-count 0 \
    --testnet-magic 1097911063 \
    --protocol-params-file testnet-shelley-genesis.json

The error:
Command failed: transaction calculate-min-fee  Error: Error while decoding the protocol parameters at: "testnet-shelley-genesis.json" Error: "Error in $: key "protocolVersion" not found"
And the first part of the testnet-shelley-genesis.json file
{
  "activeSlotsCoeff": 0.05,
  "protocolParams": {
    "protocolVersion": {
      "minor": 0,
      "major": 2
    },
    "decentralisationParam": 1,
    "eMax": 18,
    "extraEntropy": {
      "tag": "NeutralNonce"
    },
    "maxTxSize": 16384,
    "maxBlockBodySize": 65536,
    "maxBlockHeaderSize": 1100,
    "minFeeA": 44,
    "minFeeB": 155381,
    "minUTxOValue": 1000000,
    "poolDeposit": 500000000,
    "minPoolCost": 340000000,
    "keyDeposit": 2000000,
    "nOpt": 150,
    "rho": 0.003,
    "tau": 0.20,
    "a0": 0.3
  },

Checked byron and alonzo genesis files and they do not contain the protocolVersion element. Haven't made any updates to any of the genesis files.
Is there a different params file I should be using?

**Tags:** cardano-cli, blockchain, testnet, fee

---

## 2 answers

### Answer by username_1 on 2021-10-26. Score: 1 | Accepted answer

You're using the genesis file instead of the protocol-params-file.
Try using the protocol-params. You can get it using this command:
cardano-cli query protocol-parameters --testnet-magic 1097911063 > protocol-params.json

It works:
cardano-cli transaction calculate-min-fee \
--tx-body-file tx.draft \
--protocol-params-file protocol-params.json \
--testnet-magic 1097911063 \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 1

> **Comments:**
> **username_0**: Thanks for the help!  The tutorial specifically said protocol-params.json, but since I couldn't find it from the download sites, I thought maybe the tutorial had it wrong, so I assumed one of the genesis files.  That worked.  

---

### Answer by username_2 on 2021-10-26. Score: 0

Download the latest files from <https://hydra.iohk.io/build/7654130/download/1/index.html>

There was an update did you update your node? You should also get the latest config files


---

