iquidus / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
750 stars 1.33k forks source link

Configuring Iquidus explorer for my coin running on Digital Ocean. #494

Closed grasshaussoftware closed 1 year ago

grasshaussoftware commented 1 year ago

Not sure what to put for the port values in the json file. Our coin's default rpc port is 7143

joeuhren commented 1 year ago

There are 3 port values in the config file:

1)

  // port to listen for requests on.
  "port" : 3001,

This is the webserver port. You can keep it at 3001 while testing and you would access the website as something like http://localhost:3001 for example. A normal webserver runs on port 80 but node.js doesn't allow access to ports 1-1024 unless you are the root user or you utilize a trick like the setcap cmd or use another webserver as a reverse proxy for example.

2)

  // database settings (MongoDB)
  "dbsettings": {
    "user": "iquidus",
    "password": "3xp!0reR",
    "database": "explorerdb",
    "address": "localhost",
    "port": 27017
  },

The default mongo port is 27017 and usually doesn't need to be changed unless you changed it during your setup of mongodb and know what you are doing.

3)

  "wallet": {
    "host": "localhost",
    "port": 9332,
    "username": "darkcoinrpc",
    "password": "123gfjk3R3pCCVjHtbRde2s5kzdf233sa"
  },

This port is your wallets rpc port, so it would be 7143 in your case.

grasshaussoftware commented 1 year ago

does this take into account that i am running the wallet and the explorer in the cloud on two different servers with two different ip addresses? does the address in example two remain as "localhost"? does the address in example three remain as "localhost" as well?

and my instance address would be the ip of the server running the explorer with the port number 3001 at the end correct?

joeuhren commented 1 year ago

localhost is a special keyword in most operating systems that resolves to the local machines internal ip address. If you are running a wallet on a separate server than the explorer, you will definitely need to change the wallet host value from localhost to whatever the proper ip address is and be sure to configure your wallet for remote connections and allow the rpc port through any firewalls. This goes well beyond the setup of the explorer as most people run wallet and explorer on the same server. I would therefore consider this to be more of an advanced scenario and could get complicated if you don't configure the firewall and wallet properly.

To be more specific to your questions:

grasshaussoftware commented 1 year ago

okay. ive made those changes and nothing. no firewall is set.

grasshaussoftware commented 1 year ago

is this tutorial accurate? https://bitcointalk.org/index.php?topic=5349578.msg57474885#msg57474885

are all the steps correct?

joeuhren commented 1 year ago

okay. ive made those changes and nothing. no firewall is set.

First of all, does a website come up when you visit the correct url? You should see the debug info in the console when running the webserver using npm start, what does the output look like? See any errors?

is this tutorial accurate? https://bitcointalk.org/index.php?topic=5349578.msg57474885#msg57474885

are all the steps correct?

I didn't write that tutorial, nor have I ever seen that tutorial before, but I took a quick glance and it seems to look OK to me. What step in the tutorial are you getting hung up on? I will need error codes or something like this to help you figure out where you are going wrong. The only REALLY IMPORTANT settings are the dbsettings and wallet portions of the config which will prevent you from syncing data correctly if not filled out correctly. But even if they are wrong, you should be able to get some kind of output from the webserver when you visit the url.

Also, I would recommend NOT setting up a crontab until after you have verified that the you have everything configured correctly. You can run the block sync cmd manually outside of a crontab like this (Be sure that you are within the root of the iquidus directory when you run this or it will not work):

path/to/node scripts/sync.js index update

Change path/to/node to the full path to your installed version of node.js. If you aren't sure, you can find your node path with this cmd:

which node

or, if you are running an older version of node:

which nodejs
uaktags commented 1 year ago

Closing as its more user-end administrative tasks. There's nothing that's preventing this script from running on a DO vps.