I’m learning how to use cardano-rosetta
and I’d like to make the send-transaction-example.ts
script work with addresses that I’ve derived beforehand. The addresses have been derived using the cardano-addresses
tool, which I then convert to Uint8 arrays. This is because we need to derive batches of addresses that may be used in future.
The transaction is constructed and signed, seemingly without any issue. The server log is below. However, the transaction is rejected. The API response isn’t very descriptive, I get only a 500 error, but the server log is below. The issue seems to be in this line:
[53047783:cardano.node.Mempool:Info:38002] [2021-03-30 15:55:43.90 UTC] fromList [("tx",Object (fromList [("txid",String "txid: TxId {_unTxId = \"831f0e898a7d6653149bf2f6fc6ea7b482deb04f49251a1edd612051f42617b2\"}")])),("kind",String "TraceMempoolRejectedTx"),("mempoolSize",Object (fromList [("numTxs",Number 0.0),("bytes",Number 0.0)])),("err",Object (fromList [("kind",String "InvalidWitnessesUTXOW"),("invalidWitnesses",Array [String "VKey (VerKeyEd25519DSIGN (PublicKey \"\\158\\238W\\128\\184$:E\\231\\FSa\\152I$\\EM\\b\\134\\CAN\\140\\157N\\154\\238r\\EOT\\173\\204\\172c4cr\"))"])]))]
I don’t know why the witness is invalid. could anyone help?
{"level":30,"time":1617119743744,"pid":106,"hostname":"530477839db5","reqId":1392,"msg":"[constructionCombine] Request received to sign a transaction","v":1}
{"level":30,"time":1617119743745,"pid":106,"hostname":"530477839db5","reqId":1392,"msg":"[buildTransaction] About to signed a transaction with 1 signatures","v":1}
{"level":30,"time":1617119743745,"pid":106,"hostname":"530477839db5","reqId":1392,"msg":"[getWitnessesForTransaction] Extracting witnesses from signatures","v":1}
{"level":30,"time":1617119743745,"pid":106,"hostname":"530477839db5","reqId":1392,"msg":"[getWitnessesForTransaction] 1 witnesses were extracted to sign transaction","v":1}
{"level":30,"time":1617119743745,"pid":106,"hostname":"530477839db5","reqId":1392,"msg":"[buildTransaction] Instantiating transaction body from unsigned transaction bytes","v":1}
{"level":30,"time":1617119743745,"pid":106,"hostname":"530477839db5","reqId":1392,"msg":"[buildTransaction] Creating transaction using transaction body and extracted witnesses","v":1}
{"level":30,"time":1617119743745,"pid":106,"hostname":"530477839db5","reqId":1392,"signedTransaction":"83a400818258204bc397faa17b5f7972cfd6acf2729eb950b5756c8ea2f704ec8ef11d8a3718fb000181825839000c6d3e4ad14b5ac97656fe56cae3d46e4474af25f6f4d25268b8a168474ac229ab36f3ebb93da86e068f35f5a64bcc0e4ed40cc295fca2df1a389fd980021a02faf080031a015b291ba100818258209eee5780b8243a45e71c61984924190886188c9d4e9aee7204adccac633463725840b2e842c390b4142c46e9d08dd5fc366cb37fc960ab48bdeb083134d79858928775e8304f8c25a5cd5d531f9fd7579188fdb659a27e8f418c12a6aada0fda7600f6","msg":"[constructionCombine] About to return signed transaction","v":1}
{"level":30,"time":1617119743747,"pid":106,"hostname":"530477839db5","reqId":1392,"res":{"statusCode":200},"responseTime":3.006010055541992,"msg":"request completed","v":1}
{"level":30,"time":1617119743887,"pid":106,"hostname":"530477839db5","reqId":1393,"req":{"method":"POST","url":"/construction/submit","hostname":"35.214.159.230:8080","remoteAddress":"84.247.50.48","remotePort":55196},"msg":"incoming request","v":1}
{"level":30,"time":1617119743888,"pid":106,"hostname":"530477839db5","reqId":1393,"msg":"[constructionSubmit] About to submit 83a400818258204bc397faa17b5f7972cfd6acf2729eb950b5756c8ea2f704ec8ef11d8a3718fb000181825839000c6d3e4ad14b5ac97656fe56cae3d46e4474af25f6f4d25268b8a168474ac229ab36f3ebb93da86e068f35f5a64bcc0e4ed40cc295fca2df1a389fd980021a02faf080031a015b291ba100818258209eee5780b8243a45e71c61984924190886188c9d4e9aee7204adccac633463725840b2e842c390b4142c46e9d08dd5fc366cb37fc960ab48bdeb083134d79858928775e8304f8c25a5cd5d531f9fd7579188fdb659a27e8f418c12a6aada0fda7600f6","v":1}
[53047783:cardano.node.Mempool:Info:38002] [2021-03-30 15:55:43.90 UTC] fromList [("tx",Object (fromList [("txid",String "txid: TxId {_unTxId = \"831f0e898a7d6653149bf2f6fc6ea7b482deb04f49251a1edd612051f42617b2\"}")])),("kind",String "TraceMempoolRejectedTx"),("mempoolSize",Object (fromList [("numTxs",Number 0.0),("bytes",Number 0.0)])),("err",Object (fromList [("kind",String "InvalidWitnessesUTXOW"),("invalidWitnesses",Array [String "VKey (VerKeyEd25519DSIGN (PublicKey \"\\158\\238W\\128\\184$:E\\231\\FSa\\152I$\\EM\\b\\134\\CAN\\140\\157N\\154\\238r\\EOT\\173\\204\\172c4cr\"))"])]))]
{"level":50,"time":1617119743909,"pid":106,"hostname":"530477839db5","reqId":1393,"shortMessage":"Command failed with exit code 1: /usr/local/bin/cardano-cli transaction submit --tx-file /tmp/6edd9e54-ea83-420c-b5b8-c0c2ea722dc6 --testnet-magic 1097911063","command":"/usr/local/bin/cardano-cli transaction submit --tx-file /tmp/6edd9e54-ea83-420c-b5b8-c0c2ea722dc6 --testnet-magic 1097911063","exitCode":1,"stdout":"","stderr":"Shelley command failed: transaction submit Error: Error while submitting tx: ApplyTxError [LedgerFailure (UtxowFailure (InvalidWitnessesUTXOW [VKey (VerKeyEd25519DSIGN (PublicKey \"\\158\\238W\\128\\184$:E\\231\\FSa\\152I$\\EM\\b\\134\\CAN\\140\\157N\\154\\238r\\EOT\\173\\204\\172c4cr\"))]))]","failed":true,"timedOut":false,"isCanceled":false,"killed":false,"msg":"[submitTransaction] Command failed","stack":"Error: Command failed with exit code 1: /usr/local/bin/cardano-cli transaction submit --tx-file /tmp/6edd9e54-ea83-420c-b5b8-c0c2ea722dc6 --testnet-magic 1097911063\nShelley command failed: transaction submit Error: Error while submitting tx: ApplyTxError [LedgerFailure (UtxowFailure (InvalidWitnessesUTXOW [VKey (VerKeyEd25519DSIGN (PublicKey \"\\158\\238W\\128\\184$:E\\231\\FSa\\152I$\\EM\\b\\134\\CAN\\140\\157N\\154\\238r\\EOT\\173\\204\\172c4cr\"))]))]\n at makeError (/cardano-rosetta-server/node_modules/execa/lib/error.js:59:11)\n at handlePromise (/cardano-rosetta-server/node_modules/execa/index.js:114:26)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)","type":"Error","v":1}
{"level":50,"time":1617119743910,"pid":106,"hostname":"530477839db5","reqId":1393,"msg":"Shelley command failed: transaction submit Error: Error while submitting tx: ApplyTxError [LedgerFailure (UtxowFailure (InvalidWitnessesUTXOW [VKey (VerKeyEd25519DSIGN (PublicKey \"\\158\\238W\\128\\184$:E\\231\\FSa\\152I$\\EM\\b\\134\\CAN\\140\\157N\\154\\238r\\EOT\\173\\204\\172c4cr\"))]))]","stack":"Error: Shelley command failed: transaction submit Error: Error while submitting tx: ApplyTxError [LedgerFailure (UtxowFailure (InvalidWitnessesUTXOW [VKey (VerKeyEd25519DSIGN (PublicKey \"\\158\\238W\\128\\184$:E\\231\\FSa\\152I$\\EM\\b\\134\\CAN\\140\\157N\\154\\238r\\EOT\\173\\204\\172c4cr\"))]))]\n at Object.<anonymous> (/cardano-rosetta-server/dist/src/server/utils/cardano/cli/cardanonode-cli.js:60:31)\n at Generator.throw (<anonymous>)\n at rejected (/cardano-rosetta-server/dist/src/server/utils/cardano/cli/cardanonode-cli.js:6:65)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)","type":"Error","v":1}
{"level":50,"time":1617119743910,"pid":106,"hostname":"530477839db5","reqId":1393,"code":5006,"retriable":true,"details":{"message":"Shelley command failed: transaction submit Error: Error while submitting tx: ApplyTxError [LedgerFailure (UtxowFailure (InvalidWitnessesUTXOW [VKey (VerKeyEd25519DSIGN (PublicKey \"\\158\\238W\\128\\184$:E\\231\\FSa\\152I$\\EM\\b\\134\\CAN\\140\\157N\\154\\238r\\EOT\\173\\204\\172c4cr\"))]))]"},"msg":"[errorHandler] An error ocurred and will be sent as response","stack":"Error: Error when sending the transaction\n at Object.exports.buildApiError (/cardano-rosetta-server/dist/src/server/utils/errors.js:86:56)\n at Object.sendTransactionError (/cardano-rosetta-server/dist/src/server/utils/errors.js:108:51)\n at /cardano-rosetta-server/dist/src/server/controllers/construction-controller.js:170:46\n at Generator.throw (<anonymous>)\n at rejected (/cardano-rosetta-server/dist/src/server/controllers/construction-controller.js:6:65)","type":"Error","v":1}
{"level":30,"time":1617119743911,"pid":106,"hostname":"530477839db5","reqId":1393,"res":{"statusCode":500},"responseTime":23.158724784851074,"msg":"request completed","v":1}