-
Notifications
You must be signed in to change notification settings - Fork 66
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
How to index transaction of predicate execution? #1155
Comments
The ideal situation would be:
No idea if this is possible currently |
Followup up from what @dmihal mentioned, it looks like the first case is already being covered here in the OP with the event Is the problem with 2&3 that we don't have an easy way to subscribe to particular predicate roots? Couldn't your indexer module just scan all the txs in each block to look for previously announced roots? |
|
One potential issue is that predicate roots may be unique for each particular order, as they need to commit to the wallet address of the person who has the capability to perform cancellation logic. So they need a way to track predicate roots that are generated on the fly by a script transaction. The part I don't understand is why we're unable to find the matching predicate roots even when scanning through all the transaction brute force, as this should be possible without any new features from the indexer. We likely need to run their code locally to find the issue. |
This is actually true @chlenc, this ☝🏽 requires no updates from the indexer, and can be done today. @chlenc Do you have a repository that I can pull down to check this? As well as possible steps to reproduce what you're trying? Hopefully this might be a quick PR I can push to your repo. |
Repo: compolabs/spark-indexer To run the indexer
Here you need open a new terminal window in
After that, in shell window #1 you can see that output
That is a creation of order, so it means that predicate tx will be in the next block. I’m using logs inside an to trigger the indexer you can use this test: |
Sweet thanks for this @chlenc you should hear from me shortly :) . |
Ok ser, thanks 🫡 |
Gonna close this, as this work is tracked in #886 |
Hello everyone,
I am currently working on indexing transactions that occur when an order by predicate is being fulfilled. For this purpose, I have implemented an indexer, and you can find the code here: spark-indexer/src/lib.rs
The goal of my indexer is to capture transactions that indicate when my predicate order was fulfilled. However, when running the indexer, I am only able to see details of the predicate creation in my logs, such as:
While this information shows that funds were transferred to the predicate root, I am interested in capturing the transaction where my predicate was fulfilled and the required exchange tokens were transferred. In my current logs, this information is not being captured.
The specific block height where the required transaction occurs is 1664943.
To test the order creation and fulfillment, I run the following tests in my code:
Order creation: fulfill_order_test.rs#L143
Order fulfillment: fulfill_order_test.rs#L157
I am hopeful that someone can provide insight into whether it is possible to index the transaction I am looking for, and if so, I would greatly appreciate an example of code that demonstrates how to achieve it. Thank you, and I am eagerly looking forward to your reply.
The text was updated successfully, but these errors were encountered: