GithubHelp home page GithubHelp logo

Comments (7)

carterqw2 avatar carterqw2 commented on June 13, 2024

Hey @shaswatsaloni, could you please check out this repo for an explainer on how epoch transactions work and how to fetch them.

from celo-blockchain.

shaswatsaloni avatar shaswatsaloni commented on June 13, 2024

Hey @carterqw2 , that repo was really helpful, thanks.

One more query here, i want to get the epoch rewards for the address : 0x9efecf85d7e668c0c3c7a778a1164b064234f96d

So, here i can see it has epoch transactions in block: [5598720]

the explorer link : https://explorer.celo.org/mainnet/address/0x9efeCf85d7E668c0C3c7a778A1164b064234f96d/epoch-transactions

image

When i am calling the POST method for this particular block:

{
"method": "eth_getLogs",
"params": [
{
"fromBlock": "0x556E00",
"toBlock": "0x556E00"
}
],
"id": 1,
"jsonrpc": "2.0"
}

I am not able to find the particular address (0x9efecf85d7e668c0c3c7a778a1164b064234f96d) in the response JSON.

how would i calculate and get the epoch rewards here?

Thanks,
Saloni

from celo-blockchain.

carterqw2 avatar carterqw2 commented on June 13, 2024

Hi @shaswatsaloni! You're trying to get individual voter rewards, please refer to this section of the explainer for more details. Celo Explorer has to perform additional calculations to be able to display individual voter rewards that are not directly available through logs. I hope that helps.

from celo-blockchain.

shaswatsaloni avatar shaswatsaloni commented on June 13, 2024

Okay, understood.

So, there is no simple way that we an fetch epoch transactions/ voting rewards for a celo address.

And, is there any way we can get the epoch transactions for an address instead of a block.

Thanks,
Saloni

from celo-blockchain.

carterqw2 avatar carterqw2 commented on June 13, 2024

We provide an RPC API in Celo Explorer, if that works for you (search for getvoterrewards).

https://explorer.celo.org/mainnet/api?module=epoch&action=getvoterrewards&voterAddress=0x9efecf85d7e668c0c3c7a778a1164b064234f96d

curl -X GET "https://explorer.celo.org/mainnet/api?module=epoch&action=getvoterrewards&voterAddress=0x9efecf85d7e668c0c3c7a778a1164b064234f96d" -H "accept: application/json"

from celo-blockchain.

shaswatsaloni avatar shaswatsaloni commented on June 13, 2024

Yes, this i have. I just wanted to query my node if its at all possible?

from celo-blockchain.

carterqw2 avatar carterqw2 commented on June 13, 2024

Yeah, unfortunately, there is no easy way, you'd have to fetch epoch blocks and perform calculations described in the explainer manually.

from celo-blockchain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.