Giter VIP home page Giter VIP logo

dashman's Introduction

dashman

DASH wallet/daemon management utilities - version 0.1.28

  • 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 supported

Install/Usage

To install dashman do:

sudo apt-get install python git unzip pv
cd ~ && git clone https://github.com/moocowmoo/dashman

To update your existing version 12 32/64bit linux dash wallet to the latest dashd, do:

dashman/dashman update

To perform a new install of dash, do:

dashman/dashman install

To overwrite an existing dash install, do:

dashman/dashman reinstall

To update dashman to the latest version, do:

dashman/dashman sync

To restart (or start) dashd, do:

dashman/dashman restart

To get the current status of dashd, do:

dashman/dashman status

Commands

sync

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

install

"dashman install" downloads and initializes a fresh dash install into ~/.dashcore 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, ~/.dashcore, 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, ~/.dashcore, and $PATH. It will prompt to restart if not given the optional 'now' argument.

screencap

status

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

screencap

Dependencies

  • bash version 4
  • nc (netcat)
  • curl
  • perl
  • pv
  • python
  • unzip
  • dashd, dash-cli - version 12 or greater to update

Screencaps

install

update

reinstall

restart

status

Contact

Email me at [email protected] or submit a pull request.

dashman's People

Contributors

ashmoran avatar moocowmoo avatar rtreutlein avatar thelazier avatar tombtc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dashman's Issues

Difference HEAD <-> Master?

I get this when I try to sync:

dashman version 0.1.25 (25-g10d3dec) - 2017-4-1 Saturday 15:35:15 CEST
Fetching origin
No local changes to save
Already on 'master'
Your branch is up-to-date with 'origin/master'.
HEAD is now at 10d3dec bugfix - masternodeaddr -> externalip
Up to date.

Testnet support

Hello developers, I tried installing dash-core by following the instructions provided here: https://docs.dash.org/en/latest/masternodes/setup.html#option-1-automated-installation-using-dashman
after that I opened ~/.dashcore/dash.conf and added two lines in it:

testnet=1
rest=1

then I ran : ~/dashman/dashman restart
with the following as the output:

restart dashd? [y/N] y
 --> Stopping dashd. Please wait...DONE!
 --> Deleting cache files, debug.log... DONE!
 --> Starting dashd... DONE!
 --> Waiting for dashd to respond...DONE!
 --> dash-cli getinfo
error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)

Exiting.

What could be the possible reasons,Thanks for any help :)

dashman vote not working after update to 12.1

$ ~/dashman/dashman vote
dashman version 0.1.23 (1-g1601750) 
gathering info, please wait...  DONE!

Traceback (most recent call last):
  File "/home/mn/dashman/bin/dashvote.py", line 431, in <module>
    curses.wrapper(main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/mn/dashman/bin/dashvote.py", line 225, in main
    ballots = json.loads(run_command('dash-cli mnbudget show'))
  File "/home/mn/dashman/bin/dashvote.py", line 64, in run_command
    return subprocess.check_output(cmd, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 574, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'dash-cli mnbudget show' returned non-zero exit status 89
Exiting.

Why does `dashman restart` delete debug.log?

This is quite annoying if dash crashes and you want to bring it back up asap. You have to remember to copy debug.log, or all the info will be lost. Is there any reason to delete this file? If yes, it should be copied to a different location instead.

Sentinel tests Fail (too many arguments)

I'm getting the following error on my node from ./dashman status:

sentinel tests passed    : /home/dash/dashman/lib/dashman_functions.sh: line 1128: [: too many arguments
NO

Everything is working fine, and dashman status isn't showing any other errors/warnings (everything is green). So I'm mostly curious what's wrong here.

Ubuntu 16.04
Dash 0.12.1.5
Dashman 7a3f2f1 (latest)

-gt: unary operator expected

If sentinel is not installed (or not installed in default folder) cause the error. Double brackets solve the issue [[ ]]

pending " sentinel installed : " ; [[ $SENTINEL_INSTALLED -gt 0 ]] && ok "${messages["YES"]}" || err "${messages["NO"]}"

pending " sentinel tests passed : " ; [[ $SENTINEL_PYTEST -eq 0 ]] && ok "${messages["YES"]}" || err "${messages["NO"]}"

pending " sentinel crontab enabled : " ; [[ $SENTINEL_CRONTAB -gt 0 ]] && ok "${messages["YES"]}" || err "${messages["NO"]}"

mn_error_gt

no wait from prompt when embbeding dashman in another Bash script

I'm trying to automate the configuration of a new VPS, including updating the system, creating users, firewall rules, etc. I was testing dashman to speed up coding, but the script doesn't wait for the Y/n prompt and just plows ahead as if the job is done - and of course, errors appear.

I've been testing variations with the 'wait' command, but I guess the spawning of multiple sequential processes from the same command line makes wait move on after the first one is successfully completed. Do you know a simple way I could implement this, so that the main script behaves correctly and waits for all processes to finish before advancing?

I also see in the code options for unattended installation (so skipping prompts and yes-ing everything?), but I didn't see any instructions in the Readme (and didn't look too hard in the code, sry). Would this help?

Docker support?

Is it possible to create a Docker image or provide a Dockerfile in repo? Thanks in advance

dashman status not working when dash.org can't be reached

$ ./dashman status                              
dashman version 0.1.19 (15-gae00e67) - Fri Aug  5 09:50:33 UTC 2016           
gathering info, please wait...                                                
Could not find latest version from https://www.dash.org/downloads/ -- Exiting.

Is it possible to go through with the status anyway and write N/A for fields that could not be retrieved?

Test for "nc -4" fails on Ubuntu 16.04

Newer versions of netcat support both IPv4 and IPv6 and (for example) on Ubunutu 16.04 there is only on netcat package. This newer version of netcat does not have the "-4" and "-6" options anymore. Therefore the test in dashman/lib/dashman_functions.sh lines 164 and following fails, even if netcat is properly installed. It also suggest to run apt-get install netcat6 which does not work anymore as there is no netcat6 package.

Fresh install: chown Operation not permitted messages

Fresh install as user:

chown: changing ownership of ‘dashcore-0.12.2.1-linux64.tar.gz’: Operation not permitted chown: changing ownership of ‘dashcore-0.12.2.1-linux64.tar.gz.DIGESTS.txt’: Operation not permitted chown: changing ownership of ‘dash-cli’: Operation not permitted chown: changing ownership of ‘dashd’: Operation not permitted chown: changing ownership of ‘dash-qt’: Operation not permitted chown: changing ownership of ‘dash-cli-0.12.2.1’: Operation not permitted chown: changing ownership of ‘dashd-0.12.2.1’: Operation not permitted chown: changing ownership of ‘dash-qt-0.12.2.1’: Operation not permitted

Should I worry?

dashman update fail

Greetings

While trying to get away easy by using the glorious dashman tool I ran into a problem:

dashman version 0.1.25 (36-g7a3f2f1) - Di 14. Nov 13:00:44 UTC 2017
gathering info, please wait...  DONE!

*** a newer version of dash is available. ***

  current version:  0.12.1.5
   latest version:  0.12.2.1

download https://www.dash.org/binaries/dashcore-0.12.2.1-linux64.tar.gz
and install to /root/.dashcore? [y/N] y
 --> Downloading https://www.dash.org/binaries/dashcore-0.12.2.1-linux64.tar.gz... DONE!
 --> Checksumming dashcore-0.12.2.1-linux64.tar.gz... DONE!
 --> Unpacking dashcore-0.12.2.1-linux64.tar.gz... DONE!
 --> Stopping dashd. Please wait...DONE!
 --> Removing old version... DONE!
mv: cannot stat 'dashcore-0.12.1/bin/dashd': No such file or directory
mv: cannot stat 'dashcore-0.12.1/bin/dash-cli': No such file or directory
 --> Launching dashd... /root/dashman/lib/dashman_functions.sh: line 529: /root/.dashcore/dashd: No such file or directory
DONE!
 --> Waiting for dashd to respond...DONE!
 --> updating sentinel... DONE!
  --> updating crontab... DONE!
/root/dashman/lib/dashman_functions.sh: line 323: /root/.dashcore/dash-cli: No such file or directory
/root/dashman/lib/dashman_functions.sh: line 577: [: 0.12.2.1: unary operator expected
dash version  is not up to date. (0.12.2.1) Exiting.

Just posting this for reference, will look around on the server and see if I can figure out when went wrong.

Oh, I forgot to update dashman before performing the update.

All the best
Gustaf

Just checking: Am I the only with these issues? (since April '17)

dashman version 0.1.25 (35-g908572c) - 2017年  8月 11日 金曜日 12:18:43 CEST
gathering info, please wait... 
Could not find latest version from https://www.dash.org/downloads/ -- Exiting.
dashnode@zotac:/dashman$ ./dashman restart
dashman version 0.1.25 (35-g908572c) - 2017年  8月 11日 金曜日 12:19:06 CEST

restart dashd? [y/N] y
 --> Stopping dashd. Please wait...DONE!
 --> Deleting cache files, debug.log... DONE!
 --> Starting dashd... DONE!
 --> Waiting for dashd to respond...DONE!
 --> dash-cli getinfo
error: couldn't connect to server

Exiting.

crontab entry for sentinel

After the update I got SENTINEL_PING_EXPIRED

This is from the readme from the sentinel repo:

          • cd /home/YOURUSERNAME/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null 2>&1

Whereas in dashman

          • cd $INSTALL_DIR/sentinel && venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log

Note the missing ./ before venv

Not sure if that was the problem, but after editing my crontab and adding ./ it went back to ENABLED straight away.

"install sentinel" in README.md & help

My sentinel database broke and I have to reinstall it. I found out "reinstall" command do not reinstall sentinel. And there are no command to install sentinel in dashman.sh help or here in README.md. I eventually google it (install sentinel) but I'm not sure it's a proper way :)

installed with IPv6 option led to failed node

During install I picked the IPv6 option and ended up with a non-functional node:

michael@xyz:~/.dashcore$ ./dash-cli masternode status
{
  "vin": "CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase )",
  "service": "[xxxx:xxxx:xxxx:xxxx:xxxx:xx:xxxx:xxxx]:9999",
  "status": "Not capable masternode: Can't detect valid external address. Please consider using the externalip configuration option if problem persists. Make sure to use IPv4 address only."
}

Reinstalling now, hoping that I can switch it to IPv4.

Please change so that it doesn't provide that option if not supported.

line 349: [: too many arguments

It worked fine, but yesterday I see errors. Please advise me, what should do. Thank you
dashman version 0.1.25 (34-g9dd11ff) - Fri Aug 4 16:40:21 MSK 2017
gathering info, please wait... /home/compas/dashman/lib/dashman_functions.sh: line 349: [: too many arguments

Download percentage error - 107%

Well, this is not an stopping issue, but a bug when installing on Raspberry Pi 3, Raspbian April 2017 release. It shows more than 100% percentage of downloading, then aprox. 108% finished downloading and followed the process

captura de tela 2017-05-18 as 00 34 21

getinfo is deprecated

"deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in a future version. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo."

dashman update -y

I have a cron
0 1 * * * /home/user/dashman/dashman update -y >> /home/user/log.log 2>&1
But update didnt work in the cron. How to use autoupdate in the cron? Manually start dashman update -y works fine. Thank you
Log of the cron

^[[33m --> Checksumming dashcore-0.12.2.1-linux64.tar.gz... ^[[0mtput: No value for $TERM an$
^[[32mDONE!^[[0m
^[[33m --> Unpacking dashcore-0.12.2.1-linux64.tar.gz... ^[[0mtput: No value for $TERM and n$
^[[33m --> Stopping dashd. Please wait...^[[0mtput: No value for $TERM and no -T specified
^[[32mDONE!^[[0m
^[[33m --> Removing old version... ^[[0mtput: No value for $TERM and no -T specified
^[[32mDONE!^[[0m
mv: cannot stat 'dashcore-0.12.2/bin/dashd': No such file or directory
mv: cannot stat 'dashcore-0.12.2/bin/dash-cli': No such file or directory
mv: cannot stat 'dashcore-0.12.2/bin/dash-qt': No such file or directory
^[[33m --> Launching dashd... ^[[0mtput: No value for $TERM and no -T specified
^[[32mDONE!^[[0m
^[[33m --> Waiting for dashd to respond...^[[0mtput: No value for $TERM and no -T specified
^[[33m^[[32mDONE!^[[0m
^[[33m --> updating sentinel... ^[[0mtput: No value for $TERM and no -T specified
^[[32mDONE!^[[0m
^[[33m --> updating crontab... ^[[0mtput: No value for $TERM and no -T specified
^[[32mDONE!^[[0m
^[[31mdash version 0.12.2.0 is not up to date. (0.12.2.1) Exiting.^[[0m

-masternode option is deprecated

--> Launching dashd... Warning: -masternode option is deprecated and ignored, specifying -masternodeblsprivkey is enough to start this node as a masternode.

Script should not test for netcat6 in recent Ubuntu releases

Ubuntu 16.04 LTS (Xenial) has no netcat6 package any more, because nc now support IPV6.
Therfore, testing for package netcat6 is obsolete and stops the script.
./lib/dashman_functions.sh MISSING_DEPENDENCIES="$MISSING_DEPENDENCIES netcat6"

ARM support

I just came across this script it's great on Ubuntu Server 14.04/x64, so I thought I'd test on a Raspberry Pi with the same OS, but it fails with this:

install not supported yet on this platform

… which I assume is because of the architecture. What would be needed for it to work on ARM boards? Is it simply lack of prebuilt binaries?

install sentinal not recognizing python-virtualenv is installed

Hi guys,

During install I get to the step where I am installing sentinel and it asks to install python-virtualenv python-virtualenv (interesting side note about duplicate package name). I do so and then it still says I need to install. Fresh ubuntu 16.04 install. Please advise.

-Michael

michael@xyz:~/dashman$ sudo apt-get install  python-virtualenv python-virtualenv
[sudo] password for michael: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  python-pip-whl python-pkg-resources
Suggested packages:
  python-setuptools
Recommended packages:
  virtualenv
The following NEW packages will be installed:
  python-pip-whl python-pkg-resources python-virtualenv
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,265 kB of archives.
After this operation, 1,817 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-pip-whl all 8.1.1-2ubuntu0.4 [1,110 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 python-pkg-resources all 20.7.0-1 [108 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-virtualenv all 15.0.1+ds-3ubuntu1 [46.6 kB]
Fetched 1,265 kB in 1s (886 kB/s)       
Selecting previously unselected package python-pip-whl.
(Reading database ... 110279 files and directories currently installed.)
Preparing to unpack .../python-pip-whl_8.1.1-2ubuntu0.4_all.deb ...
Unpacking python-pip-whl (8.1.1-2ubuntu0.4) ...
Selecting previously unselected package python-pkg-resources.
Preparing to unpack .../python-pkg-resources_20.7.0-1_all.deb ...
Unpacking python-pkg-resources (20.7.0-1) ...
Selecting previously unselected package python-virtualenv.
Preparing to unpack .../python-virtualenv_15.0.1+ds-3ubuntu1_all.deb ...
Unpacking python-virtualenv (15.0.1+ds-3ubuntu1) ...
Setting up python-pip-whl (8.1.1-2ubuntu0.4) ...
Setting up python-pkg-resources (20.7.0-1) ...
Setting up python-virtualenv (15.0.1+ds-3ubuntu1) ...

michael@xyz:~/dashman$ ./dashman install sentinel
missing dependency:  python-virtualenv python-virtualenv
 --> sudo apt-get install  python-virtualenv python-virtualenv

michael@xyz:~/dashman$ sudo apt-get install  python-virtualenv python-virtualenv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-virtualenv is already the newest version (15.0.1+ds-3ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

michael@xyz:~/dashman$ ./dashman install sentinel
missing dependency:  python-virtualenv python-virtualenv
 --> sudo apt-get install  python-virtualenv python-virtualenv

cannot find dash-cli in current directory, ~/.dashcore, or $PATH

Hello.
dashman version 0.1.25 (30-g5d6a5f5) - Tue Apr 18 11:04:23 MSK 2017
gathering info, please wait... cannot find dash-cli in current directory, ~/.dashcore, or $PATH. -- Exiting.

dashman Worked fine by this day. But I see directory .dashcore, what happened

sync problem

hello. i have last version of dashman. and i have problem with sync of blocks.
dashman status is:

  dashd up-to-date           : NO
  dashd running              : YES
  dashd uptime               : 0 days, 18 hours, 17 mins, 46 secs
  dashd responding (rpc)     : YES
  dashd listening  (ip)      : YES
  dashd connecting (peers)   : YES
  dashd port open            : YES
  dashd connection count     : 20
  dashd blocks synced        : NO
  last block (local dashd)   : 1029608
             (chainz)        : 1031453
             (dash.org)      : 1031454
             (dashwhale)     : 1031454
             (masternode.me) : 1031454 - no forks detected
  dashd current difficulty   : 5682.139232132935
  masternode count           : 191

I restarted dashman service yesterday, but sync speed is slow. Yesterday last block was 1029300 and today is 1029608. Dashman doesnt use cpu. dashman work wih ipv4 only. What should i do to reach full sync?

Some strange messages.

MN is running fine and receives payments. However:

`dashman version 0.1.25 (32-g6aabce1) - 2017 / 5 / 5 12:29:47 CEST
gathering info, please wait... No JSON object could be decoded
DONE!

hostname : xxx
host uptime/load average : 62 days, 2.77 2.62 2.62
dashd bind ip address : xxx.xxx.xxx.xxx
dashd version : 0.12.1.4
dashd up-to-date : NO
dashd running : YES
dashd uptime : 42 days, 17 hours, 14 mins, 16 secs
dashd responding (rpc) : YES
dashd listening (ip) : YES
dashd connecting (peers) : YES
dashd port open : YES
dashd connection count : 22
dashd blocks synced : YES
last block (local dashd) : 664632
(chainz) : 0
(dash.org) : 0
(dashwhale) : 664631
(masternode.me) : 664632 - no forks detected
dashd current difficulty : 167291.3584837048
masternode started : YES
masternode visible (local) : YES
masternode visible (ninja) : NO
masternode address :
masternode funding txn : -
masternode queue/count : 448/4441
masternode mnsync state : MASTERNODE_SYNC_FINISHED
masternode network state : ENABLED
masternode last payment : never
masternode balance : 0
sentinel installed : YES
sentinel tests passed : /home/xxx/dashman/lib/dashman_functions.sh: line 1123: [: too many arguments
NO
sentinel crontab enabled : YES
sentinel online : YES
Exiting.
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.