Skip to content

linX-project/linx-unomp-pool-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

linx-unomp-pool-settings

Linx specific settings for mining pools

From Block #315001 a 5% dev fee was introduced. This did not reduce the standard block reward for miners, it is a separate TX. The dev fee halves inline with the block reward halving.

The current block reward is 25 Linx with an additional dev fee of 1.25 Linx, meaning each new block generates 26.25 Linx in total.

Mining pools will need to update their wallets to the latest version of the source and also make changes to their pool code and config file to allow for the new block template and avoid receiving rejected blocks.

UPDATE YOUR WALLET TO THE LATEST VERSION

Either git pull or clone and build from scratch now.

git clone https://github.com/linx-project/linX.git

RECONFIGURE YOUR POOL FOR LINX

There are only a couple of things that need to be changed :

  1. The first rewardRecipient in your pool config file must pay 1.25 to the Dev Fee address. If it is not the first payout or the address or amount is changed, blocks will be rejected.

    "rewardRecipients": {
    
         // Dev fee MUST come first  
         // Do not change this line
         "XF7kCcs4woQD9WWnCHuN6SWPeUNK2fBspr": 1.25,
         
         // Now add your pool fee here as normal    
         "YOURPOOLFEEWALLETADDRESSHERE": 1.0
     },
    
  2. You also need to replace, or update, the node pool.js and transactions.js files to handle the new block template. Here are the functions that have been changed if you want to apply the modifications yourself.

    in pool.js

    function SetupRecipients(){
         var recipients = [];
         options.feePercent = 0;
         options.rewardRecipients = options.rewardRecipients || {};
         for (var r in options.rewardRecipients){
             var percent = options.rewardRecipients[r];
             var rObj = {
                 percent: percent
             };
             try {
                 if (r.length === 40)
                     rObj.script = util.miningKeyToScript(r);
                 else
                     rObj.script = util.addressToScript(r);
                 recipients.push(rObj);
                 options.feePercent += percent;
             }
             catch(e){
                 emitErrorLog('Error generating transaction output script for ' + r + ' in rewardRecipients');
             }
         }
         if (recipients.length === 0){
             emitErrorLog('No rewardRecipients have been setup which means no fees will be taken');
         }
         options.recipients = recipients;
    }
    

    in transactions.js

    for (var i = 0; i < recipients.length; i++){
         var recipientReward = Math.floor(recipients[i].percent * 100000000);
         rewardToPool -= recipientReward;
    
         txOutputBuffers.push(Buffer.concat([
             util.packInt64LE(recipientReward),
             util.varIntBuffer(recipients[i].script.length),
             recipients[i].script
         ]));
    }
    

    Once implemeted blocks will resume as normal.

    Acknowledgements: Huge thanks to ocminer from suprnova for his help with this.

Releases

No releases published

Packages

No packages published