Closed urosh closed 2 years ago
Actually, I managed to get this working.
I did two things that made difference:
block
section of the node configuration I updated proposalExpireTime
and set the value to 5 minutes. The default value is 3 days. It speeds up things when having to approve proposals. allowChangeDelegation = 1
in the configuration of the committee didn't work. So figured out that this needs to be changed by submitting and voting on the proposal. With these 2 steps even without changing the ratio, I am getting the rewards data from the getRewards
API.
I will play around and update if I find anything else.
Just checked, had to follow these 2 steps to be able to see rewards in getRewards
API. Only after the proposal passed, rewards started appearing. Might be useful for someone. Not sure, why is it happening in this way?
thanks for your sharing, it is very helpful.
Just checked, the proposal item should be changedDelegation
, not allowChangeDelegation
. you can find all the configuration item from here: https://github.com/tronprotocol/java-tron/blob/develop/common/src/main/java/org/tron/common/parameter/CommonParameter.java#L352
the configurations should like below:
committee = {
allowCreationOfContracts = 0 //mainnet:0 (reset by committee),test:1
allowAdaptiveEnergy = 0 //mainnet:0 (reset by committee),test:1
changedDelegation = 1
}
I will check it out, as it would make life easier. I think i tried with changeDelegation
and that didn't work.
Yep, setting changedDelegation = 1
in committee
allows you to change the brokerage ratio out of the box, and rewards are shown when calling the getRewards
API. So no need to submit a proposal and vote, and go through all this.
1. What did you do?
I am running three private nodes. One default SR comes from the genesis file.
Another one that I applied for using applyForSR smart contract.
Another node I run as SR using witness permission change logic. I modified the witness permission of the node SR account.
All three nodes are receiving rewards.
I created one account and voted for 2 nodes.
2. What did you expect to see?
When calling getReward API using tronweb I am always getting 0 in response both for SR or for vote account.
For SR i can claim rewards though but when trying to check pending rewards I am not able to do so.
For the vote account, I am not able to claim rewards, even though brokerage is set to default 20%.
3. What did you see instead?
When making a call to the
walllet/withdrawbalance
endpoint of the node i am gettingwitnessAccount does not have any rewards
for the vote account.This happens after almost three days of constant running of the nodes. Does the 3 days freeze period affect this, or I should be able to see the rewards as soon as the vote is cast, and the SR receives block rewards?
Also why is the
getReward
API using tronweb returning 0 in all cases?