Hanchon
  • Home
  • BCH Testnet Environment
    • BCH Testnet Environment
    • BitcoinABC (bitcore patches)
    • Bitcore (insight + insight-api)
    • NOMP (mining pool)
    • CPU Miner
    • Fork the network
    • Run regtest
  • Bitprim
    • Introduction
    • Node versions
    • Requirements
    • Node installation
    • Run the node
    • Insight Installation
    • Run Insight (node + REST-API)
    • Query the insight api
  • Bitprim Node Configuration Files
    • Bitcoin Cash Testnet
    • Bitcoin Cash Mainnet
    • Bitcoin Core Testnet
    • Bitcoin Core Mainnet
    • Litecoin Testnet
    • Litecoin Mainnet
  • Bitprim Insight Configuration
    • Insight-API configuration file
  • Utils
    • Install Node Version Manager
    • Install Redis
Powered by GitBook
On this page
  • Introduction
  • Installation
  • Requirements:
  • Install NOMP:
  • Configuration:
  • Run the pool
  • Redis:
  • Start the pool:
  • Mine blocks:
  • References
  1. BCH Testnet Environment

NOMP (mining pool)

Guide to install and configure a mining pool.

PreviousBitcore (insight + insight-api)NextCPU Miner

Last updated 6 years ago

Introduction

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

Installation

Requirements:

  • Node Version Manager to install the NodeJs version 0.10.25 . .

  • Any bitcoind with RPC support. The ABC with bitcore patches works fine , but a normal Bitcoin-ABC node can also be used.

  • Redis to store the pool data.

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

A node-watch update is currently breaking the nomp installation, to fix it follow this issue:

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

Make sure you change the address because it's the one that is going to receive the block rewards. Also set your RPC credentials in the daemon section.

{
    "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:

References

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

NOMP github:

Install Node Version Manager
BitcoinABC + bitcore patches
Install Redis
https://github.com/zone117x/node-open-mining-portal/issues/651
CPU Miner
https://github.com/zone117x/node-open-mining-portal