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

Data tile BE: Transactions burning most steps #7

Closed
mazurroman opened this issue May 20, 2024 · 7 comments · Fixed by walnuthq/starkflare-indexer#2
Closed

Data tile BE: Transactions burning most steps #7

mazurroman opened this issue May 20, 2024 · 7 comments · Fixed by walnuthq/starkflare-indexer#2

Comments

@mazurroman
Copy link
Contributor

mazurroman commented May 20, 2024

Feel free to join our telegram to get latest updates: https://t.me/+DYI4FMia43I1NDI8

Update the get_common_data function in the https://github.com/walnuthq/starkflare-indexer backend repo to include a new field in the response called top_transactions_by_steps. This field should contain a list of the top 10 transactions that consumed the highest amount of steps over the last 7 days.

For each transaction in the top_transactions_by_steps list, include the following data:

  • Transaction hash
  • Number of steps consumed
  • Timestamp of the transaction
  • Block number in which the transaction was included

Implement a new function to retrieve this data and call it from within the get_common_data function.

Note: The top_transactions_by_steps field should be added to the existing response format of get_common_data without modifying the other fields.

The exact data format as well as more instructions defined in: #8

@khayss
Copy link

khayss commented May 22, 2024

Can I work on this issue?

@princeibs
Copy link

Can I hop on this?

@mazurroman
Copy link
Contributor Author

None of the comments contains any specifics on how to resolve the issue. We are keeping it open for anyone to grab

@fishonamos
Copy link

I am Backend dev. To solve this, I will create a new function to query the database for the top 10 transactions consuming the highest steps over the last 7 days. I will also update the get_common_data function to call this new function and include the retrieved data in the response. @mazurroman

@adrianvrj
Copy link

Hello, my name is Adrián Vargas, I am a passionate developer introducing himself to the web3 world, I am currently a machine learning developer for HPE and I really enjoy coding. I would approach this issue as following:

Understand Requirements: Carefully read and understand the requirements outlined in the issue #8. Understand what needs to be achieved and how the new field should be added to the response format.

Review Existing Code: Go through the existing codebase, specifically the get_common_data function in the starkflare-indexer backend repository. Understand how the function is structured and how it currently generates the response.

Identify Data Source: Determine where the data for the new field, top_transactions_by_steps, will be sourced from. This may involve querying transaction data from the blockchain or accessing a database where transaction information is stored.

Implement New Function: Create a new function, let's call it get_top_transactions_by_steps, to retrieve the required data. This function should fetch the top 10 transactions that consumed the highest amount of steps over the last 7 days. Each transaction should include the transaction hash, number of steps consumed, timestamp, and block number.

Modify Response Format: Update the get_common_data function to include the new field top_transactions_by_steps in its response format. Ensure that this modification does not affect the existing response format or other fields returned by the function.

Integrate New Function: Call the get_top_transactions_by_steps function from within the get_common_data function. Populate the top_transactions_by_steps field with the data retrieved from this function.

Test: Test the modified get_common_data function to ensure that it returns the expected response format with the new field included. Verify that the top_transactions_by_steps field contains accurate data for the top 10 transactions consuming the highest amount of steps over the last 7 days.

@barabanovro
Copy link
Contributor

Hi everyone! Thank you for your interest and comments. We have assigned this issue to @adrianvrj, who provided the most detailed response.

@adrianvrj
Copy link

adrianvrj commented May 24, 2024

Hi, I just created a pr in the indexer repo.

walnuthq/starkflare-indexer#2

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

Successfully merging a pull request may close this issue.

6 participants