Transaction submit failures

Great thanks

New error

Invalid argument ` 80d9b32ae2b30e62bbc5234e7cf90f1dd4190fa3b682ed01f6f80115.Vilvi’

probably this line

–tx-out $targetaddr4+$output4+$amount4\ $policyid.$tokenname \ $policyid.$tokenname \

Oh yeah duplicates !

1 Like

Almost there I got a small error

/Applications/Daedalus\ Testnet.app/Contents/MacOS/cardano-cli transaction build
–testnet-magic 1097911063
–alonzo-era
–tx-in $txhash#$txix \
–tx-out $targetaddr1+$output1+$amount1
–tx-out $targetaddr1+$output2+$amount2
–tx-out $targetaddr1+$output3+$amount3
–tx-out $targetaddr1+$output4+$amount4\ $policyid.$tokenname \
–change-address addr_test1vpdg2dd8x93q3yg20jpa30vm807xzxqj3q76cqzuyup2u3gk3zkh5
–mint $amount\ $policyid.$tokenname
–minting-script-file policy.script
–witness-override 2
–out-file matx.raw

Invalid argument ` ’

This editor is autocorrecting
Screenshot 2022-01-16 at 23.44.34

Not if you do it in a code block in triple ```.

--testnet-magic 1097911063 \
--alonzo-era \
--tx-in $txhash#$txix \                                                             
--tx-out $targetaddr1+$output1+$amount1 \
--tx-out $targetaddr1+$output2+$amount2 \
--tx-out $targetaddr1+$output3+$amount3 \
--tx-out $targetaddr1+$output4+$amount4\ $policyid.$tokenname \                 
--change-address addr_test1vpdg2dd8x93q3yg20jpa30vm807xzxqj3q76cqzuyup2u3gk3zkh5 \
--mint $amount\ $policyid.$tokenname \
--minting-script-file policy.script \
--witness-override 2 \
--out-file matx.raw

Your --tx-outs still look wrong, you had them right before, and we had this topic before:

Important: No space between the amounts and the backslashes!

Also important: All of them get the policy id/tokenname. You want all of them to send your token, not ADA.

EDIT: If you find it more convenient, you can also do:

–tx-out "$targetaddr1+$output1+$amount1 $policyid.$tokenname" \
–tx-out "$targetaddr2+$output2+$amount2 $policyid.$tokenname" \
–tx-out "$targetaddr3+$output3+$amount3 $policyid.$tokenname" \
–tx-out "$targetaddr4+$output4+$amount4 $policyid.$tokenname" \
–tx-out "$targetaddr5+$output5+$amount5 $policyid.$tokenname" \
–tx-out "$targetaddr6+$output6+$amount6 $policyid.$tokenname" \
–tx-out "$targetaddr7+$output7+$amount7 $policyid.$tokenname" \
–tx-out "$targetaddr8+$output8+$amount8 $policyid.$tokenname" \

Has the same effect: The space between amount and policy id is not interpreted by the shell as separation of arguments, but is given to cardano-cli as part of one argument to the parameter --tx-out.

EDIT 2: And good night! It’s 1 AM, here.

ok thanks for staying with me its been a long time good night ,I hope to continue in the morning after I try what you suggest one more time

This command worked thanks I just need to remember how to balance the outputs now there is 4
Command failed: transaction build Error: Non-Ada assets are unbalanced: 994429215 lovelace + -175750000 80d9b32ae2b30e62bbc5234e7cf90f1dd4190fa3b682ed01f6f80115.Vilvi

It seemed to come down to policy.script syntax, I rebuilt everything and submitted successfully to Testnet with the bare minimum policy.script it would not accept the syntax for time locking so its almost vanilla just keyhash this isn’t what I need for Mainnet minting.

Anyway heres the Cardanoscan

https://explorer.cardano-testnet.iohkdev.io/en/transaction?id=e9d44fd8801d8c8911273b5d01515bff9c4f8ab428a67b4831919adfe0b8d494

I have been building the mainnet minting transaction for so many hours it fails.
Its not particularly clear on any forums I did some IT trouble-shooting and search on non google browsers. Eventually I came up with this

If you have ANY additional json in policy.script It will fail transaction build UNLESS it has this
'–invalid-hereafter $slotnumber

More searching I found an explanation on github – Forget the Man page

Building and signing transactions

Transactions vary in complexity, depending on their intended outcomes, but all transactions share a number of attributes:

  • Input - contains funds that are spent by the transaction. It is simply the output of an earlier transaction. A transaction can have multiple inputs.
  • Output - determine where the funds go to. An output is given by a payment address and an amount. A transaction can have multiple outputs.
  • Payment address - an address that can receive payments, This is the only type of addresses that can be specified in a transaction output.
  • Payment and stake key pairs - sets of files containing a public verification key and a private signing key.
  • Invalid-before - The slot that the transaction is valid from. This can only be specified in the Allegra era and onwards.
  • Invalid-hereafter - represents a slot, or deadline by which a transaction must be submitted. This is an absolute slot number, rather than a relative one, which means that the --invalid-hereafter value should be greater than the current slot number. A transaction becomes invalid at the invalid-hereafter slot.
  • Era - Transactions can differ between the eras (e.g have new features such as multi-assets) so we must specify the era we are currently in.

To create a transaction in the shelley era we need to follow this process:

  • Get the protocol parameters
  • Draft the transaction
  • Calculate the fee
  • Define the validity interval for the transaction
  • Build the transaction
  • Sign the transaction
  • Submit the transaction

Am still getting errors

Error: The “–mint” flag specifies an asset with a policy Id, but no corresponding monetary policy script has been provided as a witness

My Policy is validated on Pool.pm when I paste in the JSON

So my options here and now unless someone can help is mint with no time lock on the policy seems a bit strange that it only works if the policy script has only the sig and keyhash values.

We had this before:

If you have changed the policy script, it is also a changed policy id. The latter is a hash of the former. Everytime you change the file, you have to redo

policyid=$(cardano-cli transaction policyid --script-file policy.script)

or whatever the equivalent step in your process is.

Hi

Earlier I did run this command
policyid=$(/Applications/Daedalus\ Testnet.app/Contents/MacOS/cardano-cli transaction policyid --script-file policy.script)

then

echo £policyid

Then

added $policyid to metadate.json like so

‘’’{
“721”: {
“01bb0de9fbcddf3dbd5db8fe48805070b7daa7d105d472d39e4634d9”: {

Have I missed anything else ?

‘’’{
“type”: “all”,
“scripts”:[
{
“slot”: 51927159,
“type”: “before”
},
{“type”: “sig”,
“keyHash”: “d719186a3e10e981eac2fab9873b19b4df15f49d3b92f033553b056f”
}
]
}
‘’’

This is my policy.script and it will not build even with

–invalid-hereafter 50827159 \

BTW I made a whole new folder just for this mint and started everything again since I was then sure it was all new

Looks good to me except for the wrong quotation marks (again).

Which editor do you use there? VS Code should not do a replacement like that. Or is your keyboard set to produce instead of "?

Does this look better I think this forum editor is doing that

Screenshot 2022-01-17 at 10.13.33

Anyway still stuck and it just wont build

Error: The “–mint” flag specifies an asset with a policy Id, but no corresponding monetary policy script has been provided as a witness (via the “–minting-script-file” flag). The policy Id in question is: 01bb0de9fbcddf3dbd5db8fe48805070b7daa7d105d472d39e4634d9

It will build if I use this instead but then the policy is unlocked forever

Screenshot 2022-01-17 at 10.16.40

Doesn’t do that for me. Perhaps your browser …

Anyway:

Which policyid does the working example have?