dashman - linux masternode mangement made mootastic

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
Dash Address
XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
https://github.com/moocowmoo/dashman

*now with voting goodness! (beta)




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


update


reinstall


restart


status


vote




Contact
Email me at [email protected] or submit a pull request.
 
Last edited by a moderator:

italx

Well-known Member
Foundation Member
Jul 31, 2014
65
52
158
California
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
Reactions: stan.distortion

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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
Reactions: MrZilch

SirHikmat

Member
Nov 15, 2014
93
57
68
beautiful project! Thanks a lot for your commitment. I hope I'll once have the chance to make an useful pull request :)
 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
Dash Address
XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
beautiful project! Thanks a lot for your commitment. I hope I'll once have the chance to make an useful pull request :)
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
Reactions: fuzzyduck

SirHikmat

Member
Nov 15, 2014
93
57
68
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.
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!
 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
Dash Address
XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
Yeah, .53 and .55 is kind of unstable in docker.
That's unfortunate to hear. I was hoping to use docker for a lot of upcoming testing projects.
Any ideas why?

We stopped working on the project some weeks ago and copied-pasted some scripts together. But now, we will definitely use your script package!
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...
 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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'.

 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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
 
Last edited by a moderator:

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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'
 
Last edited by a moderator:

paperThin

Member
Jun 13, 2014
106
19
68
I think this is it for now... enjoy!

dashman version 0.1.11 released


protip: you can always run the latest version by prepending 'sync' to your command like 'dashman sync status'
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
 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
Dash Address
XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
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
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.
 
Last edited by a moderator:
  • Like
Reactions: stan.distortion

paperThin

Member
Jun 13, 2014
106
19
68
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 most network configurations can connect back to themselves.
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!!!!!!!!!!!!!
 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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]:~$
 

paperThin

Member
Jun 13, 2014
106
19
68
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 '^]'.
^]

This is what I got... looks ok from what I can tell.

telnet> close
Connection closed.
[email protected]:~$
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?
 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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.
 

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
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.

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

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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
 
Last edited by a moderator:
  • Like
Reactions: stan.distortion

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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
Reactions: stan.distortion

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
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!
 

paperThin

Member
Jun 13, 2014
106
19
68
commit 100! w00t!

should fix the issue (for this platform at least!) https://github.com/moocowmoo/dashman/commit/52f7369b0203609ccba6248a9071817d2fe3139b

(run dashman sync to pull this in if it's affecting you, already done on the box you gave me access to, paperThin ! Thanks again! )
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!!!!!!!
 

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
Dash Address
XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
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!!!!!!!
use square brackets. :)

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

masternodeaddr=[ipv6goeshere]:9999
 

Jeztah

Active Member
Oct 9, 2014
181
145
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


[[email protected] dashman]# ./dashman status
Connection to 8.8.8.8 53 port [tcp/domain] succeeded!
dashman version 0.1.11
gathering info, please wait...which: no dash-cli in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/xxxx/bin)
No JSON object could be decoded
/xxxx/dashman/lib/dashman_functions.sh: line 702: [: too many arguments
DONE!

host uptime/load average : 413 days, 0.58 0.75 0.59
dashd bind ip address : xxx.xxx.xxx.xxx
dashd version : 0.12.0.55
dashd up-to-date : YES
dashd running : YES
dashd uptime : 0 days, 0 hours, 21 mins, 45 secs
dashd responding (rpc) : YES
dashd listening (ip) : YES
dashd connecting (peers) : YES
dashd port open : /xxxx/dashman/lib/dashman_functions.sh: line 787: [: too many arguments
NO
dashd connection count : 8
dashd blocks synced : YES
last block (local dashd) : 355561
(chainz) : 355561
(darkcoin.qa) : 355561
(dashwhale) : /xxxx/dashman/lib/dashman_functions.sh: line 793: [: -gt: unary operator expected

(masternode.me) : 355561 - no forks detected
masternode count : 3318
Exiting.
Thanks a bunch
 
Last edited by a moderator:

moocowmoo

Bovine Bit-flipper
Foundation Member
Jun 15, 2014
483
603
263
masternode.me
Dash Address
XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
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
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.
 
Last edited by a moderator:

Jeztah

Active Member
Oct 9, 2014
181
145
103
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.
The latest:

No local changes to save
Already on 'master'
fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
Connection to 8.8.8.8 53 port [tcp/domain] succeeded!
dashman version 0.1.11
gathering info, please wait...which: no dash-cli in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/xxxxx/bin)
No JSON object could be decoded
/xxxx/dashman/lib/dashman_functions.sh: line 702: [: too many arguments
DONE!

host uptime/load average : 413 days, 1.83 1.02 0.45
dashd bind ip address : xxxxxxxxxxxxxxxxxxxxx
dashd version : 0.12.0.55
dashd up-to-date : YES
dashd running : YES
dashd uptime : 0 days, 0 hours, 06 mins, 48 secs
dashd responding (rpc) : YES
dashd listening (ip) : YES
dashd connecting (peers) : YES
dashd port open : /xxxxx/dashman/lib/dashman_functions.sh: line 787: [: too many arguments
NO
dashd connection count : 8
dashd blocks synced : NO
last block (local dashd) : 353803
(chainz) : 355599
(darkcoin.qa) : 355599
(dashwhale) : /xxxxxx/dashman/lib/dashman_functions.sh: line 793: [: -gt: unary operator expected

(masternode.me) : 355598 - no forks detected
masternode count : 0
Exiting.