I have minted a test token.
Now I am trying to mint a second test token to confirm that I know what I’m doing…. But to no avail….
I am using the following commands:
*Build Transaction
cardano-cli transaction build-raw
–fee 300000
–tx-in 1f39ae2653ec48c155fa07c412a66f3aad1890ec846933b82d4559b5719b52e4#0
–tx-out addr_test1vrftgrk8vu246nxc24c9594ajac9565yle7w584d0nsf2esfkh7ja+0+“9999518131 $policyid.$tokenname”
–mint “1000000 $policyid.$tokenname”
–minting-script-file policy/policy.script
–out-file matx.raw
fee=$(cardano-cli transaction calculate-min-fee --tx-body-file matx.raw --tx-in-count 1 --tx-out-count 1 --witness-count 2 $testnet --protocol-params-file protocol.json | cut -d " " -f1)
output=$(expr $funds - $fee)
When I enter the output command I get the error- (expr: non-integer argument)
Help?
That does not have much to do with Cardano, but with the shell shenanigans that are done around that.
You have set two different variables $funds
and $fee
and it tells you that one of them doesn’t contain a number it can deal with.
You can look at the contents of the variables with echo $funds
and echo $fee
. Maybe that gives you a hint what’s going wrong.
Ok, so I fixed this problem. I needed to set the funds variable.
Now I have a new problem.
I’m able to build the test transaction and generate the correct fee. Then rebuild the transaction with the fee, sign the transaction but when I submit to the testnet I get an error.
I’m pretty sure it’s because my txout script is incorrect and my fees are off somewhere. What should the txout script be?
I was able to successfully mint 1000000 test tokens. Now I am trying to mint a second test token.
I have attached a screenshot of my txhash from the first mint, the commands I am running to mint a new token and the error I am now receiving.
Build Transaction
cardano-cli transaction build-raw
–fee $fee
–tx-in $txhash#0
–tx-out $address+$output+“$tokenamount $policyid.$tokenname”
–mint “$tokenamount $policyid.$tokenname”
–minting-script-file policy/policy.script
–out-file matx.raw
fee=$(cardano-cli transaction calculate-min-fee --tx-body-file matx.raw --tx-in-count 1 --tx-out-count 1 --witness-count 2 $testnet --protocol-params-file protocol.json | cut -d " " -f1)
output=$(expr $funds - $fee - 10000000)
Re Build Transaction
cardano-cli transaction build-raw
–fee $fee
–tx-in $txhash#0
–tx-out $address+$output+“$tokenamount $policyid.$tokenname”
–mint “$tokenamount $policyid.$tokenname”
–minting-script-file policy/policy.script
–out-file matx.raw
cardano-cli transaction sign
–signing-key-file payment.skey
–signing-key-file policy/policy.skey
$testnet --tx-body-file matx.raw
–out-file matx.signed
cardano-cli transaction submit --tx-file matx.signed $testnet
ERROR****
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (UtxoFailure (AlonzoInBabbageUtxoPredFailure (ValueNotConservedUTxO (MaryValue 9999818131 (MultiAsset (fromList [(PolicyID {policyID = ScriptHash “e882829bf5569825451e0fd10752b679bb8b8d265a496f35562b52a3”},fromList [(“54657374746f6b656e”,1000000),(“57617265746f6b656e”,10000000)])]))) (MaryValue 9989818131 (MultiAsset (fromList [(PolicyID {policyID = ScriptHash “e882829bf5569825451e0fd10752b679bb8b8d265a496f35562b52a3”},fromList [(“57617265746f6b656e”,10000000)])]))))))])
Is there anyone who is a specialist in token minting able to hop on a call of some kind to help me?
I created one test token successfully. I am trying to mint a second test token but keep getting an error when I try to submit the transaction.
The transaction output and input must be equal but with the test token now created I’m assuming I don’t have the “funds” and “fees” set up correctly.
Help!