0

Can I get txn hash without injecting operation in block chain? After injecting I will get same txn hash?

0

You can forge operations remotly using a node, with the rpc : /chains/main/blocks/head/helpers/forge/operations. This is a POST request, you have to give a json file like: { "branch" : block_hash, "contents" : operation list}. Operation type is a bit tricky, you can find some documentation in http://tezos.gitlab.io/mainnet/api/rpc.html#post-block-id-helpers-forge-operations. So the hash of the operation depends on the "branch" which is normally taken as the head hash. If you inject it with the same "branch" it will have the same hash, but be careful since the "branch" becomes invalid after 64 levels. If you are using the client, you can also use the transfer command with the -D option as "dry-run", that will do all the work of forging and checking but only do a fake injection.

  • After you forged an op you have to sign it, append the signature to the data vector, take blake2b hash (32 bytes) of it, prepend 0x0574, and base58 encode the result. – Michael Zaikin Aug 6 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.