zone117x / node-open-mining-portal

A scalable all-in-one easy to setup cryptocurrency mining pool and portal written entirely in Node.js.
GNU General Public License v2.0
998 stars 1.02k forks source link

Can't start node init.js #707

Closed webdev866 closed 2 years ago

webdev866 commented 2 years ago

I have the following issue when I do : node init.js OR sudo node init.js

root@4321-51a430:~/nomp# sudo node init.js undefined:1 {"enabled":true,"coin":"dollar.json","address":"7kA7WpQFHutJA5aTrfqZ67nFMLTDMC4emX","rewardRecipients":{75ZNRZpEqYBM72GwGi6LCjaKM5Ao715ijD},"paymentProcessing":{"enabled":true,"paymentInterval":20,"minimumPayment":70,"daemon":{"host":"127.0.0.1","port":17703,"user":"rpc_dollar","password":"123456"}},"ports":{"3008":{"diff":8},"3032":{"diff":32,"varDiff":{"minDiff":8,"maxDiff":512,"targetTime":15,"retargetTime":90,"variancePercent":30}},"3256":{"diff":256}},"daemons":[{"host":"127.0.0.1","port":17703,"user":"rpc_dollar","password":"123456"}],"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}} ^

SyntaxError: Unexpected number in JSON at position 104 at JSON.parse () at /root/nomp/init.js:102:32 at Array.forEach () at buildPoolConfigs (/root/nomp/init.js:100:31) at init (/root/nomp/init.js:431:19) at Object. (/root/nomp/init.js:443:3) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) root@4321-51a430:~/nomp#

dylansproule commented 2 years ago

Clear, rewardRecipients isn’t an object of strings

On Sep 3, 2021, at 9:22 PM, webdev866 @.***> wrote:

{"enabled":true,"coin":"dollar.json","address":"7kA7WpQFHutJA5aTrfqZ67nFMLTDMC4emX","rewardRecipients":{75ZNRZpEqYBM72GwGi6LCjaKM5Ao715ijD},"paymentProcessing":{"enabled":true,"paymentInterval":20,"minimumPayment":70,"daemon":{"host":"127.0.0.1","port":17703,"user":"rpc_dollar","password":"123456"}},"ports":{"3008":{"diff":8},"3032":{"diff":32,"varDiff":{"minDiff":8,"maxDiff":512,"targetTime":15,"retargetTime":90,"variancePercent":30}},"3256":{"diff":256}},"daemons":[{"host":"127.0.0.1","port":17703,"user":"rpc_dollar","password":"123456"}],"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}}

webdev866 commented 2 years ago

@dylansproule thank you for your response, can you please tell me how to resolve it? The funny thing is that it was working fine with all that configuration, when I rebooted my server i couldn't get it to work.

dylansproule commented 2 years ago

Can you try a toString() on the value?

On Sep 3, 2021, at 9:33 PM, webdev866 @.***> wrote:

 @dylansproule thank you for your response, can you please tell me how to resolve it? The funny thing is that it was working fine with all that configuration, when I rebooted my server i couldn't get it to work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

webdev866 commented 2 years ago

@dylansproule I'm still facing the same issue, here is my config:

{ "enabled": true, "coin": "dollar.json",

"address": "7kA7WpQFHutJA5aTrfqZ67nFMLTDMC4emX",

"rewardRecipients": {
"75ZNRZpEqYBM72GwGi6LCjaKM5Ao715ijD"

},

"paymentProcessing": {
    "enabled": true,
    "paymentInterval": 20,
    "minimumPayment": 70,
    "daemon": {
        "host": "127.0.0.1",
        "port": 17703,
        "user": "rpc_dollar",
        "password": "123456"
    }
},

"ports": {
    "3008": {
        "diff": 8
    },
    "3032": {
        "diff": 32,
        "varDiff": {
            "minDiff": 8,
            "maxDiff": 512,
            "targetTime": 15,
            "retargetTime": 90,
            "variancePercent": 30
        }
    },
    "3256": {
        "diff": 256
    }
},

Error:

SyntaxError: Unexpected token } in JSON at position 140 at JSON.parse () at /root/nomp/init.js:102:32 at Array.forEach () at buildPoolConfigs (/root/nomp/init.js:100:31) at init (/root/nomp/init.js:431:19) at Object. (/root/nomp/init.js:443:3) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14)

webdev866 commented 2 years ago

I figured it out.

the solution should be

"rewardRecipients": { "75ZNRZpEqYBM72GwGi6LCjaKM5Ao715ijD":100 },