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

v2 API use algo get txId and get transaction by txid #190

Open
crossle opened this issue Nov 27, 2020 · 5 comments
Open

v2 API use algo get txId and get transaction by txid #190

crossle opened this issue Nov 27, 2020 · 5 comments
Assignees

Comments

@crossle
Copy link

crossle commented Nov 27, 2020

Have any method get the txId use /v2/blocks/xx , i dont wanna deploy the indexer node, only have the algo node.

@crossle
Copy link
Author

crossle commented Nov 30, 2020

Or calculate the txId base on /v2/blocks/xx txn ?

@crossle
Copy link
Author

crossle commented Jun 7, 2022

Any update?

@barnjamin
Copy link
Contributor

You should be able to get the txid from the SignedTransactionInBlock, after setting the appropriate values on the Transaction object (genesis hash/gensis id) then passing it to crypto.GetTxID

something like this:

t.Txn.GenesisID = b.GenesisID
t.Txn.GenesisHash = b.GenesisHash
txid := crypto.GetTxID(t.Txn)

@crossle
Copy link
Author

crossle commented Dec 21, 2022

But maybe the transaction not have GenesisID, because when make a transaction don't need fill the GenesisID

@pbennett
Copy link
Contributor

GetTxID works correctly.
Valid transactions always have the genesis id.
The various helpers that assemble the transaction headers set it for you from the passed in SuggestedParams struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants