Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

Linux DASHD - Check and Review - Script

Discussion in 'General Discussion' started by MangledBlue, Jun 2, 2015.

  1. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    #1 MangledBlue, Jun 2, 2015
    Last edited by a moderator: Jun 7, 2015
  2. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    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 !!!!
     
    #2 MangledBlue, Jun 2, 2015
    Last edited by a moderator: Jun 7, 2015
    • Like Like x 1
  3. fuzzyduck

    fuzzyduck Active Member

    Joined:
    Feb 19, 2015
    Messages:
    134
    Likes Received:
    113
    Trophy Points:
    93
    You're welcome! Al this credits for my simple script,, amazing!! :)
     
  4. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    Dash Address:
    Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
    Sorry to say again here that "dashd [something]" will not available anymore in near future...:D
     
  5. buster

    buster Guest

    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 Like x 1
  6. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    Dash Address:
    Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
    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.
     
    • Like Like x 3
  7. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    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.....
     
  8. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    Dash Address:
    Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
    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.
     
  9. TaoOfSatoshi

    TaoOfSatoshi Grizzled Member

    Joined:
    Jul 15, 2014
    Messages:
    2,714
    Likes Received:
    2,610
    Trophy Points:
    1,183
    So if I want to check my Masternodes it will be

    dash-cli masternode list | grep BLABLABLA?
     
  10. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    Dash Address:
    Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
    Yes, sir . You can try now, the dash-cli already included in your current installation. :)
     
    • Like Like x 1
  11. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    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 :)
     
  12. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    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
     
    • Like Like x 3
  13. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    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
     
  14. MangledBlue

    MangledBlue Well-known Member

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


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

    right?
     
  15. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    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
     
    • Like Like x 1
  16. MangledBlue

    MangledBlue Well-known Member

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

    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?
     
  17. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    errr... no....

    I'm saying this https://dashtalk.org/threads/linux-dashd-check-and-review-script.5066/#post-55797
    and that you will need to update both dashd and dash-cli and make them executable
     
    • Like Like x 1
  18. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,637
    Likes Received:
    3,536
    Trophy Points:
    1,183
    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.
     
    • Like Like x 4
  19. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    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... :)
     
    • Like Like x 2
  20. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    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
     
  21. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    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 ​
     
  22. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    UPDATED: 06.07.2014
    go to posts 1 and 2 of this thread

    thx
     
  23. Rux

    Rux Member

    Joined:
    Mar 9, 2014
    Messages:
    68
    Likes Received:
    32
    Trophy Points:
    58
    Can we send via instantx using rpc commands? :)
     
  24. MangledBlue

    MangledBlue Well-known Member

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

    I've yet to see that CMD :p
    lol
     
  25. gujo82

    gujo82 New Member
    Masternode Owner/Operator

    Joined:
    Jun 16, 2014
    Messages:
    29
    Likes Received:
    4
    Trophy Points:
    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
     
    #25 gujo82, Aug 17, 2015
    Last edited by a moderator: Aug 17, 2015
  26. thelazier

    thelazier Active Member

    Joined:
    Jan 5, 2015
    Messages:
    240
    Likes Received:
    184
    Trophy Points:
    103
    Dash Address:
    Xreiza1qGJMT5BpW6BDtRJqwtcBSxGwWYN
    With our new release version of Dash core wallet, the command is "sendtoaddressix" as you may have seen it's action in evan's video clip.
     
  27. MangledBlue

    MangledBlue Well-known Member

    Joined:
    Jun 28, 2014
    Messages:
    1,246
    Likes Received:
    678
    Trophy Points:
    183
    Yep - I like it - good stuff
    Pay a bunch of people - REALLY REALLY FAST -
     
    • Like Like x 1