If the Hashrate (HR) is not enough to probably always have at least one share in the window PPLNS (WP), the HR will never be redirected to XvB node but always stay on P2Pool node.
**Default mode**: in part given to XvB node to be in the most possible round type and keep in P2Pool the rest of HR that will not impact the type of round (sHR for spared HR).
If miners outside the Gupaxx instance are mining on P2Pool for the same address, Gupaxx will send too much on P2Pool because it doesn't take extra HR outside his control into account.
To solve this issue, it will look at the sidechain estimated HR (eHR) from status command of P2Pool. It is an estimation based on passed discovered shares, their difficulty, the number of blocks between them etc...
If miners outside the Gupaxx instance are mining on XvB for the same address, Gupaxx will maybe send too much (more than enough for the round) or too less (could have been in better round) on XvB.
To solve this second issue, it will remove from the required HR to get to rounds the average HR sent to XvB (retrieved by XvB API) minus what he is sending of its own.
**Default mode**: 6 minutes are given to P2Pool and 4 for XvB.
Because to have at still one share per window, gupaxx need to complete the already existent HR on P2Pool with 4 minutes (2kH/s). But after that, it still have 6 minutes spared (3kH/s) when only 4 minutes are needed to gain the better round of vip donor (10kH/s). So it will send only the necessary 4 minutes to XvB and give the 2 minutes not needed to P2Pool.
P2Pool node (PN) local API show only found shares and not current.
Gupaxx process will check frequently the output of the P2Pool command "status" without impacting the console output of the P2Pool tab to get the current shares.
### know oHR on P2Pool
Gupaxx watch for sidechain HR for his address on the output of status command of P2Pool in a way that do not disturb the output of console in the UI.
Gupaxx will simply watch the values retrieved by XMRig process.
### Switching HR from P2Pool node to XvB node
The mHR is calculated depending on the sidechain the P2Pool is mining on.
The XvB process will check every ten minutes the last 15 minutes average HR and decide when to switch (in seconds) for the ten next minutes. (first P2Pool then XvB).
*Need to see the time for XMRig takes to set the new settings by API.*
When the time to switch arrives, XvB process will send a request to XMRig to change the node used.
### Modification of config of XMRig
The following 4 attributes must be applied to XMRig config when mining to XvB node.