eos icon indicating copy to clipboard operation
eos copied to clipboard

Why does not push_transaction(rpc) receive json type transaction?

Open egonson opened this issue 8 years ago • 2 comments

'cleos push transaction' can receive the json type transaction as input. But push_transaction rpc can't. "error":{"code":3010010,"name":"packed_transaction_type_exception","what":"Invalid packed transaction","details":[]}

I found push_transaction needs packed_trx input and that can be generated by eosjs library.

My question is that

"Is there a plan to have push_transaction rpc receive the json type transaction as input?" and if so, when?

egonson avatar Jul 24 '18 07:07 egonson

The RPC push_transaction interface once accepted JSON transactions. That functionality was removed, at least partially for performance reasons. Marshalling and unmarshalling JSON is relatively expensive in CPU time, putting unnecessary limits on transaction execution time.

Since it was removed, that functionality is unlikely to be restored. The existing two step process to first pack and then submit a transaction will remain.

jgiszczak avatar Jul 25 '18 22:07 jgiszczak

I wrote an eos java library that generates packed_trx used in push_transaction. https://github.com/egonson/eosjpacker Anybody can use it for free.

egonson avatar Aug 28 '18 09:08 egonson