Tagged Data API long time entry recovery

Hey guys,

I started working with the API in may of this year. Basically I wrote to and read some entries from the IGNIS test chain and everything was fine. Yesterday I tried again to read entries from the chain, but they seem to be gone.
I know that the attached data could be pruned after 24h in the testnet and 14 days in the livenet. But from what I experienced while working with the API, the entries where available for more than one month in the testnet.
I was also talking to other developers in the ardornxt slack channel and back than they told me, that there also exist archival nodes which keep the data even if it is pruned by other nodes. They also told me that I do not need to do something special to retrieve these entries via the API.

I tried using:

  • getAccountTaggedData
  • getAllTaggedData
  • getTaggedData

Using the first 2 API methods I received 0 results. Than I tried the last one with the fullHash entry from my wallet. This worked and returned the data of that entry.

But now I have no idea where to get all transactionFullHash values of one account from in an automated way. After requesting them via getTaggedData method they seem to stay in the storage of my node as they become available in the getAccountTaggedData method again.

Could this be done easier?
Is this API behaviour intended?

Any help is appreciated!

1 Like

I found a way to get all fullHash values for one account by using the accounts.getBlockchainTransactions method. This answers the question on how to get the entries for one account.

One question is still open: How do I get entries of accounts of which I do not know the accountRS?


This is the expected behaviour. Both getAccountTaggedData and getAllTaggedData return available data. That means only non-pruned transactions.

With getTaggedData you have the option to ask the node to fetch pruned transactions from the network (other archival nodes) by using retrieve=true. Once retrieved the transactions are in your node again so that’s why they show up on the first two API methods. But keep in mind that the pruning process on your node will delete that eventually.

As you already figured out you should use the generic transaction query APIs to find pruned transactions. Then you can go back to getTaggedData to retrieve that transaction.

About finding tagged data transactions for other accounts you can just use getExecutedTransactions and filter by type and subtype. For tagged data upload that’s 6 and 0.

Of course it would be much easier for you to operate a node as an archival node. That’s basically a regular node configured to never prune anything, so the first two API methods will always return all data.

1 Like

Hi sergi,

I checked the Transactions.getExecutedTransactions method but there I have to either specify sender or recipient. As far as I can see, tagged data transactions do not have a recipient.
So this opens the question on how do I get all transactions including other accounts to filter them?

Why does tagged data uploads have type 6 and 0? I’ve seen only type 6 so far. Or do you mean 6 as type and 0 as subtype?

I see, you’re right. Then I can only think of a block by block query. Using the getBlock API with includeTransactions=true and then parsing and filtering each transaction. You would need to extract child transactions full hash and use the getTransaction API to query the details of the transaction.

About the types you’re right, 6 is the type for tagged data and 0 is the subtype for data upload.