EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.76k forks source link

Enhance `cleos get transaction_id` for exploded data #6830

Open heifner opened 5 years ago

heifner commented 5 years ago
cppfuns commented 5 years ago

Due to some problems, (guessing that a single nodeos pushed too many transactions) caused the transaction push to return timeout, but in fact the transaction has been pushed successfully. The solution I think of temporarily is that I hope to calculate the ID of the transaction in advance before the transaction is submitted, so that when the transaction is repeated, it is first determined whether the transaction ID already exists. After searching, I found that 'cleos get transaction_id ' (https://github.com/EOSIO/eos/issues/6830) seems to be the function I want, but testing different data, always returning the same id. I use the method problem? Or is this feature not used like this?

cleos get transaction_id 1e24d670f7c504c63184cc4be449f19685a2215f95d03aba7d61f4aac3c77eb8.json
374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb
cleos get transaction_id 53a7af39b92fc811b7ccae2e3602964fd21263162756f491cb875e80b5e7a886.json
374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb

1e24d670f7c504c63184cc4be449f19685a2215f95d03aba7d61f4aac3c77eb8.zip 53a7af39b92fc811b7ccae2e3602964fd21263162756f491cb875e80b5e7a886.zip

heifner commented 5 years ago

The develop version of cleos will give an error of:

07:21:08@heifnerk:~/ext/eosio/programs/cleos$ ./cleos get transaction_id 1.json
transaction json does not include 'actions'

The problem is your json includes more than a transaction object. Only give it the transaction object. See attached files.

1.json.txt 5.json.txt

07:22:48@heifnerk:~/ext/eosio/programs/cleos$ ./cleos get transaction_id 1.json.txt 
1e24d670f7c504c63184cc4be449f19685a2215f95d03aba7d61f4aac3c77eb8
07:23:21@heifnerk:~/ext/eosio/programs/cleos$ ./cleos get transaction_id 5.json.txt 
53a7af39b92fc811b7ccae2e3602964fd21263162756f491cb875e80b5e7a886
cppfuns commented 5 years ago

I am bothering again, I want to use java to calculate the offline transaction id, but the actual calculation is inconsistent with the return of the chain, can you help me see it?

https://github.com/bcskill/eos-client/blob/9cfc6ebb00bd857f3dec68de7c79d69ab6b1f742/src/main/java/pe/freeopen/eosclient/EosClient.java#L60

heifner commented 5 years ago

You might find this helpful: https://github.com/EOSIO/eosio-java