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

global.database.getCache('pool_stats_pps') return false, do I miss something in db pool.config ? #51

Open
longnight opened this issue Jul 11, 2018 · 5 comments
Labels

Comments

@longnight
Copy link

longnight commented Jul 11, 2018

Hi,
after first run deploy.sh , those API:

  • /api/pool/stats/pps
  • /api/pool/stats/pplns
  • /api/pool/stats/solo

keep telling:

TypeError: Cannot create property 'fee' on boolean 'false'
   at /home/username/nodejs-pool/lib/api.js:248:28
   at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)
   at next (/home/username/nodejs-pool/node_modules/express/lib/router/route.js:131:13)
   at makeResponseCacheable (/home/username/nodejs-pool/node_modules/apicache/src/apicache.js:207:5)
   at cache (/home/username/nodejs-pool/node_modules/apicache/src/apicache.js:438:16)
   at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)
   at next (/home/username/nodejs-pool/node_modules/express/lib/router/route.js:131:13)
   at Route.dispatch (/home/username/nodejs-pool/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)
   at /home/username/nodejs-pool/node_modules/express/lib/router/index.js:277:22
   at param (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:349:14)
   at param (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:365:14)
   at Function.process_params (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:410:3)
   at next (/home/username/nodejs-pool/node_modules/express/lib/router/index.js:271:10)
   at jsonParser (/home/username/nodejs-pool/node_modules/body-parser/lib/types/json.js:110:7)
   at Layer.handle [as handle_request] (/home/username/nodejs-pool/node_modules/express/lib/router/layer.js:95:5)

I've check the code, it seen not get the db cache on /api.js line 248,

global.database.getCache('pool_stats_pplns')

which returns a false value.
Do I miss some configs value in database pool.config or config.json something ?
And, API /leafApi also return a 502 Bad Gateway.

Thanks for help.

@MoneroOcean
Copy link
Owner

Try to restart api module. This happens during initial pool run. Also see Snipa22#280

@longnight
Copy link
Author

longnight commented Jul 11, 2018

I've restart api several times and errors appear as the same. I wonder may be some config value lost. @MoneroOcean

@1rV1N-git
Copy link

@longnight enable PPS restart worker module then wait 1 min.

@1rV1N-git
Copy link

1rV1N-git commented Jul 14, 2018

or add in worker module

if (!(global.database.getCache('pool_stats_pps'))){
    global.database.setCache('pool_stats_pps', {
            hashRate: 0,
            miners: 0,
            totalHashes: 0,
            lastBlockFoundTime: 0,
            lastBlockFound:  0,
            totalBlocksFound:  0,
            totalMinersPaid: 0,
            totalPayments: 0,
            roundHashes: 0,
        totalAltBlocksFound:  0,
        altBlocksFound: {},
            activePort:  0,
            activePortProfit:  0,
            activePortComment: "",
            minBlockRewards: {}
        });
}

@longnight
Copy link
Author

@1rV1N-git
Thank you.

What should do to enable PPS ? I've already modified some config in db pool.config.
And, I appended above code in to worker module, /api/pool/stats/pps no more complaint, but
/api/pool/stats/pplns
/api/pool/stats/solo
/leafApi
are still giving me 500 error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants