Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse signed transaction error #525

Open
ddxx5317 opened this issue Jan 22, 2023 · 8 comments
Open

Parse signed transaction error #525

ddxx5317 opened this issue Jan 22, 2023 · 8 comments
Labels
question Further information is requested

Comments

@ddxx5317
Copy link

Ask a question

I use the serialization library to sign a transaction, and then use the construction/submit endpoint of rosetta-api to broadcast the hex signature data, but it returns "Parse signed transaction error"

eg:

// build tx
const txBody = txBuilder.build();
const txHash = CardanoWasm.hash_transaction(txBody);
const transaction = CardanoWasm.Transaction.new(txBody, witnesses, undefined);
const txHex = Buffer.from(transaction.to_bytes()).toString("hex");

// send txHex
curl -X POST 'localhost:8888/construction/submit'
-H "Content-Type: application/json"
-d '{"network_identifier": {"blockchain": "cardano","network": "mainnet"},"signed_transaction": txHex}'

return:
{
"code": 5003,
"message": "Parse signed transaction error",
"retriable": false
}

What's the problem ? Does Rosetta not support transactions signed with serialization libraries?

@ddxx5317 ddxx5317 added the question Further information is requested label Jan 22, 2023
@sc-starman
Copy link

same here, I use wallet-core library to sign the transaction and broadcast it using rosseta

@zhanghuize-git
Copy link

Hi bro, are you solve it ?

@Godspeed-exe
Copy link
Collaborator

Rosetta expects a specific format, for that reason it’s advised to go through the entire process using Rosetta (query, construct , sign, submit).

Do you use any of the above functionalities of Rosetta? If not, you might as well submit it by connection a submit-api to your node socket,

Of course, you can reverse engineer the Rosetta format, you’ll you have to wrap your CBOR in the Rosetta JSON envelope and then CBOR encode it again.

@Kartiiyer12 @linconvidal I believe we have examples of this somewhere?

@Kartiiyer12
Copy link
Collaborator

Hi @zhanghuize-git

It would be easier to build submit api within the cardano-rosetta image and use that to submit transactions.

To add submit api within the existing Dockerfile -

{
      name: 'cardano-submit-api',
      script: '/usr/local/bin/cardano-submit-api',
      args: [
        '--config', '/config/cardano-submit-api/config.json',
        '--socket-path', '/ipc/node.socket',
        '--port', '8090',
        '--listen-address', '0.0.0.0',
        '--mainnet'
      ],
      autorestart: true,
      exec_mode: 'fork_mode',
      kill_timeout : 30000,
      error_file: 'NULL',
      out_file: 'NULL'
    },

  • At last when running the rosetta, make sure you run the docker to expose both the rosetta and the submit-api port.
docker run --name cardano-rosetta -d -p 8080:8080 -p 8090:8090 -v cardano-rosetta:/data \
  --shm-size=2g \
  cardanofoundation/cardano-rosetta:2.3.3

@zhanghuize-git
Copy link

Thanks for the replies guys, I'm using the cardano-rosetta api for the whole process, and after much exploration I realized that it's the signing that's the problem.

@Godspeed-exe
Copy link
Collaborator

Good to hear! Let us know how to help!

btw, if you are working with an exchange with can also support you directly through a dedicated channel. Let me know if that’s useful to you!

@zhanghuize-git
Copy link

I am a exchange wallet devloper, our product need support cardano chain.

@Godspeed-exe
Copy link
Collaborator

hello @zhanghuize-git

can you reach out to [email protected] ? We're happy to set up a dedicated channel to smoothen the support with your team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants