Feature Request: Consolidate node rewards

Is there any technical possibility to have the “Withdraw all rewards” button to automatically withdraw and transfer the rewards to a single keychain? If you have multiple nodes, the withdrawals are quite tedious.

Not the button but there is a solution that I use for a long time.

Please note that if you have a full node, you’re on the safe side for this solution. Others should consider that the fullnode owner may log their queries (possible private key exposure).

3 Likes

Thanks for this! I am in the process of trying it out, but I have to wait 5 more days before I can see it in action.

You could also just use the incognito-cli and the beta fullnode provided by the core team

#!/usr/bin/env bash

for key in $(ls /privatekeys/ | sort); do
  echo $key
  nanobalance=$(incognito-cli --host https://beta-fullnode.incognito.org/fullnode \
    balance --privateKey "$(cat /privatekeys/$key)")
  balance=$(echo "$nanobalance / 1000000000" | bc -l)
  if awk "BEGIN {exit !($balance > 9.0)}"; then
    toSend=$(expr $nanobalance - 100000000)
    echo "Balance: $balance"
    echo "Sending $(echo $toSend / 1000000000 | bc -l) PRV to consolidation address"
    incognito-cli --host https://beta-fullnode.incognito.org/fullnode send --address \
    <your consolidation address> \
    --amount $toSend --privateKey "$(cat /privatekeys/$key)"
  fi
done

You’ll have to submit your OTA keys first to see balances and index

#!/usr/bin/env bash

for key in $(ls /privatekeys/ | sort); do
  echo $key
  incognito-cli keyinfo --privateKey "$(cat /privatekeys/$key)" | jq -r .OTAPrivateKey | \
    xargs -I {} incognito-cli --host https://beta-fullnode.incognito.org/fullnode \
    sub --ota {} --isReset true \
    --accessToken 0ec910a54ffbf2a0bdfc0c8b05e8b5445e51a2ae54f659a35ac7ad9980e4fd2c
done

The incognito-cli does not send private keys to full nodes, only signatures, so it’s safe to use with external (still trusted) nodes.

4 Likes

Nice alternative. If I understand correct, you hit withdraw all in the app, and then this loop pulls them all together. Basically what I asked for. :grinning:

1 Like