zone117x / node-cryptonote-pool

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

API not working - Infinite Loading #230

Open msilvoli opened 6 years ago

msilvoli commented 6 years ago

Hi guys, I'm facing a crazy problem with the API loading eternally and not showing the statistics from Monero running on openSUSE 42.3, apache 2.4, npm 2.15.1, node 0.10.48

Daemon is synchronized and started as: ./monerod --config-file /etc/monerod.conf --p2p-bind-ip 172.x.x.x --rpc-bind-ip 172.x.x.x --zmq-rpc-bind-ip 172.x.x.x --confirm-external-bind

Wallet-rpc started as : ./monero-wallet-rpc --daemon-host 172.x.x.x --daemon-port 18081 --rpc-bind-ip 172.x.x.x --rpc-bind-port 38082 --wallet-file mywallet --confirm-external-bind but the wallet is stuck on "Starting wallet rpc server...". I synchronized wallet before with wallet-cli and this is still happening.

Node started normally, showing connection ports, api port 8117, and no errors. My node config "api": { "enabled": true, "hashrateWindow": 600, "updateInterval": 10, "port": 8117, "blocks": 30, "payments": 30, "password": "Mypassword" }, "daemon": { "host": "172.x.x.x", "port": 18081 }, "wallet": { "host": "172.x.x.x", "port": 38082 },

Redis running correctly 'cause I have another application using redis...

My API config var api = "http://172.x.x.x:8117"; var poolHost = "172.x.x.x";

No firewall active, and the inspect console on google chrome is showing "Failed to load 172.x.x.x/stats resource: net::ERR_CONNECTION_TIMED_OUT

If someone can help, I really appreciate. I saw this is a recurring problem and I checked everything here in the issues before open the ticket. A few users solved the problem but they didn't informe here on github how they solved it :- (

Thank you guys screenshot from 2017-11-22 07-06-44 screenshot from 2017-11-22 07-06-14

sergeimonakhov commented 6 years ago

+1

jredwine2857 commented 6 years ago

Yep, same thing....I'll report back if I figure it out.

msilvoli commented 6 years ago

@LegolasGChief Yes, all necessary listening ports are opened, Http server running. Set a different config to run everything on localhost (127.0.0.1) and nothing appeared too. Thanks.

LegolasGChief commented 6 years ago

In pool config there should be an api port for ssl

use that in website config instead of normal port

On Fri, Dec 8, 2017 at 2:54 PM, msilvoli notifications@github.com wrote:

@LegolasGChief https://github.com/legolasgchief Yes, all necessary listening ports are opened, Http server running. Set a different config to run everything on localhost (127.0.0.1) and nothing appeared too. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zone117x/node-cryptonote-pool/issues/230#issuecomment-350282644, or mute the thread https://github.com/notifications/unsubscribe-auth/AYHZGCiKYG7Q8DLmUOtyh8fz12EkjOLhks5s-U27gaJpZM4QndIk .

mattmojo77 commented 6 years ago

Had same issue (posted a issues thread yesterday) - I had to set the var to a proper URL or IP (not localhost or 127.0.0.1) before any of the API stats would show up on page from a machine that is not the server.

sergeimonakhov commented 6 years ago

i have trouble use with cloudflare, without - all right

msilvoli commented 6 years ago

Hi @mattmojo77 Thanks for your reply ! I noticed this 2 days ago when I removed the 127.0.0.1 and set my IP. The main informations are ok (Net Hash, Pool Hash, Domain and Ports, etc.) but nothing is appearing on Admin page yet. Miner lookup showing nothing....

jredwine2857 commented 6 years ago

Well aren't I a jerk! I said I'd come back when I fixed and I didn't! As @mattmojo77 stated, this is because the client-side connects directly to the API. I assumed (wrongly) that the Apache server connected to the API, thus, thinking all communication was internal. Once I changed the Config.js to point to the external IP of my API server and opened the port, all worked well.

So, to recap:

  1. Open up whatever port you are using for you API (Default it's set to 8117) on your firewall to Any (0.0.0.0/0).

  2. Edit your config.js file to point to the external ip of your API server and correct port (8117 by default). This is the var api = statement where you will change/edit this.

Hope this helps someone else!

msilvoli commented 6 years ago

@jredwine2857. All stats from the pages Home and Getting Started are ok now, but the admin page has nothing to show as stated in the issue #204

UbuntuEvangelist commented 6 years ago

Same here on Ubuntu 16.04

fr1t2 commented 6 years ago

Same here running ubuntu 16.04 with latest codebase. I have set the IP address in the web servers config.js to reflect the address and open port for the API. I see no errors in the inspection console for web dev tools in chrome. no errors in apache2, no errors in the pool API logs... All main page / home page info shows up, miner lookup form main page works, sometimes with a delay but it loads.

jredwine2857 commented 6 years ago

Yeah that's def different that what I had then. None of my stats were showing up.

But I also don't believe the admin page has anything to show until you find a block. The miner information, if you look at the HTML on the admin.html file is empty. So it looks like just a place holder for you to make your own.

I ended switching over to snipa's nodejs pool so I don't have the old cryptonote pool running any more.

fr1t2 commented 6 years ago

that makes sense now that you mention it, and after I looked at the html. Thanks, I'll look into snipa's nodejs pool. No blocks earned yet

minorhash commented 6 years ago

in my case, i just kept

"host:127.0.0.1"

on pool/config.json, otherwise redis wont connect. for web/config.json i assigned

var api="http://mysite:8117"
var poolhost="mysite"

its a FQDN and not external IP. only difference to make it works was to forward the api port 8117. and the api started working outside the server, the inifite loading is no more!

dlegend116 commented 6 years ago

what do you mean forward , I still have this issue