wackou / bts_tools Goto Github PK
View Code? Open in Web Editor NEWBitShares delegate tools
License: GNU General Public License v3.0
BitShares delegate tools
License: GNU General Public License v3.0
make sure also to not allow to unlock wallet until it is synchronized as it might cause issues:
https://bitsharestalk.org/index.php?topic=5523.msg74391#msg74391
For instance, during an upgrade it can't sync anymore and falls out-of-sync.
This is a critical situation, as it won't detect either that it is not producing blocks anymore...
I think if there was a chat line included (at the bottom for example) it would motivate most seed owners to give there updates about their seednodes (replying now, version info etc.) and it would significantly inform betters all of us about the seednode state.
this would allow stupid (and weird looking) crashes when the hdd is full...
Hey @wackou,
Could you please create a new bts_tools release? The current release doesn't have some of the latest improvements (including Hertz changes).
Alternatively, instructions could include installing a downloaded clone of the repo to get the latest dev changes?
Thanks,
CM.
edit: after #50 though, lol.
Despite 0.6.0b1 being a tracked release in the python packages, the default version recommended for installation is 0.5.3.
Is there a configuration required for the python repositories to push the latest version by default, or should users just use pip3 install bts_tools==0.6.0b1
to get around this glitch/issue?
Just to confirm (by request) that 0.6.0b1 is suitable for production use?
Edit: Double check - there's mandatory config changes required in the config.yaml file, right?
Cheers ๐
This is useful as it is quite easy to forget to call wallet_publish_version
just after upgrading to a new version... :)
also add safeguard to make sure that we only publish version once, even if the version detection has a bug
Traceback (most recent call last):
File "/usr/local/bin/bts", line 9, in <module>
load_entry_point('bts-tools==0.1-dev', 'console_scripts', 'bts')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python2.7/dist-packages/bts_tools-0.1_dev-py2.7.egg/bts_tools/__init__.py", line 29, in <module>
from .rpcutils import main_node as rpc
File "/usr/local/lib/python2.7/dist-packages/bts_tools-0.1_dev-py2.7.egg/bts_tools/rpcutils.py", line 183
def call(*args, cached=True):
this allows to restore a from a previous point (before a minority fork, for instance) without having to resync the entire history...
I created a similar issue on xeroc's repo.
There's a difference in price BTS:USD reference between the two Bitshares price feed libraries. @xeroc's scripts reference bitUSD meanwhile bts_tools references BTS:BTC:USD price feeds. This is the potential source of price feed differences for Hertz: https://btsapi.grcnode.co.uk/home
What's the appropriate USD reference for Hero and Hertz? bitUSD:BTS and/or BTS:BTC:USD?
Cheers
Currently it appears that your Bitshares account has to be a witness in order to use bts_tools to publish price feeds, however it's possible for non-witness/committee accounts to publish price feeds in a private matter.
Would it be possible to publish price feeds as a non-witness using bts_tools, or do you think this would require a large amount of changes for little benefit?
Detection of the version of a binary can be enhanced by not getting the info from the filename (or not bailing out if not present), but rather by running bts_client --version
and ideally reduce it to a miminum.
Will probably need an overhaul of the caching system (using sth like https://bitbucket.org/zzzeek/dogpile.cache)
in views.py:
@bp.route('/slate')
def slate():
# show current slate in running order with live update of highlighted line
# corresponding to the next producing delegate
# add a column with time of block production
pass
HERTZ is an upcoming algorithm based asset (smartcoin/mpa) which is pegged against a to be agreed-upon backing asset and modified to oscillate between rising the price feed and decreasing it in a predictable manner, thus we create phases of buying and selling pressure constantly back and forth forever.
I'd appreciate support in your price feeds, so that more witnesses will be able to provide feeds.
Relevant links:
Bitsharestalk
Steemit
Xeroc's price feed script - hertz issue
Haskell HERTZ price feed script - Github
Openledger link
Cryptofresh
The python price feed script uses time/dates instead of block numbers, so perhaps there will be a difference in computed values between haskell and python? Would the time calculation just be more granular/accurate?
python pseudocode implementation? (I don't know python)
import math
import date
reference_asset_price = feeds['CNY'] // Reference asset still TBA
Time_In_Period = one month duration
amplitude = 0.5
x_value = remainder of (((date.today() - date(Asset_Genesis_Date_Timestamp))/Time_In_Period)/1.00)) // to return 0.xx
feeds['HERTZ'] = reference_asset_price + (((reference_asset_price * amplitude)*(sin((x_value * Time_In_Period)) * ((2*math.pi)/Time_In_Period) ))))
this will allow us to know if we end up on a minority fork
there are some spurious warnings, eg: sometimes it seems that we cannot connect once and get a "just connected" notification without getting the "disconnected" one before.
if node goes online and misses some blocks, then comes back up online, then it doesn't send a notification because of missed blocks
https://github.com/wackou/bts_tools/blob/master/bts_tools/templates/config/monitoring.yaml#L41
Listed as 200%
Yet in the following scripts by it's set to 175% :
https://github.com/hero-global/scripts/blob/master/hero-feed.py#L33
https://github.com/xeroc/bitshares-pricefeed/blob/master/bitshares_pricefeed/examples/hero.yaml#L47
The official HERO page on collateral lists:
The maintenance collateral ratio for HERO is:
175% (2017-05-01)
in views.py:
@bp.route('/commands')
def commands():
# start, stop, build
pass
when client crashes and waits in gdb, some call from the monitoring thread might block on a rpc socket call -> need to add a timeout to local rpc calls too:
(crash happened ~ 12:52)
2014-10-02 13:08:25,101 WARNING [bitshares_delegate_tools.rpcutils:get_streak:195] -- get_streak() failed with: <class 'ValueError'>(Unterminated string starting at: line 1 column 656634 (char 656633))
2014-10-02 13:08:25,102 ERROR [bitshares_delegate_tools.rpcutils:get_streak:196] -- Unterminated string starting at: line 1 column 656634 (char 656633)
Traceback (most recent call last):
File "/home/admin/.virtualenvs/bitshares_delegate_tools/lib/python3.3/site-packages/bitshares_delegate_tools/rpcutils.py", line 187, in get_streak
cached=cached)[::-1]
File "/home/admin/.virtualenvs/bitshares_delegate_tools/lib/python3.3/site-packages/bitshares_delegate_tools/rpcutils.py", line 130, in call
return self.rpc_call(funcname, *args, cached=cached)
File "/home/admin/.virtualenvs/bitshares_delegate_tools/lib/python3.3/site-packages/bitshares_delegate_tools/rpcutils.py", line 147, in rpc_call
result = self._rpc_call(funcname, *args)
File "/home/admin/.virtualenvs/bitshares_delegate_tools/lib/python3.3/site-packages/bitshares_delegate_tools/rpcutils.py", line 94, in local_call
funcname, *args)
File "/home/admin/.virtualenvs/bitshares_delegate_tools/lib/python3.3/site-packages/bitshares_delegate_tools/rpcutils.py", line 70, in rpc_call
r = response.json()
File "/home/admin/.virtualenvs/bitshares_delegate_tools/lib/python3.3/site-packages/requests/models.py", line 756, in json
return json.loads(self.content.decode(encoding), **kwargs)
File "/usr/lib/python3.3/json/__init__.py", line 316, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.3/json/decoder.py", line 351, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.3/json/decoder.py", line 367, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Unterminated string starting at: line 1 column 656634 (char 656633)
2014-10-02 13:08:25,193 ERROR [bitshares_delegate_tools.monitor:monitoring_thread:173] -- An exception occurred in the monitoring thread:
2014-10-02 13:08:25,193 ERROR [bitshares_delegate_tools.monitor:monitoring_thread:174] -- 'NoneType' object has no attribute 'cpu_percent'
Traceback (most recent call last):
File "/home/admin/.virtualenvs/bitshares_delegate_tools/lib/python3.3/site-packages/bitshares_delegate_tools/monitor.py", line 155, in monitoring_thread
s = StatsFrame(cpu=p.cpu_percent(),
AttributeError: 'NoneType' object has no attribute 'cpu_percent'
2014-10-02 13:08:40,259 WARNING [bitshares_delegate_tools.monitor:monitoring_thread:95] -- Delegate just went offline...
2014-10-02 13:08:41,632 INFO [bitshares_delegate_tools.notification:send_notification_email:60] -- Done sending email notification: Delegate just went offline...
2014-10-02 13:08:51,100 INFO [bitshares_delegate_tools.notification:send_notification_apns:114] -- Done sending APNS notification: Delegate just went offline...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.