src@d:~/.dashcore$ ./dash-cli getinfo | grep version
"version": 120200,
"protocolversion": 70208,
"walletversion": 61000,
src@d:~/.dashcore$ git clone -b core-v0.12.2.x https://github.com/dashpay/sentinel.git
Cloning into 'sentinel'...
remote: Counting objects: 3321, done.
remote: Compressing objects: 100% (13/13), done.
Receiving objects: 100% (3321/3321), 1.18 MiB | 345.00 KiB/s, done.
remote: Total 3321 (delta 9), reused 7 (delta 3), pack-reused 3305
Resolving deltas: 100% (2203/2203), done.
src@d:~/.dashcore$ cd sentinel
src@d:~/.dashcore/sentinel$ virtualenv ./venv
Using base prefix '/usr'
New python executable in /home/src/.dashcore/sentinel/venv/bin/python3
Also creating executable in /home/src/.dashcore/sentinel/venv/bin/python
Installing setuptools, pip, wheel...done.
src@d:~/.dashcore/sentinel$ cat requirements.txt
inflection==0.3.1
peewee==2.8.3
py==1.4.31
pycodestyle==2.2.0
pytest==3.0.1
python-bitcoinrpc==1.0
simplejson==3.8.2
src@d:~/.dashcore/sentinel$ ./venv/bin/pip install -r requirements.txt
Collecting inflection==0.3.1 (from -r requirements.txt (line 1))
Collecting peewee==2.8.3 (from -r requirements.txt (line 2))
Collecting py==1.4.31 (from -r requirements.txt (line 3))
Using cached py-1.4.31-py2.py3-none-any.whl
Collecting pycodestyle==2.2.0 (from -r requirements.txt (line 4))
Using cached pycodestyle-2.2.0-py2.py3-none-any.whl
Collecting pytest==3.0.1 (from -r requirements.txt (line 5))
Using cached pytest-3.0.1-py2.py3-none-any.whl
Collecting python-bitcoinrpc==1.0 (from -r requirements.txt (line 6))
Collecting simplejson==3.8.2 (from -r requirements.txt (line 7))
Installing collected packages: inflection, peewee, py, pycodestyle, pytest, python-bitcoinrpc, simplejson
Successfully installed inflection-0.3.1 peewee-2.8.3 py-1.4.31 pycodestyle-2.2.0 pytest-3.0.1 python-bitcoinrpc-1.0 simplejson-3.8.2
src@d:~/.dashcore/sentinel$ crontab -l
# Edit this file to introduce tasks to be run by cron.
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# For more information see the manual pages of crontab(5) and cron(8)
# m h dom mon dow command
* * * * * cd /home/src/.dashcore/sentinel && ./venv/bin/python bin/sentinel.py >/dev/null 2>&1
src@d:~/.dashcore/sentinel$ cat sentinel.conf
# specify path to dash.conf or leave blank
# default is the same as DashCore
dash_conf=/home/src/.dashcore/dash.conf
# valid options are mainnet, testnet (default=mainnet)
# network=mainnet
network=testnet
rpcuser=demo
rpcpassword=aaaa
rpcallowip=127.0.0.1
rpcport=9998
# database connection details
db_name=database/sentinel.db
db_driver=sqlite
src@d:~/.dashcore/sentinel$ ./venv/bin/py.test ./test
==================================================================== test session starts ====================================================================
platform linux -- Python 3.5.3, pytest-3.0.1, py-1.4.31, pluggy-0.3.1
rootdir: /home/src/.dashcore/sentinel, inifile:
collected 22 items
test/integration/test_jsonrpc.py F
test/unit/test_dash_config.py .
test/unit/test_dashd_data_shims.py ..
test/unit/test_dashy_things.py ......
test/unit/test_models.py ..
test/unit/test_submit_command.py .
test/unit/models/test_proposals.py ....
test/unit/models/test_superblocks.py .....
========================================================================= FAILURES ==========================================================================
________________________________________________________________________ test_dashd _________________________________________________________________________
def test_dashd():
config_text = DashConfig.slurp_config_file(config.dash_conf)
network = 'mainnet'
is_testnet = False
genesis_hash = u'00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6'
for line in config_text.split("\n"):
if line.startswith('testnet=1'):
network = 'testnet'
is_testnet = True
genesis_hash = u'00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c'
creds = DashConfig.get_rpc_creds(config_text, network)
dashd = DashDaemon(**creds)
assert dashd.rpc_command is not None
assert hasattr(dashd, 'rpc_connection')
# Dash testnet block 0 hash == 00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c
# test commands without arguments
> info = dashd.rpc_command('getinfo')
test/integration/test_jsonrpc.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lib/dashd.py:42: in rpc_command
return self.rpc_connection.__getattr__(params[0])(*params[1:])
venv/lib/python3.5/site-packages/bitcoinrpc/authproxy.py:139: in __call__
response = self._get_response()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <bitcoinrpc.authproxy.AuthServiceProxy object at 0xb67011ec>
def _get_response(self):
http_response = self.__conn.getresponse()
if http_response is None:
raise JSONRPCException({
'code': -342, 'message': 'missing HTTP response from server'})
content_type = http_response.getheader('Content-Type')
if content_type != 'application/json':
raise JSONRPCException({
> 'code': -342, 'message': 'non-JSON HTTP response with \'%i %s\' from server' % (http_response.status, http_response.reason)})
E bitcoinrpc.authproxy.JSONRPCException: -342: non-JSON HTTP response with '401 Unauthorized' from server
venv/lib/python3.5/site-packages/bitcoinrpc/authproxy.py:187: JSONRPCException
============================================================ 1 failed, 21 passed in 4.74 seconds ============================================================
src@d:~/.dashcore$ ./dash-cli getinfo
{
"version": 120200,
"protocolversion": 70208,
"walletversion": 61000,
"balance": 6269.74098202,
"privatesend_balance": 0.00000000,
"blocks": 17922,
"timeoffset": 0,
"connections": 10,
"proxy": "",
"difficulty": 1.332960439336927,
"testnet": true,
"keypoololdest": 1509273923,
"keypoolsize": 999,
"paytxfee": 0.00000000,
"relayfee": 0.00001000,
"errors": ""
}