Closed mahdi13 closed 2 years ago
Hi @mahdi13,
Have you created the transaction payload using Rosetta construction API or you just crated it on your own and tried to send it using construction/submit
?
@AlanVerbner I created and signed it myself. So, is it the problem? If so, isn't there any way for submitting a raw signed transaction through rosetta API? Because it's the case for many people who create and sign their transaction offline, or somewhere else, thanks
@mahdi13 basically Rosetta (not just this implementation but in general) was not meant to be used as a raw transaction sender API without invoking the construction workflow. The main reason is it requires some extra-data to be added when sending the transactions due to it's offline operation nature which is appended on each request payload from previous calls (sorry I cannot find the source in the Rosetta spec or the forum atm).
That being said, I guess you have two options:
@AlanVerbner Thanks for the great explanation. Now I understood the matter, and I found the description on your docs: https://github.com/input-output-hk/cardano-rosetta/blob/faf36526fcd0630f2c20e27f71f750356dbf6807/docs/rosetta-custom-definitions.md#encoded-transactions
As an urgent solution, for the ones who are really stuck, there is a dummy workaround, which is to add a mock payload as the second's parameter:
82
as it's prefix and 36a16a6f7065726174696f6e7380
as it's suffix/construction/submit
API.Again: It's a very bad, experimental, non-tested, non-secure, dangerous, traceable, this-version-only solution!!
Assuming I try to call the
construction/submit
API to submit a raw signed transaction. Something like :I get this error everytime:
When I tried to find out what is going on inside the controller of rosetta, I checked the temp file (For example in the previous request
/tmp/f5644e5b-148c-456f-aa1a-29473f3fb3e5
) and it was like:Instead of
So it was reasonable that
cardano-cli
was not able to parse that.A fast (an non-reliable) workaround to fix is urgency. was to change https://github.com/input-output-hk/cardano-rosetta/blob/5cd02e36581788a03eab76fa40e2a93a0e6141e0/cardano-rosetta-server/src/server/controllers/construction-controller.ts#L278 to
and it fixed it temporarily.
But I think there is something wrong. Am I doing the API call the wrong way or is it a bug or what?
Thanks