dipdup
dipdup copied to clipboard
Fetch Cairo ABIs from node
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
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
can I work on this please
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
I have a strong background in software engineering, particularly in blockchain development, backend systems, and decentralized platforms. With over 5 years of experience working on various projects using technologies like Ethereum, Lisk, and smart contract platforms, I’ve gained a deep understanding of how decentralized systems operate. I’ve worked extensively with smart contract development on both Ethereum and Lisk, implementing ERC-721 and ERC-1155 standards and integrating IPFS for decentralized storage. My experience with blockchain indexing and API design also makes me well-suited to working on automating ABI fetching, as I’ve had to solve similar problems in past projects where data needed to be fetched and processed dynamically from nodes or external sources. With my hands-on experience in blockchain systems and API automation, I’m confident that I can streamline the process of acquiring and integrating Starknet ABIs into the project. I can also contribute to improving performance and cost-efficiency by leveraging my experience with decentralized nodes, allowing the project to avoid expensive API dependencies. I’m excited about the opportunity to bring my experience to this project and help build a more efficient solution for Starknet ABI indexing. I believe my background uniquely positions me to tackle the challenges ahead and drive the project forward.
How I plan on tackling this issue
I would use starknet-py, a Python library that simplifies interaction with Starknet nodes, to connect to the node and issue queries for the contract ABI. The starknet_getClass RPC method, for example, retrieves information about a given class (contract), including the ABI. I would write a function that sends a request to the Starknet node, using a contract address to fetch its associated ABI. This would allow the system to automatically retrieve ABIs whenever required, eliminating manual uploads. To ensure scalability and performance, I would implement caching mechanisms (using Redis or a similar store) so that previously fetched ABIs don’t require repeated requests to the node.
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
With experience in fullstack development with python libraries and blockchain langage like solidity, with experience in Python and blockchain development, I can automate ABI extraction, saving time and reducing costs.
How I plan on tackling this issue
To fetch Cairo ABIs from StarkNet nodes, I would create a Python script using requests to query node endpoints for ABI details. The script would parse the response and save the ABIs automatically, avoiding the need for expensive external APIs and keeping the data updated
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
I have experience building an EVM explorer / indexer so I have a good understanding of what needs to be done. https://github.com/walnuthq/op-scan I also have experience in the Starknet ecosystem.
How I plan on tackling this issue
I will use starknet-py to fetch the contract ABI from the RPC full node and use it instead of adding it manually.
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
Hello, I am Manuel, a process engineer and web3 developer. I have participated in Starknet Bootcamps, ETHGlobal and am an Elite winner of Speedrunstark. I have a high capacity to solve problems. I am a member of the DojoCoding community. I hope this issue is assigned to me. I am available to work immediately to achieve what is required in the shortest time possible.
How I plan on tackling this issue
To address the requirements of the issue, I will:
- Implement a solution to acquire Cairo ABIs directly from the Starknet Node instead of manually adding ABI JSON files.
- Investigate the most efficient way to request and fetch the ABI data from the Node, ensuring compatibility with the existing indexing process.
- Optimize the retrieval to avoid unnecessary external API calls, minimizing costs and dependencies on services like Starkscan.
- Test the ABI retrieval functionality to ensure accuracy and proper integration with current Starknet indexers.
I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
I am a python dev. A new-comer here, ready to solve the issue with my expertise.
Hi @droserasprout is this open, would love to complete it.
@JoE11-y We do not participate in any bounty programs at the moment of writing. But carefully crafted pull requests are always welcome.
Alright sounds good though.
On Wed, Oct 23, 2024, 1:05 PM Lev Gorodetskii @.***> wrote:
@JoE11-y https://github.com/JoE11-y We do not participate in any bounty programs at the moment of writing. But carefully crafted pull requests are always welcome.
— Reply to this email directly, view it on GitHub https://github.com/dipdup-io/dipdup/issues/1108#issuecomment-2431905892, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANGCG5WCJXZRSGJYF65RL5DZ46GITAVCNFSM6AAAAABOQPL3Q2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZRHEYDKOBZGI . You are receiving this because you were mentioned.Message ID: @.***>
@dmirgaleev May I try to implement this?
@baitcode You're very welcome! But first let us the team meet after the holidays to discuss release schedule and review your previous submission.
@droserasprout Any update?
@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.
@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.
@droserasprout Do I understand correctly, that implementing starkscan datasource is not required (for some reason I though it is).
@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?
@droserasprout Can you provide any guidance or outline general approach how to test the workflow I've created?
@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.
I've been able to figure the test out.
I've installed dipdup from my local repo using installed script with --path argument specified.
@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 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.j2file, then runmake demos DEMO=demo_starknet_events. If it goes well,tests/test_demos.pywill stay green.
@droserasprout Done!