zone117x / node-cryptonote-pool

Mining pool for CryptoNote based coins such as Bytecoin and Monero
GNU General Public License v2.0
827 stars 1.14k forks source link

Web Frontend doesnt refresh data #328

Open acidrs03 opened 6 years ago

acidrs03 commented 6 years ago

I have had my pool running for a few days now and i cant seem to get the web frontend to do its auto update.

When you first visit the site you just get the header bar and the spinning icon in the content area. If you click any of the links in the header and then click back to the home page the api data is visible but it doesn't update unless you do the same steps again. ssl has been setup and from what i can tell it is wokring correctly.

Has any one else had this issue and managed to get it working correctly and can tell me the steps needed.

Thanks

acidrs03 commented 6 years ago

I guess it would help if you could see what i was talking about lol Heres a link to the pool website page. xmrworld.com

acidrs03 commented 6 years ago

I believe the issue is because the website is not connecting to the api using a secure connection. There are not many guides or information regarding getting the ssl side setup correctly. Most responses on any fork is to make sure ssl is enabled in config.json.

I think the main miscommunication is where the web frontend is compared to the node pool. If everything Daemon, Wallet cli, Node pool and webfrontend are all on the same machine then the issues are a little less difficult.

In my situation the Daemon and Wallet RPC are running on one computer on my network. The Node pool is running on another computer on my network. The daemon can communicate without issue to the node pool. The Web frontend however is hosted on a vps attached to a domain name. The ports on my network are open for the pool api to listen and with http i can show the stats on my website. However as the website is https, and it cannot pull the api stats when i change the api var to https. I have seen mentioned in one place to use stunnel to listen for https requests which will redirect the traffic to a specific port. I not sure if i have gotten the right understanding of that. If so would that mean i would need to setup stunnel on the computer running the node pool and have it redirect the incoming api request to the 8117 port, would that work?

I have been struggling with this aspect of the whole pool setup for a while and havent been able to get assistance with it.

I have no problem doing the work to get the pool running properly i just need a nudge in the right direction.

olalcruz commented 6 years ago

Hey man. Same issue here. I visited your website and I am having exactly the same issue. My site: www.mineriaglobal.com.mx / The only difference is that the api data from my side is not visible at all. I can only see it working correctly in my local network but when I change the config.js file to point to that domain, the api data is not visible in LAN and neither through the internet. I am hosting everything in just 1 computer, my website is in apache server in linux. My domain is not ssl and I dont know how to enable that in the config.json file either. I am newbie to linux. I think I am quite less advanced than you are. Any suggestions ? Have you found some solutions? I would appreciate your advice.

acidrs03 commented 6 years ago

Hey. I tried several different configs for my setup similar to yours but i could not get the issue resolved. I posted the issue in different forks of node-cryptonote-pool git but didn't get responses. I ran the web files on a remote VPS and had an ssl installed but that still didn't resolve the issue.

This is the code i used for the ssl stuff. I believe its from another fork by clintar /* AJAX API used for front-end website. */ "api": { "enabled": true, "hashrateWindow": 600, //how many second worth of shares used to estimate hash rate "updateInterval": 3, //gather stats and broadcast every this many seconds "port": 8117, "blocks": 30, //amount of blocks to send at a time "payments": 30, //amount of payments to send at a time "ssl": false, /* enable ssl api listener. if enabled, a second listener is lauched with ssl. A cert and key are required. not tested without a chain file. Set the website/config.js to point to this port. If your web server is on ssl, you will probably need to have the listener on ssl or the browser may not allow connection to non-ssl api port */ "sslport": 8119, // port to use for the ssl listener "sslcert": "./certs/cert.pem", //cert file "sslkey": "./certs/privkey.pem", //private key file "sslca": "./certs/chain.pem", //ca chain file if needed "password": "test" //password required for admin stats }, There were problems with this fork loading two listeners on teh same port which had to be changed i believe in the api.js file, there was a typo or something like that.

If you would like you can email me your config.js and config.json files for me to look through. I can help as much as i can but i did ultimately shutdown my pool just because i couldn't get the help needed.

olalcruz commented 6 years ago

Man, thanks for your promtp answer. Dont get dissapointed. I will try to commit to find a solution for you and me and I appreciate your support. I also wrote a message to the guy which made the tutorial I followed to set up the pool and he is replying so far. So as soon as I get some news regarding this topic, I will let you know for sure. My email es eduardocruzc@gmail.com you can send me your email and we will keep in touch