1

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?

2 Answers 2

1

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
1
  • 1
    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. Oct 28, 2021 at 0:08
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

Your Answer

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

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