NOMP (mining pool)

Guide to install and configure a mining pool.

Introduction

In order to test the GetBlockTemplate, ValidateAddress and SubmitBlock RPC calls a mining pool is used.

Installation

Requirements:

Install NOMP:

  • In your terminal set the NodeJs version to v0.10.25.

nvm use v0.10.25
  • Clone nomp.

git clone https://github.com/zone117x/node-open-mining-portal.git nomp
cd nomp
npm update

Configuration:

Two configuration files must be created, the config.json on the root folder, and the bitcoin.json in the pool_configs folder.

  • nomp/config.json:

This is a config.json configuration example, you can just copy and paste it.

{
    "logLevel": "debug",
    "logColors": true,
    "cliPort": 17117,
    "clustering": {
        "enabled": false,
        "forks": "auto"
    },
    "defaultPoolConfigs": {
        "blockRefreshInterval": 1000,
        "jobRebroadcastTimeout": 55,
        "connectionTimeout": 600,
        "emitInvalidBlockHashes": false,
        "validateWorkerUsername": true,
        "tcpProxyProtocol": false,
        "banning": {
            "enabled": true,
            "time": 600,
            "invalidPercent": 50,
            "checkThreshold": 500,
            "purgeInterval": 300
        },
        "redis": {
            "host": "127.0.0.1",
            "port": 6379
        }
    },
    "website": {
        "enabled": false,
        "host": "0.0.0.0",
        "port": 80,
        "stratumHost": "35.184.165.194",
        "stats": {
            "updateInterval": 60,
            "historicalRetention": 43200,
            "hashrateWindow": 300
        },
        "adminCenter": {
            "enabled": true,
            "password": "passwordnono"
        }
    },
    "redis": {
        "host": "127.0.0.1",
        "port": 6379
    },
    "switching": {
        "switch1": {
            "enabled": false,
            "algorithm": "sha256",
            "ports": {
                "3333": {
                    "diff": 10,
                    "varDiff": {
                        "minDiff": 16,
                        "maxDiff": 512,
                        "targetTime": 15,
                        "retargetTime": 90,
                        "variancePercent": 30
                    }
                }
            }
        },
        "switch2": {
            "enabled": false,
            "algorithm": "scrypt",
            "ports": {
                "4444": {
                    "diff": 10,
                    "varDiff": {
                        "minDiff": 16,
                        "maxDiff": 512,
                        "targetTime": 15,
                        "retargetTime": 90,
                        "variancePercent": 30
                    }
                }
            }
        },
        "switch3": {
            "enabled": false,
            "algorithm": "x11",
            "ports": {
                "5555": {
                    "diff": 0.001,
                    "varDiff": {
                        "minDiff": 0.001,
                        "maxDiff": 1, 
                        "targetTime": 15, 
                        "retargetTime": 60, 
                        "variancePercent": 30 
                    }
                }
            }
        }
    },
    "profitSwitch": {
        "enabled": false,
        "updateInterval": 600,
        "depth": 0.90,
        "usePoloniex": true,
        "useCryptsy": true,
        "useMintpal": true,
        "useBittrex": true
    }
}
  • nomp/pool_configs/bitcoin.json

{
    "enabled": true,
    "coin": "bitcoin.json",
    "address": "mz8DUu5atAfNEBNeQHrpdGkfWZ9vmk3Q13",
    "rewardRecipients": {
    },
    "paymentProcessing": {
        "enabled": false,
        "paymentInterval": 20,
        "minimumPayment": 70,
        "daemon": {
            "host": "127.0.0.1",
            "port": 18332,
            "user": "litecoinrpc",
            "password": "litecoinrpcpass"
        }
    },
    "ports": {
        "4008": {
            "diff": 1
        },
        "4333": {
            "diff": 400,
            "varDiff": {
                "minDiff": 150,
                "maxDiff": 512,
                "targetTime": 15,
                "retargetTime": 90,
                "variancePercent": 30
            }
        },
        "4080": {
            "diff": 262144,
            "varDiff": {
                "minDiff": 262144,
                "maxDiff": 2621440000,
                "targetTime": 15,
                "retargetTime": 90,
                "variancePercent": 30
            }
        }
    },
    "daemons": [
        {
            "host": "127.0.0.1",
            "port": 18332,
            "user": "hanchon",
            "password": "hanchonpass"
        }
    ],
    "p2p": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 19333,
        "disableTransactions": true
    },
    "mposMode": {
        "enabled": false,
        "host": "127.0.0.1",
        "port": 3306,
        "user": "me",
        "password": "mypass",
        "database": "ltc",
        "checkPassword": true,
        "autoCreateWorker": false
    }
}

Run the pool

Redis:

Start the redis server on a terminal or a screen session.

redis-server

Start the pool:

Make sure you are on v0.10.25 of NodeJs and run the init.js file.

  • Inside the nomp folder run:

nvm use v0.10.25
node init.js
  • Example:

Mine blocks:

The last step to mine some blocks is to connect a miner to this pool. Follow the CPU Miner guide to send some hash to this pool.

References

Last updated