Bitcoin Forum
May 24, 2024, 02:40:29 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mining pool payout experiment  (Read 144 times)
e4f4 (OP)
Full Member
***
Offline Offline

Activity: 208
Merit: 100


View Profile
December 26, 2017, 10:20:59 AM
 #1

I am running a experiment on my local VM NOMP pool. Goal is to send extra payouts to workers.

Test coin -  block reward 50 coins.
Deamon wallet balance 0.
I send some coins to main deamon wallet.
Balance is 100.
When a block is found how to make NOMP combine coins already in wallet and block reward. How to make payout of 150 to worker.

Lets say payout is once in 24 hours. How to make NOMP do a payout like this:

Current wallet balance minus pending payout. That leaves extra coins. Distribute that extra coins to miners based on their submitted shares for found and confirmed blocks that day. Miners are paid like in a normal pool but they gain extra from the coins i send to pool (bought from exchange).


My guess is something needs to be changed here: https://github.com/zone117x/node-open-mining-portal/blob/master/libs/paymentProcessor.js

Maybe here:

    /* Does a batch redis call to get shares contributed to each round. Then calculates the reward
               amount owned to each miner for each round. */
            function(workers, rounds, addressAccount, callback){


                var shareLookups = rounds.map(function(r){
                    return ['hgetall', coin + ':shares:round' + r.height]
                });

                startRedisTimer();
                redisClient.multi(shareLookups).exec(function(error, allWorkerShares){
                    endRedisTimer();

                    if (error){
                        callback('Check finished - redis error with multi get rounds share');
                        return;
                    }


                    rounds.forEach(function(round, i){
                        var workerShares = allWorkerShares;

                        if (!workerShares){
                            logger.error(logSystem, logComponent, 'No worker shares for round: '
                                + round.height + ' blockHash: ' + round.blockHash);
                            return;
                        }

                        switch (round.category){
                            case 'kicked':
                            case 'orphan':
                                round.workerShares = workerShares;
                                break;

                            case 'generate':
                                /* We found a confirmed block! Now get the reward for it and calculate how much
                                   we owe each miner based on the shares they submitted during that block round. */
                                var reward = parseInt(round.reward * magnitude);

                                var totalShares = Object.keys(workerShares).reduce(function(p, c){
                                    return p + parseFloat(workerShares[c])
                                }, 0);

                                for (var workerAddress in workerShares){
                                    var percent = parseFloat(workerShares[workerAddress]) / totalShares;
                                    var workerRewardTotal = Math.floor(reward * percent);
                                    var worker = workers[workerAddress] = (workers[workerAddress] || {});
                                    worker.reward = (worker.reward || 0) + workerRewardTotal;
                                }
                                break;
                        }
                    });

                    callback(null, workers, rounds, addressAccount);
                });
            },



Bitcoin legacy, Doge fun and private transactions. Check out BitcoinZ... https://bitcointalk.org/index.php?topic=2166510.0

Missed Bitcoin in 2009? Find out more about IOTA...https://bitcointalk.org/index.php?topic=1216479.0
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!