Help downloading protocol.json on Preproduction testnet

What is the script to download protocol.json to preprod testnet as required in this documentation: Minting Native Assets | Cardano Developer Portal

The script: cardano-cli query protocol-parameters $testnet --out-file protocol.json

Is not working.

1 - If you get an error like: cardano-cli: HandshakeError (Refused NodeToClientV_15 "version data mismatch: NodeToClientVersionData {networkMagic = NetworkMagic {unNetworkMagic = 764824073}, query = False} /= NodeToClientVersionData {networkMagic = NetworkMagic {unNetworkMagic = 1097911063}, query = False}")

that means you’re querying the testnet through a mainnet node. If that’s your problem then just use --mainnet instead of $testnet (or set testnet=--mainnet for the rest of your token minting scripts on that page).

2 - If you get an error telling you how to use the command: Usage: cardano-cli query protocol-parameters [--socket-path SOCKET_PATH]

that means $testnet is blank and you missed the definition further up the page:

testnet="--testnet-magic 1097911063"

… in a group of commands that set some token related variables. It’s easily missed there and perhaps should be moved up near the top where other necessary varaibles like CARDANO_NODE_SOCKET_PATH are defined. If that’s the case let me know & I’ll edit the page accordingly.

Generally when you are posting problem on the Forum or anywhere, it’s good manners & gets better results when you quote the error you are having. :stuck_out_tongue_winking_eye:

(p.s.) 3 - if it says Missing: --socket-path SOCKET_PATH

that means you don’t have CARDANO_NODE_SOCKET_PATH defined, or are not on a Cardano node and need to start the process at an earlier stage :sunglasses:

Thank you and noted about posting the error. This is my error now.


You are including a bash variable assignment statement when you are support to be including a variable reference. If you run the 2 commands:

$ testnet="--testnet-magic 1097911063"
$ cardano-cli query protocol-parameters $testnet --out-file protocol.json

(so that the testnet variable in the first command is put into place with the $ in the second command) it will work… or at least you will get a more appropriate error message.

If you need to post that error message, please copy & paste the text instead of another screenshot. :stuck_out_tongue_winking_eye:

Ok, so I ran the two commands and now have the following error:

cardano-cli: HandshakeError (Refused NodeToClientV_15 “version data mismatch: NodeToClientVersionData {networkMagic = NetworkMagic {unNetworkMagic = 1}, query = False} /= NodeToClientVersionData {networkMagic = NetworkMagic {unNetworkMagic = 1097911063}, query = False}”

That is the 1st error that you said I might come across and that the problem is that I’m running a mainnet node but I downloaded the prepod configuration files so I thought I was in testnet? My node epoch is only at 84.

Since that’s practically the same error I get on Mainnet, hopefully someone with a running testnet node can respond & help you break it down further. I’ll keep watching this thread in case there are any changes we need to make to this documentation page. :nerd_face:

Thanks again! I’m starting a new relay node with mainnet configuration files. :crossed_fingers:

1 Like

Please note that pre-prod magic number is 1, i.e. on pre-prod the command must be

testnet="--testnet-magic 1"

That did the trick. Problem solved!

1 Like

Submitted correction to this page here: developer-portal/pull/1137