Linux DASHD - Check and Review - Script

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
nano CODE: - updated from, time to time (zaman zaman)

UPDATED: 06.07.2015

MN code to check your MN
You have to be using dash-cli along with dashd




#!/bin/bash

# -----

MNIP=`wget -qO- http://ipecho.net/plain ; echo | awk "{print \\$2}" | sed -e 's/addr://' | tr "\n" " "`;

export GREP_OPTIONS=--color=always

# -----

function wait_clear() {
PROMPT="
press enter or wait $1 seconds to continue "
read -p "$PROMPT" -t $1 NOOP;
clear;
}

# ----------------------------------------------------------------

wait_clear 1;

cat << EOF
YOU MUST RUN
DASH-CLI
FOR THE DASH REVIEW
WITH MASTERNODE
TO PROCEED PROPERLY
EOF


# ----------------------------

wait_clear 5;

cat << EOF


*** START 'DASH' REVIEW - WITH MASTERNODE
EOF

# ----------------------------

wait_clear 5;

cat << EOF


*** CHECKING YOUR DASH MASTERNODE IP CONNECTION(S) ON PORT: 9999

`netstat -an | grep 9999 | more`


*** CHECKING YOUR DASH 'LISTENING' ABILITY
*** LISTENING, ON PORT : 9999

