How Dcrd Works And The Shortage Of Public Dcrd Nodes

Discussion in 'Technical Development' started by David, Mar 25, 2016.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. David

    David Sr. Member

    Jan 22, 2016
    358
    206
    Male
    USA
    It is likely that your VPS is behind a NAT device. If your VPS has an IP that is included in any of the following IP ranges, it's behind a NAT device and will require either a static port forwarding or a static public IP address to begin working as a public Decred node. Note the asterisks are wildcards and can be any number:

    - 10.*.*.* (any IP beginning with 10)
    - 100.64.*.* through 100.127.*.*
    - 172.16.*.* through 172.31.*.*
    - 192.168.*.*

    If your VPS IP address is not within one of those ranges, then you have a public IP. As long as the port is opened up on the host and any applicable firewalls, you should be fine.

    What OS and what VPS service provider are you using, if any? I used Amazon's VPS service for awhile and I had to specifically request a public static IP and add a custom firewall rule to their controller interface to setup my public node.
     
  2. bohemian

    bohemian New Member

    Dec 25, 2017
    4
    2
    Male
    India
    I have an public ip since the VPS is from a hosting provider. It is running Ubuntu Server 16 x64 (? if i the remember version)
    I have explicitly allowed the ports 9109 and 9108 from iptables and i dont see them getting blocked for any reason
     
  3. David

    David Sr. Member

    Jan 22, 2016
    358
    206
    Male
    USA
    Try to telnet from another Linux machine to your public IP on port 9108.
    Code:
    telnet <YOUR VPS PUBLIC IP> 9108
    If it says connection refused, my best guess is that the hosting company has other protections in place. You'll probably have to look into that avenue further or open up a ticket with them. It would be in the hosting company's best interest to have a separate firewall that's outside your VPS, which means it doesn't matter what you do to the box's IP tables right now - the policies are controlled elsewhere/upstream.
     
  4. bohemian

    bohemian New Member

    Dec 25, 2017
    4
    2
    Male
    India
    So I let it run for a couple of days and now i do see some inbound connections in the log. I am able to telnet to my public IP as well. But the node doesnt appear on any of the maps (dcrstats or stats.decred.org).
    Is that normal ? How can I check the number of incoming connections it is receiving
     
    David likes this.
  5. David

    David Sr. Member

    Jan 22, 2016
    358
    206
    Male
    USA
    Awesome! I'm not sure why the node doesn't appear on the maps. If I remember correctly, I think @chappjc elaborated on that awhile back either in this thread or in another.

    There are a few different commands you can run that will provide info about the number of connections. In general, and for future reference, you can run "dcrctl -l" (the letter l as in list) and it will show you all the possible dcrctl commands. Furthermore, if you want to see more information about a single command, for example, the "getinfo" command, you can type "dcrctl help getinfo" and it will show you more info about the particular command.

    The dcrctl commands getconnectioncount, getinfo, and getpeerinfo all provide information about the connections, with getpeerinfo providing the most information. I think the only command that allows you to distinguish between inbound and outbound connecitons is the getpeerinfo command, like follows:

    Code:
    C:\>dcrctl getpeerinfo
    [
      {
        "id": 1015,
        "addr": "137.74.199.235:9108",
        "services": "00000003",
        "lastsend": 1514564185,
        "lastrecv": 1514564196,
        "bytessent": 39309,
        "bytesrecv": 350065,
        "conntime": 1514554218,
        "timeoffset": 0,
        "pingtime": 178809,
        "version": 4,
        "subver": "/dcrwire:0.3.0/dcrd:1.1.2/",
        "inbound": false,
        "startingheight": 199180,
        "currentheight": 199213,
        "banscore": 0,
        "syncnode": false
      },
    
    You could expect to see the "inbound" line say true for an inbound connection, but I don't think there's an easy way to show you just the number of inbound connections.
     
  6. bohemian

    bohemian New Member

    Dec 25, 2017
    4
    2
    Male
    India

    So I wanted to give an update on my little experiment to run a public node. The node has been running the vps more >1.5 months now.
    Here are some stats:

    On average I see some ~40 peers connected on the node (at least getpeerinfo shows that) and around 30 or so have inbound connections.

    "vnstat" shows the following bandwidth usage on the node (it is just running decred node and nothing else)

    Month : Jan '18
    Download : 1.31 GiB
    Upload : 5.46 GiB
    Total : 6.77 GiB
    Average Rate : 21.94 kbit/s

    The node for whatever reason never shows up on "stats.decred.org" but "dcrstats" map discovered it after almost a month. The bandwidth utilization isnt really much right now. I hope more people get encouraged to add more public nodes
     
    David likes this.

Share This Page