Getting an error from ABI when building the indexer #1329
-
IssueThanks for opening an issue on the Fuel Indexer project. *If you're an internal FuelLabs contributor, please feel free to remove this template when creating issues, as this template is meant for external users and contributors. Prerequisites
DescriptionWhen calling the Steps to ReproducePlease list the steps required to reproduce your issue in detail.
Expected behavior: The indexer builds🤞🏾 Actual behavior: We get the error in the attached image: Things we've tried: The next thing we tried was moving all the relevant code from a library in a separate Forc project to the same Forc project as the contract that is doing the logging. Things we think it could be: Things we will try: VersionsPlease list what version of indexer
|
Beta Was this translation helpful? Give feedback.
Replies: 16 comments
-
@Walter-Phillips: Do you have a link to a repository? I try not to download files if I can help it. 😅 That being said, I think I've seen something similar to this in the past and I'm starting to look into it. |
Beta Was this translation helpful? Give feedback.
-
@deekerno that's fair, I can add you to our repo. The indexer_fix branch should have everything you need. You may have to change the path to the abi on your machine. To build the contracts you can run |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips Sounds great. You can add @ra0x3 as well so that we're both able to take a look. |
Beta Was this translation helpful? Give feedback.
-
@deekerno @ra0x3 just sent you both an invite, it's in the sail-indexer folder in packages. It's the order-logger ABI that we are using. We appreciate you guys looking into it.🙏🏾 |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips, do you mind trying the following for me?
We made some adjustments to how users should define entity types, but it wasn't in the documentation yet; coincidentally, I have a PR up for it right now. I was able to build your indexer following those steps. Let me know if they work for you. 🙏🏽 |
Beta Was this translation helpful? Give feedback.
-
@deekerno I tried it with our repo and got the error below. I also created a new indexer project following the steps you gave. I tried it with To be clear it built on the indexer_fix branch? I've been able to get it to run on main but that doesn't have a lot of our new changes. |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips Ah, I missed the Also, in your Cargo manifest on your indexer, you're using |
Beta Was this translation helpful? Give feedback.
-
@deekerno Most of our up-to-date code is beta-4 compatible. Considering beta-4 is happening soon👀, I'd be happy with just using the latest toolchain and making our indexer beta-4 compatible now, if that's possible. If not happy to use |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips Heard that. You'll just be unable to test indexing beta-4-specific things on a contract until either the beta-4 network is deployed or you deploy a local Fuel node of your own that supports said beta-4 stuff (which I haven't tried on my own, so YMMV). The good news is that when beta-4 is released, you can just upgrade your dependencies to the latest versions and everything should just workTM; all the necessary changes to the indexer should be transparent to the user. |
Beta Was this translation helpful? Give feedback.
-
@deekerno Makes sense. Please let me know when the patch gets merged if possible. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips #1315 will fix the issue that you shared initially. When building your contract with the latest Sway version, I was unable to replicate the invalid identifier error as the ABI JSON output seems to have improved. That being said, we're going to merge this into our |
Beta Was this translation helpful? Give feedback.
-
@deekerno All good with using the newest version, would that be 0.20.5? |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips It would be the next patch release; I can start that process now. I've confirmed that #1315 fixed your original issue. However, it appears that your contract is using generics; unfortunately, the indexer currently does not support Sway generics (due to some SDK difficulties) and will not build when they're present in the ABI. |
Beta Was this translation helpful? Give feedback.
-
@deekerno I can edit the contract to not use generics for now and revert when that fix gets added. Sounds great otherwise. Appreciate you. The quick responses have been greatly appreciated. |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips No problem. I'm glad that we could fix your issue! v0.20.7 has the fix that you need; setting |
Beta Was this translation helpful? Give feedback.
-
@Walter-Phillips, I'm going to close this issue. If this wasn't resolved correctly, feel free to reopen and continue the conversation. And as always, feel free to open up an issue if you have any other questions. Cheers! |
Beta Was this translation helpful? Give feedback.
@Walter-Phillips It would be the next patch release; I can start that process now. I've confirmed that #1315 fixed your original issue. However, it appears that your contract is using generics; unfortunately, the indexer currently does not support Sway generics (due to some SDK difficulties) and will not build when they're present in the ABI.