Hi, are there some best practicies how to search the whole blockchain for some data?
I am getting timeout for searching for specific amount with limit 1, so I assume there is a bug in the indexer. I have filed the bug report here, so hopefully someone will check it out…
To search the blockchain by the amount should be the basic feature that the blockchain apis provides… Am I wrong with my opinion?
What should be considered as best practice? Should i search with minround and maxround? What is recommended round amount in one search? If these ints are properly indexed, why the amount int is not?
Can you link the issue here?
What exact query did you try?
The indexer uses an SQL database behind the scenes.
Every query you make is converted to an SQL query.
Indexes have been chosen to quickly answer usual queries.
But some queries may require you to manually add indexes.
The reason is: adding indexes is a tradeoff.
When you have more indexes, you can answer more queries faster, but on the other hand, inserting new transactions take more time and the database grows significantly.
I dont want to have indexer running. (I expect from the blockchain network to provide some basic free tools to operate on it)
However I have not seen the response in your answer… What is the best practice to search the network? If the answer was that every developer should run the full archvial node and full indexer node and he should modify it for his need I hope i read it wrong…
I haven’t looked at the details but it may indeed be a lack of index.
Do you have an example of dApp or use where you would need such a query?
The issue with indexes is that they are a complex trade-off. Adding more of them is very costly in terms of storage and time to add new transactions.
If you have a concrete use case that absolutely needs it, I would recommend commenting on your Github issue.
There is no real means of searching the blockchain, and only thing how it can be solved is the custom asset or have the amount indexed properly… I do not consider the search by note prefix as effecient enough because it never can be indexed properly by the current databases, but to index by the amount it is very possible, but it needs to be indexed…
Index by the tx amount can be usefull for a lot of usecases… this is just one of them…
We’ve actually been working on facilitating such a use case: finding transactions related to a specific dApp, by providing a special format for the note field:
It is not yet implemented in the indexer but once the proposal is finalized, the goal is to allow the indexer to easily filter such transactions.
No, because i do not want to have dapp… I want to search the blockchain for the note field not related to any application…
I agree that the search over the applications should also be improved, for example by searching by the hash of approval program. This is not related to this thread thou, so if you feel start the new thread for this… i have created github issue for this in the indexer, so perhaps you can reply there…
Sorry, the term dApp above is confusing.
It is to be understood in a very large sense.
It includes anything making transactions to the blockchain.
It does not restrict to smart contracts at all.
Yes, that’s the goal that indexer and blockchain explorers would support it.
It can be a good idea to allow for compressed data. A very naive question I have (I really did not look at it) is whether there exist compression algorithm that would work well with such a small output restriction (1kB). For example, compression “Hello” using zip on my computer yields a file of size 168B.
So I’m wondering whether compression would help that much if you’re limited to 1kB output.
the fast protocol is meant to do templating of predefined messages… so you know that the first 8 fields are boolean, so you use only one byte for the raw data… it is being used for example in the exchange systems to provide market data feeds and more… there is not much compression over text, but i can imagine that with additional meta data stored elsewhere other effecient compression methods might exists
the 1 byte plus few bytes to identify the template id versus json 86 bytes {“a1”:true,“a2”:false,“a3”:true,“a4”:false,“a5”:true,“a6”:false,“a7”:true,“a8”:false}
is quite significant…