`netstat -an | grep LISTEN | grep 9999
EOF

# ----------------------------

wait_clear 10;

cat << EOF


***GET-INFO FOR 'DASH'

`./dash-cli getinfo`
EOF

# ----------------------------

wait_clear 8;

cat << EOF


***YOUR DASH MASTERNODE 'IP' SHOULD = ENABLED

`./dash-cli masternode list | grep $MNIP`
EOF

cat << EOF


***ZERO IS THE BEST SCORE FOR YOUR MASTERNODE


`./dash-cli masternode list pose | grep $MNIP`

EOF

# ----------------------------

wait_clear 8;


VOTES=`./dash-cli masternode list votes`

cat << EOF


***ALL VOTING RESULTS FOR THE CURRENT DASH 'VOTE'
-------------------------------------------------


YES = $(echo "$VOTES" | grep -c YEA)
NO = $(echo "$VOTES" | grep -c NAY)
ABSTAIN = $(echo "$VOTES" | grep -c ABSTAIN)
YOUR VOTE = $(echo "$VOTES" | grep $MNIP)

TOTAL MASTERNODE COUNT = $(./dash-cli masternode count)
EOF

# ----------------------------

wait_clear 10;

cat << EOF


HAVE A NICE DAY ........................................
EOF

# ----------------------------

wait_clear 5;

cat << EOF

PLEASE FEEL FREE TO DONATE TO THE FOLLOWING DASH ADDRESS

XexrpL5LWdtzkDRspikBqR5Ue1Kt3zyduv

*33% OF ALL DONATIONS WILL GO TO fuzzyduck
*33% OF ALL DONATIONS WILL GO TO moocowmoo

EOF


exit;








copy and paste into: nano [what-ever-you-want-to-name-it]
to save: CTRL-x
input: chmod +x ./[what-ever-you-named-it]
to run: ./[name]



enjoy :-D
GOD I LOVE DASH :-D

\o/ WOOT !!!!
 
Last edited by a moderator:
  • Like
Reactions: buster

thelazier

Active Member
Jan 5, 2015
240
184
103
Thailand
Dash Address
Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
Sorry to say again here that "dashd [something]" will not available anymore in near future...:D
 
B

buster

Guest
Sorry to say again here that "dashd [something]" will not available anymore in near future...:D
I asked three other spots might as well ask here also just to get it out there so people can see. Care to explain why the dashd command wont be available? I'm not sure I understand why.
 
  • Like
Reactions: MangledBlue

thelazier

Active Member
Jan 5, 2015
240
184
103
Thailand
Dash Address
Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
I asked three other spots might as well ask here also just to get it out there so people can see. Care to explain why the dashd command wont be available? I'm not sure I understand why.
Migrating to 0.10 bitcoin will split "old" dashd to
1) dashd - daemon
2) dash-cli - lightweight cli program to run rpc commands
and "dashd some_command" will not be available anymore

Since the "masternode start" and etc. are rpc commands, all these communication with dash daemon will not allow running with "dashd" but still available for "dash-cli" command.
So, "dashd" is available to start the daemon only. "dashd [something]" will not available like now. you should change to "dash-cli" , including "dash-cli stop" command to stop the daemon.
 

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
Hows about a little more info for us dash-cli noobs
list of commands?

Somebody want to construct a guide - for transitioning to dash-cli?

ugh

now I'll have to use 2 programs to run the MN?
feels like a step backwards.....
 

thelazier

Active Member
Jan 5, 2015
240
184
103
Thailand
Dash Address
Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
Hows about a little more info for us dash-cli noobs
list of commands?

Somebody want to construct a guide - for transitioning to dash-cli?

ugh

now I'll have to use 2 programs to run the MN?
feels like a step backwards.....
All the command run with dashd can be used by dash-cli with same parameter and format so I understand that just change dashd to dash-cli will works except the starting daemon , only "dashd" can do.
 

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
So go to dashd : dashd masternode start
then
go to dash-cli and do everything else?


if that's the case - no biggy


I was starting to freak out that I had to re-learn a bunch of stuff




thanx for the info :)
 

UdjinM6

Official Dash Dev
Core Developer
Dash Core Group
May 20, 2014
3,639
3,537
1,183
So go to dashd : dashd masternode start
then
go to dash-cli and do everything else?


if that's the case - no biggy


I was starting to freak out that I had to re-learn a bunch of stuff




thanx for the info :)
Not exactly:
1. start daemon (by hands or in cron):
dashd
2. issue some commands:
dash-cli getinfo
dash-cli masternode start

dash-cli masternode list
.....
3. stop daemon (if you need to):
dash-cli stop

EDIT: edited for readability
 

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
so ONLY dashd to start

do everything else in dash-cli

correct?


So I'll have to move/copy dash-cli to .dash DIR


ok - I think I got this figured out now

between you and Lazy - I think I got this :-D


please correct me if I'm wrong :-D
 

UdjinM6

Official Dash Dev
Core Developer
Dash Core Group
May 20, 2014
3,639
3,537
1,183
so ONLY dashd to start

do everything else in dash-cli

correct?


So I'll have to move/copy dash-cli to .dash DIR


ok - I think I got this figured out now

between you and Lazy - I think I got this :-D


please correct me if I'm wrong :-D
You need to move dashd and dash-cli to the same path where you were usually moving dashd on update

oh


I will need to : chmod +x ./dash-cli

right?
Yep, and for dashd too - you still need it to run daemon itself
 
  • Like
Reactions: splawik21

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
You need to move dashd and dash-cli to the same path where you were usually moving dashd on update



Yep, and for dashd too - you still need it to run daemon itself

I already have the chmod +x ./dashd

but are you saying that I'll need to do the following once I copy and chmod the dash-cli?

./dashd
./dashd masternode start
./dash-cli
./dash-cli [cmd}
./dash-cli [cmd}

like so?
 

UdjinM6

Official Dash Dev
Core Developer
Dash Core Group
May 20, 2014
3,639
3,537
1,183
  • Like
Reactions: moli

UdjinM6

Official Dash Dev
Core Developer
Dash Core Group
May 20, 2014
3,639
3,537
1,183
What is the reason for this split?
isn't it more reasonable to keep it all in one executable ?
The idea behind this is to have small standalone program that does nothing but rpc calls and has literally no complicated lib dependences. So you can compile it with just some c compiler and no qr, leveldb and all that kind of stuff.
 

thelazier

Active Member
Jan 5, 2015
240
184
103
Thailand
Dash Address
Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
IMO, removing CLI functionality of RPC from daemon itself help reduce overhead during starting daemon and make smaller memory footprint , give better performance and faster startup... :)
 

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
The idea behind this is to have small standalone program that does nothing but rpc calls and has literally no complicated lib dependences. So you can compile it with just some c compiler and no qr, leveldb and all that kind of stuff.
so does that mean we want to move to a more "simple" form - like portable devices (smartphones) - and if so - did you see my proposal/theory for dynamic IP resolve on BCTalk

If I knew how to code - I'd send you "something"

read it and tell me I'm crazy - then find somebody to code it - lol

https://bitcointalk.org/index.php?topic=421615.msg11529451#msg11529451

"
There should/could be a way for the MN COLD side (dashd and/or dash-cli) to "ping" a request for the current IP every few seconds/minutes - Then the COLD side uses some kind of code to alter the COLD side .conf file IP - then send that same .conf file IP change to the HOT side thus keeping your MN in-sync with the IP while also letting the WHOLE MN system know that your IP change has occurred.
LOL - I can see it now - A separate and NEW file would need to be created called: mnip.conf
- that only contains your MN IP = write to mnip.conf new IP"


etc
 

MangledBlue

Well-known Member
Jun 28, 2014
1,246
678
183
USA
point is- even if you replace the IP with a malicious IP - your MN still gets paid - unless mismatched with hot and cold

I just don't see dynamics IPs as an issue when you write to mnip.conf and send that "file" to the hot wallet if you have an encrypted confirmation signature - hand-shake - or whatever​
 

gujo82

New Member
Masternode Owner/Operator
Jun 16, 2014
29
4
8
Got a small linux question regarding this switch.. Forgot to document everything when setting up my MNs, so abit in the dark here howto get dash-cli registered "globally" in the server, so it can be used from any directory?

currently i start dashd from /usr/bin/ , and i can run all dashd commands from where-ever in the system..

have tried placing dash-cli in usr/bin/ , altered chmod etc, but still only tells me it cant connect to the dash server.. both are running with the same account.

edit: and now for some reason, it just works after a reboot... thought that magic was only for windows ;) :D
 
Last edited by a moderator: