Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

delete

Discussion in 'Masternode Guides' started by bituzer, Jun 28, 2014.

  1. bituzer

    bituzer Member

    Joined:
    Apr 23, 2014
    Messages:
    19
    Likes Received:
    26
    Trophy Points:
    78
    .
     
    #1 bituzer, Jun 28, 2014
    Last edited: Apr 3, 2019
    • Like Like x 2
  2. vertoe

    vertoe Three of Nine

    Joined:
    Mar 28, 2014
    Messages:
    2,574
    Likes Received:
    1,656
    Trophy Points:
    1,283
    This indeed updates the darkcoin daemon, but it does not restart the masternode.
     
  3. yamada

    yamada New Member

    Joined:
    May 26, 2014
    Messages:
    31
    Likes Received:
    21
    Trophy Points:
    8
  4. DrkMiner

    DrkMiner Member

    Joined:
    Jun 7, 2014
    Messages:
    204
    Likes Received:
    63
    Trophy Points:
    88
    I used the code above and improved it a bit...

    Code:
    #!/bin/sh
    echo "########### This script will update the Master Node"
    sleep 5
    VERSION=64
    URL=$1
    FILE=${URL##*/}
    DIR=${FILE%.tar.gz}
    IP=$(hostname -I)
    wget $URL
    tar xzvf $FILE
    echo "########### Stopping the Master Node"
    ./darkcoind stop
    sleep 7
    rm darkcoind
    cp $DIR/bin/$VERSION/darkcoind .
    chmod 755 darkcoind
    rm $FILE
    rm -rf $DIR
    rm .darkcoin/peers.dat
    echo "########### Restarting the updated Master Node"
    sleep 5
    ./darkcoind
    sleep 15
    ./darkcoind getinfo
    sleep 5
    echo "########### Master Node status - Active: 1, Inctive: 0"
    ./darkcoind masternode list | grep $IP
    
    save as update.sh and chomd 755
    run from SSH:
    ./update.sh https://raw.githubusercontent.com/d...es/master/rc/darkcoin-0.10.12.32-linux.tar.gz

    link to the new/update tar.gz file will be available on Darkcoin.io

    If HOT wallet is used on the MN a new wallet is needed to upgrade to the new RC5.
     
    #4 DrkMiner, Sep 21, 2014
    Last edited by a moderator: Sep 21, 2014
    • Like Like x 5
  5. DrkMiner

    DrkMiner Member

    Joined:
    Jun 7, 2014
    Messages:
    204
    Likes Received:
    63
    Trophy Points:
    88
    echo "########### Restarting the updated Master Node"
    sleep 5
    ./darkcoind
    sleep 30
    ./darkcoind getinfo
    sleep 20
    echo "########### Master Node status - Active: 1, Inctive: 0"
    ./darkcoind masternode list | grep $IP

    In some cases you will need to increase the "sleep" time to give darkcoind more time to fully load.
     
  6. tungfa

    tungfa Administrator
    Dash Core Team Foundation Member Masternode Owner/Operator Moderator

    Joined:
    Apr 9, 2014
    Messages:
    8,881
    Likes Received:
    6,707
    Trophy Points:
    1,283
    that is great,
    can you please post a final version in the OP ?!
    tx
     
  7. camosoul

    camosoul Grizzled Member

    Joined:
    Sep 19, 2014
    Messages:
    2,160
    Likes Received:
    1,110
    Trophy Points:
    1,183
    Oh, contrariwise; you most absolutely must without exception, always. The new daemon will not know it is an MN in spite of there being such in the config. Without a "masternode start" it will just sit there, never ping the network, become inactive, then drop off the list entirely, and when using start-many, that's a pain to deal with... Ask me how I know this...

    Even when you do a "masternode start" it often does not stick and has to be re-issued over and over and over again until you see "last seen" reset on it's own, without issuing the "masternode start" command. Just keep doing "masternode start" until the daemon starts pinging, or you're going to have one hell of a mess and probably be forced to destroy all your VMs, move all your DRK to new addresses, and start over completely.
     
    #7 camosoul, Nov 19, 2014
    Last edited by a moderator: Nov 19, 2014
  8. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    my "hat in the ring" version. Note: hardcoded for 64bit linux... YMWV


    Code:
    #!/bin/bash
    
    GETURL=https://raw.githubusercontent.com/darkcoinproject/darkcoin-binaries/master/
    
    if [ -z $1 ] ; then
        echo "usage: $0 darkcoinversion"
        echo "eg: $0 0.10.16.16"
        exit
    fi
    
    version=$1
    
    GETFILE=darkcoin-${version}-linux.tar.gz
    GETURL=${GETURL}${GETFILE}
    
    if [ ! -e $GETFILE ] ; then
        wget $GETURL
    fi
    
    if [ ! -e $GETFILE ] ; then
        echo "error downloading file"
        echo "tried to get ${GETURL}"
        exit
    fi
    
    #unpack it
    tar zxvf $GETFILE
    
    #copy it
    cp darkcoin-${version}-linux/bin/64/darkcoind ~/.darkcoin/darkcoind-${version}
    
    #remove unneeded
    rm -rf darkcoin-${version}-linux
    
    #work it
    cd ~/.darkcoin
    
    #stop it
    darkcoind stop
    
    #wait it
    sleep 5
    
    #clean it
    rm -f debug.log peers.dat
    
    #link it
    rm darkcoind && ln -s darkcoind-${version} darkcoind
    
    #start it
    ./darkcoind &
    
    Brittle, could use more error handling... but as long as the directory/filename structures remain consistent... should work until it doesn't.

    :)
     
  9. UdjinM6

    UdjinM6 Official Dash Dev
    Dash Core Team Moderator

    Joined:
    May 20, 2014
    Messages:
    3,631
    Likes Received:
    3,532
    Trophy Points:
    1,183
    Ok, here is mine :)
    Code:
    #!/bin/bash
    date
    
    if [ $1 ]; then
    DARK=darkcoin-$1-linux
    wget https://github.com/darkcoinproject/darkcoin-binaries/raw/master/$DARK.tar.gz
    tar -xvf $DARK.tar.gz
    chmod u+x $DARK/bin/64/darkcoind
    else
    cd ~/darkcoin/
    git pull
    cd src/
    make -f makefile.unix USE_UPNP=-
    fi
    
    darkcoind stop
    sleep 5
    mv /usr/bin/darkcoind /usr/bin/darkcoind.old
    
    if [ $1 ]; then
    mv $DARK/bin/64/darkcoind /usr/bin/
    rm -r $DARK*
    else
    cp darkcoind /usr/bin/
    fi
    
    darkcoind
    Usage is
    Code:
    ./mn_update.sh 0.10.16.16
    to get binaries of exact version or
    Code:
    ./mn_update.sh
    to get latest github commit and compile by yourself (you have to have all needed dev libs installed first of course)
     
    • Like Like x 2
  10. oblox

    oblox Well-known Member

    Joined:
    Aug 6, 2014
    Messages:
    1,032
    Likes Received:
    537
    Trophy Points:
    183
    You only need to issue a masternode start from local assuming the remote masternode isn't offline for too long to drop off the list on protocol bumps. If the protocol stays the same, using anyone of these update scripts to stop the remote masternode for about 30-60 seconds while updating won't require you to load the local wallet up.
     
  11. tungfa

    tungfa Administrator
    Dash Core Team Foundation Member Masternode Owner/Operator Moderator

    Joined:
    Apr 9, 2014
    Messages:
    8,881
    Likes Received:
    6,707
    Trophy Points:
    1,283
    Can you please start working on "rebranding" the guide ?!
    that would be great and super appreciated
    Tx
     
  12. tungfa

    tungfa Administrator
    Dash Core Team Foundation Member Masternode Owner/Operator Moderator

    Joined:
    Apr 9, 2014
    Messages:
    8,881
    Likes Received:
    6,707
    Trophy Points:
    1,283
    whow are you fast !!
    I did not see that , sorry
    well done and tx
     
  13. BolehVPN

    BolehVPN Active Member

    Joined:
    Nov 24, 2014
    Messages:
    195
    Likes Received:
    301
    Trophy Points:
    123
    Hi :D I have updated the script but it requires 'bash'
    it's a bit of a hacky way so I'm open to how to improve it (I'm not a programmer)

    For upgrading to v12.

    #!/bin/bash
    echo "########### This script will update the Master Node"
    sleep 5
    URL=$1
    FILE=${URL##*/}
    DIR=${FILE:0:11}
    cd ~/.dash
    wget $URL
    tar xzvf $FILE
    echo "########### Stopping the Master Node"
    ./dashd stop
    sleep 5
    rm dashd
    cp $DIR/bin/dashd .
    cp $DIR/bin/dash-cli .
    chmod 755 dashd
    rm $FILE
    rm -rf $DIR
    rm peers.dat debug.log db.log
    echo "########### Restarting the updated Master Node"
    sleep 2
    ./dashd -reindex

    Once on v12 and future updates (provided no more changes in directory structure)

    #!/bin/bash
    echo "########### This script will update the Master Node"
    sleep 5
    URL=$1
    FILE=${URL##*/}
    DIR=${FILE:0:11}
    cd ~/.dash
    wget $URL
    tar xzvf $FILE
    echo "########### Stopping the Master Node"
    ./dash-cli stop
    sleep 5
    rm dashd
    cp $DIR/bin/dashd .
    cp $DIR/bin/dash-cli .
    chmod 755 dashd
    rm $FILE
    rm -rf $DIR
    rm peers.dat debug.log db.log
    echo "########### Restarting the updated Master Node"
    sleep 2
    ./dashd
     
    • Like Like x 2
  14. DarkWater

    DarkWater Well-known Member
    Foundation Member

    Joined:
    May 14, 2014
    Messages:
    111
    Likes Received:
    98
    Trophy Points:
    193
    BolehVPN THANK YOU! This made my life alot easier! Now I can update all my NM! Meant to update sooner but Ill have to redo all my scripts to get this ball rolling.
     
    • Like Like x 1
  15. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    For all you folks running version 12 on linux:

    https://github.com/moocowmoo/dashman

    (Read the README, this script places the executables in ~/.dash -- I'll add destination folders eventually.)

    [​IMG]

    Let me know if you run into any trouble. I'll push bugfixes as we find them. ;)

    (32bit install untested, but should work, lmk)
     
    #15 moocowmoo, Aug 26, 2015
    Last edited by a moderator: Aug 26, 2015
  16. Solaso

    Solaso Member

    Joined:
    Aug 20, 2015
    Messages:
    134
    Likes Received:
    20
    Trophy Points:
    68
    Please tell me about work on Ubuntu?
     
  17. Solaso

    Solaso Member

    Joined:
    Aug 20, 2015
    Messages:
    134
    Likes Received:
    20
    Trophy Points:
    68
    Thank you. Please tell me, can I add this to autoload and add to crontab?
     
  18. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    It will work fine on ubuntu.

    It is meant to be run manually.

    It expects your dashd and dash-cli be in your ~/.dash folder.
    (I'm working on making that part smarter for alternate layouts.)
     
    • Like Like x 1
  19. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    Update script updated (through the power of scripting!)

    UPDATES
    • Will now attempt to locate where you've installed your dashd/dash-cli
    • Shows pretty output of what its done (and where it's done it!)
    BUGS
    • Probably
    • Still only works on Linuxes
    • Still can't deliver beers on demand
    • Others you haven't told me about yet

    [​IMG]

    get it at https://github.com/moocowmoo/dashman

    And let me know if you run into trouble!
     
    • Like Like x 5
  20. DarkWater

    DarkWater Well-known Member
    Foundation Member

    Joined:
    May 14, 2014
    Messages:
    111
    Likes Received:
    98
    Trophy Points:
    193
    This update script rocks! Just switched over to this and it went smooth as butter. Now if I can figure out why I can't successfully resync to the network. Block height matches but doesn't show up on the list.
     
  21. Solaso

    Solaso Member

    Joined:
    Aug 20, 2015
    Messages:
    134
    Likes Received:
    20
    Trophy Points:
    68
    Thank you, in manual I see error
    for it to work you need a symbolic link from /usr/bin/dashd to ~/.dash/dashd: "sudo ln -s ~/.dash/dashd /usr/bin/" and same for dash-cli "sudo ln -s ~/.dash/dashd /usr/bin/"

    Double sudo ln -s ~/.dash/dashd /usr/bin/ may be one sudo ln -s ~/.dash/dash-cli /usr/bin/"
     
  22. Solaso

    Solaso Member

    Joined:
    Aug 20, 2015
    Messages:
    134
    Likes Received:
    20
    Trophy Points:
    68
    [email protected]:/home/user1/dashman# ./update_dashd.sh
    readlink: missing operand
    Try 'readlink --help' for more information.
    dashd not found in -- Exiting.

    On my server dashd upper folder dash. Where I wrong? Thank you
     
  23. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    update_dashd.sh looks in three places for dash-cli and dashd:
    • the current directory
    • ~/.dash
    • all directories in your PATH variable
    In your case, do:
    Code:
    cd ~/dash
    ../dashman/update_dashd.sh
    and it should work. Let me know if you have more trouble.
     
  24. Solaso

    Solaso Member

    Joined:
    Aug 20, 2015
    Messages:
    134
    Likes Received:
    20
    Trophy Points:
    68
    Yes) I started this

    [email protected]:/$ cd ~/
    [email protected]:~$ dashman/update_dashd.sh

    But I see finished install

    Installed in /home/user1

    -rw-rw-r-- 1 19892539 Sep 4 18:10 dash-0.12.0.53-linux64.tar.gz
    -rw-rw-r-- 1 186 Sep 4 18:10 dash-0.12.0.53-linux64.tar.gz.DIGESTS.txt
    lrwxrwxrwx 1 18 Sep 5 19:59 dash-cli -> dash-cli-0.12.0.53
    -rwxr-xr-x 1 2548784 Jan 10 2014 dash-cli-0.12.0.53
    lrwxrwxrwx 1 15 Sep 5 19:59 dashd -> dashd-0.12.0.53
    -rwxr-xr-x 1 9423200 Jan 10 2014 dashd-0.12.0.53
    lrwxrwxrwx 1 17 Sep 5 19:59 dash-qt -> dash-qt-0.12.0.53
    -rwxr-xr-x 1 13339504 Jan 10 2014 dash-qt-0.12.0.53

    Its right? Or now I should to rename dashd-0.12.0.53 to dashd?
     
  25. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    If that's where you wanted it installed, sure.
    No need to rename, it's symlinked. ./dashd and ./dash-cli will just work.
     
    • Like Like x 1
  26. Solaso

    Solaso Member

    Joined:
    Aug 20, 2015
    Messages:
    134
    Likes Received:
    20
    Trophy Points:
    68
    Thank you! Can I start this in cron? For example once in week?
     
    #26 Solaso, Sep 5, 2015
    Last edited by a moderator: Sep 5, 2015
  27. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    not yet. Future versions will support unattended installs.
     
    • Like Like x 1
  28. Solaso

    Solaso Member

    Joined:
    Aug 20, 2015
    Messages:
    134
    Likes Received:
    20
    Trophy Points:
    68
    Good news! Thank you!
     
  29. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    Version 0.1 of dashman released upon the world! run away, run away!
    (commands have changed, so re-read the README!)

    https://github.com/moocowmoo/dashman

    but, seriously, lmk if you run into borks. :)

    install (fresh)
    [​IMG]

    update (fresher)
    [​IMG]

    reinstall (refresh it!) (by request)
    [​IMG]
     
    • Like Like x 2
  30. moocowmoo

    moocowmoo Bovine Bit-flipper
    Foundation Member Masternode Owner/Operator

    Joined:
    Jun 15, 2014
    Messages:
    483
    Likes Received:
    603
    Trophy Points:
    263
    Dash Address:
    XmoocowYfrPKUR6p6M5aJZdVntQe71irCX
    shameless bump.

    now with statusy goodness!

    [​IMG]
     
    • Like Like x 3

Share This Page