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

Fetch Cairo ABIs from node #1108

Closed
droserasprout opened this issue Sep 19, 2024 · 21 comments · Fixed by #1202
Closed

Fetch Cairo ABIs from node #1108

droserasprout opened this issue Sep 19, 2024 · 21 comments · Fixed by #1202
Assignees
Labels
feature New feature or request

Comments

@droserasprout
Copy link
Member

droserasprout commented Sep 19, 2024

Currently Starknet indexes require adding ABI JSON manually. Starkscan has ABIs too, but API access is expensive af (we could parse them from webpage like in #1102). In Starknet you can acquire Cairo ABI from Node

@droserasprout droserasprout added feature New feature or request TBA: gfi labels Sep 19, 2024
@droserasprout droserasprout mentioned this issue Sep 19, 2024
18 tasks
@CollinsC1O

This comment was marked as outdated.

@georgegoldman

This comment was marked as spam.

@Ndifreke000

This comment was marked as outdated.

@saimeunt

This comment was marked as outdated.

@MPSxDev

This comment was marked as outdated.

@tosoham

This comment was marked as outdated.

@JoE11-y
Copy link
Contributor

JoE11-y commented Oct 22, 2024

Hi @droserasprout is this open, would love to complete it.

@droserasprout
Copy link
Member Author

@JoE11-y We do not participate in any bounty programs at the moment of writing. But carefully crafted pull requests are always welcome.

@JoE11-y
Copy link
Contributor

JoE11-y commented Oct 23, 2024 via email

@baitcode
Copy link
Contributor

baitcode commented Jan 4, 2025

@dmirgaleev May I try to implement this?

@droserasprout
Copy link
Member Author

droserasprout commented Jan 4, 2025

@baitcode You're very welcome! But first let us the team meet after the holidays to discuss release schedule and review your previous submission.

@baitcode
Copy link
Contributor

@droserasprout Any update?

@baitcode
Copy link
Contributor

@droserasprout

I've been researching trying to find vector to start implementing and realised that I don't understand src/dipdup/datasources/abi_etherscan file and comment. Is this one going to be removed? Shall I create abi_starknet and implement logic needed there or shall I just extend abi starknet_starkscan (to fetch and parse pages) and starknet_node to fetch abis.

@droserasprout
Copy link
Member Author

@baitcode Renaming abi.etherscan to evm.etherscan is just about naming, nothing else. We wanted all datasources to match the {network}.{name} schema, making it more obvious that if it starts with evm it can be attached to evm indexes.

For this task you should extend existing datasources. During the codegen phase use the best combination of sources from the inventory or fail with a meaningful message if there's not enough.

@baitcode
Copy link
Contributor

@droserasprout Do I understand correctly, that implementing starkscan datasource is not required (for some reason I though it is).

@baitcode
Copy link
Contributor

@droserasprout If contract abi was configured manually, do I still need to fetch it from node api?
TO rephrase that what has more priority? Node Data or User Data?

@baitcode
Copy link
Contributor

baitcode commented Jan 30, 2025

@droserasprout Can you provide any guidance or outline general approach how to test the workflow I've created?

@droserasprout
Copy link
Member Author

@baitcode Currently, ABIs are included in the demo project and simply copied. You need to remove src/dipdup/projects/demo_starknet_events/abi/stark_usdt/cairo_abi.json.j2 file, then run make demos DEMO=demo_starknet_events. If it goes well, tests/test_demos.py will stay green.

@baitcode
Copy link
Contributor

baitcode commented Jan 30, 2025

I've been able to figure the test out.

I've installed dipdup from my local repo using installed script with --path argument specified.

@baitcode
Copy link
Contributor

@droserasprout For some reason to make dipdup init work I needed to follow a simlink (the one that points to project itself) one level down. What is the purpose of such linking?

Now everything tested.

@baitcode
Copy link
Contributor

baitcode commented Feb 1, 2025

@baitcode Currently, ABIs are included in the demo project and simply copied. You need to remove src/dipdup/projects/demo_starknet_events/abi/stark_usdt/cairo_abi.json.j2 file, then run make demos DEMO=demo_starknet_events. If it goes well, tests/test_demos.py will stay green.

@droserasprout
Done!

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

Successfully merging a pull request may close this issue.

9 participants