Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

dashman - linux masternode mangement made mootastic

Discussion in 'Tips and Tricks' started by moocowmoo, Oct 11, 2015.

  1. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    https://github.com/moocowmoo/dashman

    *now with voting goodness! (beta)

    [​IMG]
    [​IMG]

    dashman
    DASH wallet/daemon management utilities - version 0.1.9
    • This script installs, updates, and manages single-user dash daemons and wallets
    • It is currently only compatible with 32/64 bit linux.
    • Multi-user (system directory) installs are not yet supported
    Install/Usage

    To download dashman do:
    Code:
    sudo apt-get install git
    git clone https://github.com/moocowmoo/dashman.git
    cd dashman
    To update your existing version 12 32/64bit linux dash wallet to the latest dashd, do:
    Code:
    ./dashman update
    To perform a new install of dash, do:
    Code:
    ./dashman install
    To overwrite an existing dash install, do:
    Code:
    ./dashman reinstall
    To update dashman to the latest version, do:
    Code:
    ./dashman sync
    To restart (or start) dashd, do:
    Code:
    ./dashman restart
    To get the current status of dashd, do:
    Code:
    ./dashman status
    To cast votes using your masternode(s), do:
    Code:
    ./dashman vote


    Commands

    sync
    "dashman sync" updates dashman to the latest version from github

    install
    "dashman install" downloads and initializes a fresh dash install into ~/.dash unless already present

    reinstall
    "dashman reinstall" downloads and overwrites existing dash executables, even if already present

    update
    where it all began, "dashman update" searches for your dashd/dash-cli executibles in the current directory, ~/.dash, and $PATH. It will prompt to install in the first directory found containing both dashd and dash-cli. Multiple wallet directories are not supported. The script assumes the host runs a single instance of dashd.

    restart
    "dashman restart [now]" restarts (or starts) dashd. Searches for dash-cli/dashd the current directory, ~/.dash, and $PATH. It will prompt to restart if not given the optional 'now' argument.

    status
    "dashman status" interrogates the locally running dashd and displays its status

    vote (beta)
    "dashman vote" automates voting and randomizes vote timestamps to help disassociate ownership
    Requires:
    • dash-cli in $PATH
    • masternode.conf in $HOME/.dash
    • python 2
    Dependencies
    • nc (netcat)
    • wget
    • perl
    • python
    • dashd, dash-cli - version 12 or greater to update
    Screencaps

    install
    [​IMG]

    update
    [​IMG]

    reinstall
    [​IMG]

    restart
    [​IMG]

    status
    [​IMG]

    vote
    [​IMG]

    [​IMG]

    Contact
    Email me at [email protected] or submit a pull request.
     
    #1 moocowmoo, Oct 11, 2015
    Last edited by a moderator: Oct 11, 2015
    • Like Like x 12
    • Winner Winner x 1
    • Informative Informative x 1
  2. TaoOfSatoshi

    TaoOfSatoshi Grizzled Member

    Joined:
    Jul 15, 2014
    Messages:
    2,740
    Likes Received:
    2,615
    Trophy Points:
    1,183
    Mootastic!
     
    • Like Like x 2
  3. italx

    italx Well-known Member
    Foundation Member

    Joined:
    Jul 31, 2014
    Messages:
    65
    Likes Received:
    52
    Trophy Points:
    158
    Not that you need to contribute any more then this awesome tool, but I was thinking last night how useful this would be for test. It's quite a pain (for me at least) to be updating test masternodes daily or multiple times a day. I'm not running any now as I'm waiting for Even to ask for testers, but will likely in the future. Perhaps you've already thought along the same lines... Anyway, thanks again for this and all the updates.
     
    • Like Like x 1
  4. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    yes italx It's on the mental roadmap.

    next few updates are going to be:

    • ipv6 support
    • system lib (/usr/bin /usr/local/bin) support
    • notification when protocol is updated (to resend masternode starts)
    • testnet support (which will probably require arbitrary directory location support first)

    If anybody has any other ideas, please let me know!
     
    • Like Like x 1
  5. SirHikmat

    SirHikmat Member

    Joined:
    Nov 15, 2014
    Messages:
    93
    Likes Received:
    57
    Trophy Points:
    68
    beautiful project! Thanks a lot for your commitment. I hope I'll once have the chance to make an useful pull request :)
     
  6. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    Thanks and you're welcome! It's a fun project that scratches a bunch of my personal developer itches.

    Thanks for the docker image too!
    I forked it to try and update it to use version .55 but didn't have immediate success (I'm a docker noob) and haven't swung back around to try again.
     
    • Like Like x 1
  7. SirHikmat

    SirHikmat Member

    Joined:
    Nov 15, 2014
    Messages:
    93
    Likes Received:
    57
    Trophy Points:
    68
    Yeah, .53 and .55 is kind of unstable in docker. We stopped working on the project some weeks ago and copied-pasted some scripts together. But now, we will definitely use your script package!
     
  8. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    That's unfortunate to hear. I was hoping to use docker for a lot of upcoming testing projects.
    Any ideas why?

    Sweet!
    I've been thinking about adding some unattended modes, so let me know if you run into a blocker before building your own patch.
    Also been considering some machine-readable (probably json) output modes too...
     
  9. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    • Like Like x 1
  10. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    dashman version 0.1.10 released!

    • added ipv6 support - use icanhazip for ipv4/6 polling
    • added last masternode payment display
    • added dashd uptime calculation
    • added support for hot-node (Internet server) dash.conf voting
    • added initial host metrics: uptime/load average

    • switch to using curl. much faster
    • refactor wgets -- add 4 second timeout to pulls
    • check for dependencies before embarking
    • consolidated output

    do dashman sync to pull in the latest version!

    If you have both ipv6 and ipv4 configured, you will be prompted to select between the two when doing a fresh 'dash install'.

    [​IMG]
     
    • Like Like x 3
  11. MrZilch

    MrZilch Active Member

    Joined:
    Jun 9, 2015
    Messages:
    96
    Likes Received:
    106
    Trophy Points:
    93
    this is GREAT, makes life easy !
     
  12. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    thanks!

    you can always pull in the latest stuff manually by doing 'dashman sync'

    https://github.com/moocowmoo/dashman/compare/v0.1.10...master

    todays commits include:
    Code:
    * 40b07dc bugfix - voting - fail gracefully when dash-cli not in path
    * 618d066 added balance display
    * 4db404f support multiple sync exec arguments
    * 8d7b444 moving scripts to bin directory
    * 024d36c bugfix - use initial api pull values for last payment
    * 4104235 style - unify all gathering messages
    * 9c0dad1 bugfix - proper ipv6 formatting for hot-node voting
     
    #12 moocowmoo, Oct 14, 2015
    Last edited by a moderator: Oct 14, 2015
  13. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    I think this is it for now... enjoy!

    dashman version 0.1.11 released

    upload_2015-10-14_4-34-40.png

    protip: you can always run the latest version by prepending 'sync' to your command like 'dashman sync status'
     
    #13 moocowmoo, Oct 14, 2015
    Last edited by a moderator: Oct 14, 2015
    • Like Like x 3
  14. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    works,....
     
    • Like Like x 1
  15. paperThin

    paperThin Member

    Joined:
    Jun 13, 2014
    Messages:
    106
    Likes Received:
    19
    Trophy Points:
    68
    Moo,

    I switched to a new VPS provider and now I get "dashd port open : NO". However, everything else is green and I can ping my server with yougetsignal port check tool. 9999 comes back just fine "open". Any idea what I am missing?

    Thanks!!
    PT
     
  16. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    some network configurations (NAT) prevent connecting to the public ip from a host behind masquerading/translation.

    try "telnet ip.address.of.masternode 9999" from the masternode itself and see if it connects.

    If it doesn't, you'll have to get more info about your vps instance and network, but there's probably nothing to be done that doesn't require some advanced networking configuration.
    If it does, I'll have to troubleshoot your particular config to see why netcat doesn't do what telnet does.

    I may build an external polling api in the future, but, so far, most network configurations can connect back to themselves.
     
    #16 moocowmoo, Oct 16, 2015
    Last edited by a moderator: Oct 16, 2015
    • Like Like x 1
  17. paperThin

    paperThin Member

    Joined:
    Jun 13, 2014
    Messages:
    106
    Likes Received:
    19
    Trophy Points:
    68
    Maybe I didn't say it right... On Dashman I have green YES with ninja, whale... etc. Also, I can see it from the external side. In other words... I think everything is ok (I hope). Ninja's site shows it as Open Port all green, too. And, I am in the masternode list.
    But the Dashman reports it with red NO for "port open". I just thought it was weird and wondered what you are doing to check the port. FYI - I am using ufw to close the rest of the ports.

    Also typing "telnet" in bash returns "command not found" on my server. Maybe I missed a dependency?

    Thanks!!!!!!!!!!!!!
     
  18. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    I understand you.

    Your masternode can't connect to it's ip is why dashman shows a red "NO"

    telnet isn't a dashman dependency, it's just another tool to try out.

    sudo apt-get install telnet to install telnet to try. look for 'connected'

    here's me trying it out on one of my nodes.

    Code:
    [email protected]:~$ telnet 162.243.76.23 9999
    Trying 162.243.76.23...
    Connected to 162.243.76.23.
    Escape character is '^]'.
    ^]
    
    telnet> close
    Connection closed.
    [email protected]:~$
    
     
  19. paperThin

    paperThin Member

    Joined:
    Jun 13, 2014
    Messages:
    106
    Likes Received:
    19
    Trophy Points:
    68
    It showed this:
    [email protected]:~$ telnet 162.111.16.160 9999
    Trying 162.111.16.160...
    Connected to 162.111.16.160.
    Escape character is '^]'.
    ^]
    telnet> close
    Connection closed.

    (Still RED and NO for dashd port open.) Any other ideas?
     
  20. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    Problem's definitely within dashman.

    Grant me access to debug in place? I'll share a screen session with you if you like and you can watch me fix the issue.

    Use zerobin.net to send credentials to me -- set 'burn after reading' so only I get them, then message me the link.
     
    • Like Like x 2
  21. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183

    HIGHLY recommended to share access with moocowmoo
    You'll be fixed in no time :-D
     
  22. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    he already did, MangledBlue :)

    I'm just logging in now.

    EDIT: But, I can't work on the problem.
    Something is completely blocking dashpay.io on that box. I can't even ping it. :/

    Code:
    ~/dashman$ ping www.dashpay.io
    PING www.dashpay.io (128.127.106.235) 56(84) bytes of data.
    
    --- www.dashpay.io ping statistics ---
    7 packets transmitted, 0 received, 100% packet loss, time 6000ms
    EDIT: working now
     
    #22 moocowmoo, Oct 17, 2015
    Last edited by a moderator: Oct 17, 2015
    • Like Like x 1
  23. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    problems his netcat is old. doesn't support ipv4/ipv6 flags.. pondering a workaround.

    his:

    Code:
    $ nc -h
    [v1.10-40]
    connect to somewhere:   nc [-options] hostname port[s] [ports] ...
    listen for inbound:     nc -l -p port [-options] [hostname] [port]
    options:
            -c shell commands       as `-e'; use /bin/sh to exec [dangerous!!]
            -e filename             program to exec after connect [dangerous!!]
            -b                      allow broadcasts
            -g gateway              source-routing hop point[s], up to 8
            -G num                  source-routing pointer: 4, 8, 12, ...
            -h                      this cruft
            -i secs                 delay interval for lines sent, ports scanned
            -k                      set keepalive option on socket
            -l                      listen mode, for inbound connects
            -n                      numeric-only IP addresses, no DNS
            -o file                 hex dump of traffic
            -p port                 local port number
            -r                      randomize local and remote ports
            -q secs                 quit after EOF on stdin and delay of secs
            -s addr                 local source address
            -T tos                  set Type Of Service
            -t                      answer TELNET negotiation
            -u                      UDP mode
            -v                      verbose [use twice to be more verbose]
            -w secs                 timeout for connects and final net reads
            -z                      zero-I/O mode [used for scanning]
    port numbers can be individual or ranges: lo-hi [inclusive];
    hyphens in port names must be backslash escaped (e.g. 'ftp\-data').
    mine:

    Code:
    $ nc -h
    OpenBSD netcat (Debian patchlevel 1.105-7ubuntu1)
    This is nc from the netcat-openbsd package. An alternative nc is available
    in the netcat-traditional package.
    usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]
              [-P proxy_username] [-p source_port] [-q seconds] [-s source]
              [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]
              [-x proxy_address[:port]] [destination] [port]
            Command Summary:
                    -4              Use IPv4
                    -6              Use IPv6
                    -b              Allow broadcast
                    -C              Send CRLF as line-ending
                    -D              Enable the debug socket option
                    -d              Detach from stdin
                    -h              This help text
                    -I length       TCP receive buffer length
                    -i secs         Delay interval for lines sent, ports scanned
                    -j              Use jumbo frame
                    -k              Keep inbound sockets open for multiple connects
                    -l              Listen mode, for inbound connects
                    -n              Suppress name/port resolutions
                    -O length       TCP send buffer length
                    -P proxyuser    Username for proxy authentication
                    -p port         Specify local port for remote connects
                    -q secs         quit after EOF on stdin and delay of secs
                    -r              Randomize remote ports
                    -S              Enable the TCP MD5 signature option
                    -s addr         Local source address
                    -T toskeyword   Set IP Type of Service
                    -t              Answer TELNET negotiation
                    -U              Use UNIX domain socket
                    -u              UDP mode
                    -V rtable       Specify alternate routing table
                    -v              Verbose
                    -w secs         Timeout for connects and final net reads
                    -X proto        Proxy protocol: "4", "5" (SOCKS) or "connect"
                    -x addr[:port]  Specify proxy address and port
                    -Z              DCCP mode
                    -z              Zero-I/O mode [used for scanning]
            Port numbers can be individual or ranges: lo-hi [inclusive]
     
    • Like Like x 1
  24. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    so it turns out it's a distro thing. Debian I think. They distribute netcat as two different packages.

    netcat - TCP/IP swiss army knife -- transitional package <-- "nc" only supports ipv4, doesn't have a -4 switch
    netcat-traditional - TCP/IP swiss army knife
    netcat6 - TCP/IP swiss army knife with IPv6 support <-- "nc6" only supports ipv6 (I think, he's installing it now for me to find out)

    yay, platforms!
     
  25. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    • Like Like x 3
  26. paperThin

    paperThin Member

    Joined:
    Jun 13, 2014
    Messages:
    106
    Likes Received:
    19
    Trophy Points:
    68
    MooCow,

    I tried to set up a new MN using ipv6. I see that there are some in the MN list that use ipv6, but mine did not work. I put the address in my masternode.conf file but I get this message kicked back:

    "Invalid port detected in masternode.conf ...
    must be 9999 for mainnet."

    Of course I used the ipv6 address and port :9999 so there is just something missing. I was wondering if someone can show me the correct syntax in the masternode.conf file for a ipv6 address. MooCow, do you know?

    Thanks!!!!!!!
     
  27. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    use square brackets. :)

    ('dashman install' does this for you automatically. :p ) --> https://github.com/moocowmoo/dashman

    masternodeaddr=[ipv6goeshere]:9999
     
    • Like Like x 2
  28. Jeztah

    Jeztah Active Member

    Joined:
    Oct 9, 2014
    Messages:
    181
    Likes Received:
    145
    Trophy Points:
    103
    CentOS release 6.2 (Final)

    Getting an error, the dashd port open line says NO however I did create iptables rules:

    -A INPUT -m state --state NEW -p tcp -m multiport --dport "9998,9999" -j ACCEPT
    -A OUTPUT -m state --state NEW -p tcp -m multiport --dport "9998,9999" -j ACCEPT


    Thanks a bunch
     
    #28 Jeztah, Oct 19, 2015
    Last edited by a moderator: Oct 19, 2015
  29. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    Those line numbers show you're running a slightly older version of .11 which had some netcat problems that I think you may be experiencing.

    Try this command (sync then run status) and see if it fixes you up:
    Code:
    dashman sync status
    you don't have to run sync every time, this hotfix is just between versions at the moment.

    Specifially, 'dashman sync' will pull down my latest commits to master.
    'dashman sync [command]' will do above, then run the command you want.

    I'll bump the release version to .12 once I've 1) made sure the pending commits do what they're supposed to do and 2) collect enough bugfixes/enhancements to warrant a new sub-version release.
     
    #29 moocowmoo, Oct 19, 2015
    Last edited by a moderator: Oct 19, 2015
  30. Jeztah

    Jeztah Active Member

    Joined:
    Oct 9, 2014
    Messages:
    181
    Likes Received:
    145
    Trophy Points:
    103
    The latest: