Get epoch rewards for a block from node. #2256
Replies: 8 comments 1 reply
-
Hey @shaswatsaloni, could you please check out this repo for an explainer on how epoch transactions work and how to fetch them. |
Beta Was this translation helpful? Give feedback.
-
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 When i am calling the POST method for this particular block: { 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, |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
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, |
Beta Was this translation helpful? Give feedback.
-
We provide an RPC API in Celo Explorer, if that works for you (search for
|
Beta Was this translation helpful? Give feedback.
-
Yes, this i have. I just wanted to query my node if its at all possible? |
Beta Was this translation helpful? Give feedback.
-
Yeah, unfortunately, there is no easy way, you'd have to fetch epoch blocks and perform calculations described in the explainer manually. |
Beta Was this translation helpful? Give feedback.
-
Hi @carterqw2 , from this RPCAPI https://explorer.celo.org/mainnet/api?module=epoch&action=getvoterrewards&voterAddress=0x9efecf85d7e668c0c3c7a778a1164b064234f96d, we are getting the rewards based on the address. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi Team,
I have a rosetta as well as archival Celo Node. There i am getting the normal transactions with the query:
{
"method": "eth_getBlockByNumber",
"params": [
"0x556E00", //blocknumber
true
],
"id": 1,
"jsonrpc": "2.0"
}
But here the epoch transactions are not present, by which i want to have the voting rewards.
But if i want to query the rosetta or archival node for this epoch transactions/rewards, how would i get that?
@eelanagaraj could you please help us here.
Thanks,
Saloni
Beta Was this translation helpful? Give feedback.
All reactions