Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix #5

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ node_modules/
.idea/
pool_configs/*.json
!pool_configs/litecoin_example.json
!pool_configs/riecoin.json
!pool_configs/garlicoin.json
docker-compose.yaml
config/
npm-debug.log
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:9.4.0

RUN echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list.d/unstable.list &&\
apt-get update &&\
apt-get install --assume-yes -t unstable gcc-5 libgmp3-dev g++-5 &&\
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 &&\
cc --version

RUN mkdir -p /opt/node-open-mining-portal

COPY package.json /opt/node-open-mining-portal/
COPY package-lock.json /opt/node-open-mining-portal/

WORKDIR /opt/node-open-mining-portal

RUN npm install && echo 4

COPY . /opt/node-open-mining-portal/

RUN rm -rf /opt/node-open-mining-portal/pool_configs
RUN ln -s /opt/config/config.json /opt/node-open-mining-portal/config.json
RUN ln -s /opt/config/pool_configs /opt/node-open-mining-portal/

VOLUME ["/opt/config"]

EXPOSE 80
EXPOSE 3333

CMD node init.js
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ a good pool operator. For starters be sure to read:

#### 1) Downloading & Installing

Clone the repository and run `npm update` for all the dependencies to be installed:
Clone the repository and run `npm install` for all the dependencies to be installed:

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

#### 2) Configuration
Expand Down Expand Up @@ -347,6 +347,9 @@ Here is an example of the required fields:
"symbol": "ltc",
"algorithm": "scrypt",

// Coinbase value is what is added to a block when it is mined, set this to your pool name so
// explorers can see which pool mined a particular block.
"coinbase": "Kryptonite",
/* Magic value only required for setting up p2p block notifications. It is found in the daemon
source code as the pchMessageStart variable.
For example, litecoin mainnet magic: http://git.io/Bi8YFw
Expand Down Expand Up @@ -530,7 +533,7 @@ When updating NOMP to the latest code its important to not only `git pull` the l
the `node-stratum-pool` and `node-multi-hashing` modules, and any config files that may have been changed.
* Inside your NOMP directory (where the init.js script is) do `git pull` to get the latest NOMP code.
* Remove the dependenices by deleting the `node_modules` directory with `rm -r node_modules`.
* Run `npm update` to force updating/reinstalling of the dependencies.
* Run `npm install` to force updating/reinstalling of the dependencies.
* Compare your `config.json` and `pool_configs/coin.json` configurations to the latest example ones in this repo or the ones in the setup instructions where each config field is explained. You may need to modify or add any new changes.

Donations
Expand Down
11 changes: 11 additions & 0 deletions coins/garlicoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Garlicoin",
"symbol": "GRLC",
"algorithm": "allium",

"//": "Coinbase will let explorers know who mined the block, change this to your pool name",
"coinbase": "HaventChangedTheConfig",

"peerMagic": "d2c6b6db",
"peerMagicTestnet": "fdd2c8f2"
}
114 changes: 0 additions & 114 deletions config.json

This file was deleted.

6 changes: 6 additions & 0 deletions libs/paymentProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ function SetupForPool(logger, poolOptions, setupFinished) {
return;
}

for (var key in workerShares) {
if (workerShares.hasOwnProperty(key) && key.length !== 34) {
delete workerShares[key];
}
}

switch (round.category) {
case 'kicked':
case 'orphan':
Expand Down
5 changes: 5 additions & 0 deletions libs/poolWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ module.exports = function(logger){

var authorizeFN = function (ip, port, workerName, password, callback) {
handlers.auth(port, workerName, password, function(authorized){
if(authorized){
if(workerName.length !== 34){
authorized = false;
}
}

var authString = authorized ? 'Authorized' : 'Unauthorized ';

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ric-nomp",
"name": "grlc-nomp",
"version": "0.0.4",
"description": "An extremely efficient, highly scalable, all-in-one, easy to setup cryptocurrency mining pool",
"keywords": [
Expand All @@ -12,9 +12,9 @@
"litecoin",
"scrypt"
],
"homepage": "https://github.com/vagabondan/ric-nomp",
"homepage": "https://github.com/garlicoin-project/grlc-nomp",
"bugs": {
"url": "https://github.com/vagabondan/ric-nomp/issues"
"url": "https://github.com/garlicoin-project/grlc-nomp/issues"
},
"license": "GPL-2.0",
"author": "Matthew Little",
Expand All @@ -28,7 +28,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/vagabondan/ric-nomp.git"
"url": "https://github.com/garlicoin-project/grlc-nomp.git"
},
"dependencies": {
"async": "^2.5.0",
Expand All @@ -46,7 +46,7 @@
"nonce": "^1.0.4",
"redis": "^2.7.1",
"request": "^2.81.0",
"stratum-pool": "git://github.com/vagabondan/node-stratum-pool.git"
"stratum-pool": "git://github.com/garlicoin-project/grlc-node-stratum-pool.git#2af9266"
},
"engines": {
"node": ">=6.11.2"
Expand Down
51 changes: 51 additions & 0 deletions pool_configs/garlicoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"enabled": true,
"coin": "garlicoin.json",

"address": "mvtv43LtsQSeyCaBBb8xRj5ZpNt75zDX21",

"rewardRecipients": {
"mvtv43LtsQSeyCaBBb8xRj5ZpNt75zDX21": 5
},

"paymentProcessing": {
"enabled": true,
"paymentInterval": 20,
"minimumPayment": 0.1,
"daemon": {
"host": "127.0.0.1",
"port": 42068,
"user": "user",
"password": "password"
}
},

"ports": {
"3333": {
"diff": 8,
"varDiff": {
"minDiff": 8,
"maxDiff": 512,
"targetTime": 15,
"retargetTime": 90,
"variancePercent": 30
}
}
},

"p2p": {
"enabled": false,
"host": "127.0.0.1",
"port": 42069,
"disableTransactions": true
},

"daemons": [
{
"host": "127.0.0.1",
"port": 42068,
"user": "user",
"password": "password"
}
]
}
56 changes: 0 additions & 56 deletions pool_configs/riecoin.json

This file was deleted.

8 changes: 8 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
docker run --rm -it \
--name nomp \
-v $(pwd)/config:/opt/config \
--network=garlicoin-test \
--entrypoint=/bin/bash \
-p 80:80 \
-p 3333:3333 \
nomp