BitShares Forum

Main => General Discussion => Topic started by: alt on May 05, 2015, 03:24:45 pm

Title: BTS api for python
Post by: alt on May 05, 2015, 03:24:45 pm
I have rewrite some python API for wallet
here is the code
https://github.com/pch957/python-bts

1. rewrite api for wallet
2. rewrite api for exchange
3. bts_delegate_task.py, publish feed, and withdraw pay automatic
4. bts_delegate_watch.py, watch missed block, and send mail attention

this is still a test version, be careful
Title: Re: BTS api for python
Post by: toast on May 05, 2015, 07:36:57 pm
 +5% This should be the one we merge all the different python BTS tools into
Title: Re: BTS api for python
Post by: alt on May 06, 2015, 07:52:36 am
update:
add bts_delegate_watch.py
a tool to watch missed block, and notification with emai
Code: [Select]
...... 2475721 stan.delegate.xeldal
...... 2475722 elmato
missed 2475723 delegate1.john-galt
no contact
...... 2475723 developer.vikram
...... 2475724 mrs.agsexplorer
missed 2475725 kokojie
no contact
...... 2475725 delegate-dev4.btsnow
...... 2475726 dev.sidhujag

...... 2475732 dev.nathanhourt.com
...... 2475733 delegate-dev2.btsnow
missed 2475734 dacx.baozou
no contact
...... 2475734 delegate1.maqifrnswa

...... 2475821 delegate.liondani
missed 2475822 delegate1.john-galt
no contact
...... 2475822 usd.bts500

...... 2475862 spartako1
missed 2475863 init55
no contact
...... 2475863 www.bts-hk

...... 2475889 delegate.btsnow
missed 2475890 kokojie
no contact
...... 2475890 bm.payroll.riverhead

...... 2475916 testz
missed 2475917 delegate1.john-galt
no contact
...... 2475917 delegate.webber

...... 2475973 delegate-alt
missed 2475974 init55
no contact
...... 2475974 kokojie

...... 2476051 delegate.xeldal
missed 2476052 delegate1.john-galt
no contact
...... 2476052 spartako1

..................
...... 2476076 delegated-proof-of-steak
...... 2476077 dev0.theoretical
...... 2476078 ak
missed 2476079 init55
no contact
...... 2476079 delegate.bitsuperlab
...... 2476080 delegate2.xeldal
...... 2476081 delegate.rgcrypto
...... 2476082 elmato
Title: Re: BTS api for python
Post by: alt on May 07, 2015, 02:29:54 pm
update
add tools bts_get_market_trx.py
Code: [Select]
alt@alt-ThinkPad-T430s ~/ $ bts_get_market_trx.py

2015-05-07T11:39:30 2475089 849f13fc short 100000.0 BTS at price 0.019 CNY/BTS
2015-05-07T11:40:40 2475096 73d6aa98 cancel short 100000.0 BTS at price unlimited CNY/BTS
2015-05-07T12:00:20 2475212 b1bbb624 short 30751.16995 BTS at price 0.003053 USD/BTS
2015-05-07T12:01:20 2475218 af01335a bid 60402.5074105 BTS at price 0.02058 CNY/BTS
2015-05-07T12:01:30 2475219 buy 60402.50741 BTS at price 0.02058 CNY/BTS
2015-05-07T12:13:00 2475286 a1aa763f bid 195165.651184 BTS at price 0.02065 CNY/BTS
2015-05-07T12:13:10 2475287 buy 48593.22867 BTS at price 0.02065 CNY/BTS
2015-05-07T12:13:10 2475287 buy 18155.44511 BTS at price 0.02065 CNY/BTS
2015-05-07T12:13:10 2475287 buy 9738.1485 BTS at price 0.02065 CNY/BTS
2015-05-07T12:13:10 2475287 buy 45791.45008 BTS at price 0.02065 CNY/BTS
2015-05-07T12:13:10 2475287 buy 10654.8338 BTS at price 0.02065 CNY/BTS
2015-05-07T12:14:30 2475295 f4f23512 cancel bid 62232.5616312 BTS at price 0.02065 CNY/BTS
2015-05-07T12:21:40 2475338 d51ff7ab cancel bid 494963.569938 BTS at price 0.0202 CNY/BTS.
2015-05-07T12:24:00 2475351 4de9be3a cancel ask 59.6118 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T12:26:30 2475366 ee45f4ca cancel ask 59.608 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T12:29:50 2475386 1e512112 cancel ask 59.6087 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T12:31:40 2475397 5f26ded3 cancel ask 59.6091 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T12:36:30 2475425 deebd357 short 19961.49778 BTS at price 0.01984 CNY/BTS
2015-05-07T12:47:40 2475490 0a8ccf9f cancel ask 59.6089 CNY at price 1.301 BDR.AAPL/CNY.......................................
2015-05-07T12:48:30 2475495 8f12c7ff ask 50.0 BTS at price 0.02026 CNY/BTS
2015-05-07T12:48:40 2475496 sell 50.0 BTS at price 0.02026 CNY/BTS
2015-05-07T12:49:30 2475501 e07a6c38 cancel ask 59.6094 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T12:53:20 2475523 f7865b3c cancel ask 59.6096 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T12:56:40 2475543 54fa6826 cancel ask 59.6091 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T12:59:00 2475556 5d768f88 cancel ask 59.6093 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T13:03:10 2475580 a13f045c cancel ask 59.6096 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T13:04:30 2475588 69d4157d cancel ask 59.6084 CNY at price 1.301 BDR.AAPL/CNY.......................................
2015-05-07T13:07:50 2475608 89be7be5 cancel ask 59.6084 CNY at price 1.301 BDR.AAPL/CNY.......................................
2015-05-07T13:10:20 2475622 0c03a779 cancel bid 493569.770811 BTS at price 0.02026 CNY/BTS.
2015-05-07T13:12:10 2475633 22f93e84 cancel ask 59.609 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T13:27:20 2475721 582fd95f cancel ask 64900.00001 BTS at price 4.237 NOTE/BTS
2015-05-07T13:28:30 2475726 c5732e98 ask 64260.0 BTS at price 4.202 NOTE/BTS
2015-05-07T13:28:50 2475728 ecbcf083 cancel ask 19540.77022 BTS at price 4.235 NOTE/BTS
2015-05-07T13:29:30 2475732 0c898f87 cancel ask 59.6024 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T13:30:00 2475734 670b1ed1 ask 20238.5 BTS at price 4.2 NOTE/BTS
2015-05-07T13:49:50 2475851 fbd8d6fc cancel ask 59.6007 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T13:57:00 2475892 957391e0 cancel ask 59.6015 CNY at price 1.311 BDR.AAPL/CNY.......................................
2015-05-07T14:07:20 2475953 da5ffb22 cancel ask 59.601 CNY at price 1.302 BDR.AAPL/CNY.......................................
2015-05-07T14:09:50 2475968 0a3f4d28 cancel bid 494548.480618 BTS at price 0.02022 CNY/BTS.
2015-05-07T14:12:40 2475984 d69e3d30 bid 100919.999977 BTS at price 4.31 NOTE/BTS
2015-05-07T14:12:50 2475985 buy 20238.5 BTS at price 4.31 NOTE/BTS
2015-05-07T14:12:50 2475985 buy 64260.0 BTS at price 4.31 NOTE/BTS
2015-05-07T14:12:50 2475985 buy 4503.0 BTS at price 4.31 NOTE/BTS
2015-05-07T14:12:50 2475985 buy 990.0 BTS at price 4.31 NOTE/BTS
2015-05-07T14:12:50 2475985 buy 10928.50003 BTS at price 4.31 NOTE/BTS
2015-05-07T14:15:10 2475999 b33e183f bid 46199.8126821 BTS at price 4.329 NOTE/BTS
2015-05-07T14:15:20 2476000 buy 9075.81037 BTS at price 4.329 NOTE/BTS
2015-05-07T14:15:20 2476000 buy 140.0 BTS at price 4.329 NOTE/BTS
2015-05-07T14:15:20 2476000 buy 10000.0 BTS at price 4.329 NOTE/BTS
2015-05-07T14:15:20 2476000 buy 990.0 BTS at price 4.329 NOTE/BTS
2015-05-07T14:15:20 2476000 buy 2000.0 BTS at price 4.329 NOTE/BTS
2015-05-07T14:15:20 2476000 buy 2000.0 BTS at price 4.329 NOTE/BTS
2015-05-07T14:15:20 2476000 buy 21994.00239 BTS at price 4.329 NOTE/BTS
2015-05-07T14:16:20 2476006 14c91376 bid 1432.90550685 BTS at price 0.02065 CNY/BTS
2015-05-07T14:18:00 2476016 79633186 cancel ask 59.6011 CNY at price 1.298 BDR.AAPL/CNY.......................................
2015-05-07T14:18:10 2476017 11e04d35 bid 999.99999 BTS at price 4.151 NOTE/BTS
2015-05-07T14:18:20 2476018 ba1f39db bid 3341.88986293 BTS at price 0.02065 CNY/BTS
2015-05-07T14:18:20 2476018 d872d674 bid 999.99999174 BTS at price 4.235 NOTE/BTS
2015-05-07T14:19:50 2476027 30b818b0 cancel ask 59.6014 CNY at price 1.307 BDR.AAPL/CNY.......................................
2015-05-07T14:22:50 2476045 c5df1fbf cancel ask 59.6014 CNY at price 1.305 BDR.AAPL/CNY.......................................
2015-05-07T14:27:10 2476070 8b7dd98d cancel ask 59.5945 CNY at price 1.301 BDR.AAPL/CNY.......................................
2015-05-07T14:28:50 2476079 690dd3ec cancel bid 155871.794872 BTS at price 0.0195 CNY/BTS
2015-05-07T14:29:20 2476082 c7faaaa6 ask 4774.79537 BTS at price 0.02065 CNY/BTS
2015-05-07T14:29:30 2476083 buy 4774.79536 BTS at price 0.02065 CNY/BTS
Title: Re: BTS api for python
Post by: alt on May 07, 2015, 02:36:17 pm
this is output for price feed
Code: [Select]
================ 20150507T143416 ===================
   ASSET  RATE(CNY)    CURRENT_FEED   LAST_PUBLISH
-----------------------------------------------------
     AUD      4.915        0.004099        0.004133
     BTC   1437.590       1.413e-05       1.419e-05
     CAD      5.109        0.003945        0.003978
     CHF      6.766         0.00299        0.003015
     CNY      1.000         0.02023          0.0204
     EUR      6.990        0.002889        0.002914
     GBP      9.427        0.002143        0.002161
    GOLD   7343.968       2.749e-06       2.769e-06
     HKD      0.800         0.02527         0.02549
     JPY      0.052          0.3892          0.3923
     KRW      0.006           3.549           3.579
     MXN      0.404          0.0501         0.05043
     NZD      4.623        0.004366        0.004401
     RUB      0.123          0.1647          0.1659
     SEK      0.750         0.02685         0.02708
     SGD      4.658        0.004339        0.004375
  SILVER    102.254       0.0001977       0.0001994
     TRY      2.311        0.008766        0.008828
     USD      6.203        0.003259        0.003287
====================================================
Title: Re: BTS api for python
Post by: alt on June 04, 2015, 12:36:57 pm
update to version 0.5.12
Code: [Select]
sudo pip install bts --upgrade

support SHENZHEN NASDAQC feed price.. now
SHANGHAI is not available from yahoo, maybe a bug from yahoo finance

Code: [Select]
================ 20150604T123343 ===================
   ASSET  RATE(CNY)    CURRENT_FEED   LAST_PUBLISH
-----------------------------------------------------
     AUD      4.797        0.008262        0.008372
     BTC   1396.318       2.845e-05       2.875e-05
     CAD      4.979        0.007965        0.008066
     CHF      6.651        0.005963        0.006038
     CNY      1.000         0.03968         0.04014
     EUR      7.022        0.005651        0.005721
     GBP      9.543        0.004158        0.004208
    GOLD   7311.348        5.41e-06       5.488e-06
HANGSENG  22038.757            None       1.822e-06
     HKD      0.800         0.04961         0.05019
     JPY      0.050          0.7937          0.8044
     KRW      0.006           7.086           7.168
     MXN      0.399         0.09938          0.1006
 NASDAQC  31620.325            None       1.269e-06
  NIKKEI   1022.361            None       3.926e-05
     NZD      4.430        0.008951        0.009065
     RUB      0.113           0.352          0.3549
     SEK      0.752         0.05281         0.05345
     SGD      4.609        0.008609        0.008712
SHENZHEN   3023.697            None       1.327e-05
  SILVER    102.094       0.0003887       0.0003932
     TRY      2.311         0.01718         0.01737
     USD      6.201        0.006399        0.006473
====================================================
Title: Re: BTS api for python
Post by: puppies on June 04, 2015, 07:14:26 pm
Hey alt, is there a way to test the email feature without missing a block?
Title: Re: BTS api for python
Post by: liondani on June 04, 2015, 10:01:15 pm
Warning: unknown error, can't fetch price
'NIKKEI'

I use the command like this:
./bts_feed_auto.py USD CNY GOLD AUD BTC CAD CHF EUR GBP HKD JPY KRW MXN NZD RUB SEK SGD SILVER TRY NIKKEI



the same when I try the others  :(

Can you suggest what I make wrong?
Title: Re: BTS api for python
Post by: alt on June 04, 2015, 10:42:44 pm
do you mean test your SMTP server? you can use command mail like this
Code: [Select]
alt@li430-37:~$ mail -s "hello" test@gmail.com
here is email body
type Ctrl-D to send
EOT

Hey alt, is there a way to test the email feature without missing a block?
Title: Re: BTS api for python
Post by: puppies on June 04, 2015, 10:52:38 pm
do you mean test your SMTP server? you can use command mail like this
Code: [Select]
alt@li430-37:~$ mail -s "hello" test@gmail.com
here is email body
type Ctrl-D to send
EOT

Hey alt, is there a way to test the email feature without missing a block?

No.  Sorry, I should have been clearer.

SMTP is setup and I can email from the command line.  I was just hoping that there was a way to test the scripts call to SMTP.  I want to make sure that I have configured the .jsons correctly. 

For example, it seemed to me that an auto payout should generate an email, but upon auto payout, I do not receive an email. 

I was hoping there was something along the lines of a  bts_delegate_watch.py --test
Title: Re: BTS api for python
Post by: alt on June 04, 2015, 10:53:17 pm
I am sorry, the old source is not maintain now
1) install
you can download new source code from
 https://github.com/pch957/python-bts
install with this command
Code: [Select]
python setup.py build
sudo python setup.py install

or run with command
Code: [Select]
pip install bts

2) configure
copy sample config directory to $HOME/.python-bts
edit $HOME/.python-bts/bts_client.json to setup the RPC info

edit $HOME/.python-bts/delegate_task.json to setup price feed info,
config["delegate_task"]["delegate_list"]

3) run
Code: [Select]
bts_delegate_task.py
[/code[


[quote author=liondani link=topic=16170.msg213674#msg213674 date=1433455275]
[color=teal]Warning: unknown error, can't fetch price
'NIKKEI'[/color]

I use the command like this:
./bts_feed_auto.py USD CNY GOLD AUD BTC CAD CHF EUR GBP HKD JPY KRW MXN NZD RUB SEK SGD SILVER TRY NIKKEI



the same when I try the others  :(

Can you suggest what I make wrong?
[/quote]
Title: Re: BTS api for python
Post by: alt on June 04, 2015, 11:04:52 pm
there is not this command.....

to enable email notify, need
Code: [Select]
config["notify"]["enable"] = 1

to enable withdraw pay, need
set run_timer to a non zero value
Code: [Select]
config["delegate_task"]["withdraw_pay"]["run_timer"] = 6
make sure you have config the mail list for the bts account to receive the payment
Code: [Select]
config["delegate_task"]["withdraw_pay"]["mail_list"]

to test email , you can modify the script.
Code: [Select]
293     -  delegate_task.excute()                                                                                                                                         
294     + delegate_task.pay_notify("anything", "your bts id to receive payment", 100, 1.0)


do you mean test your SMTP server? you can use command mail like this
Code: [Select]
alt@li430-37:~$ mail -s "hello" test@gmail.com
here is email body
type Ctrl-D to send
EOT

Hey alt, is there a way to test the email feature without missing a block?

No.  Sorry, I should have been clearer.

SMTP is setup and I can email from the command line.  I was just hoping that there was a way to test the scripts call to SMTP.  I want to make sure that I have configured the .jsons correctly. 

For example, it seemed to me that an auto payout should generate an email, but upon auto payout, I do not receive an email. 

I was hoping there was something along the lines of a  bts_delegate_watch.py --test
Title: Re: BTS api for python
Post by: clayop on June 04, 2015, 11:06:00 pm
Thanks alt but I failed to install the tool. Can you explain how to install from the scratch? (e.g. required packages, line-by-line commands)
Title: Re: BTS api for python
Post by: puppies on June 04, 2015, 11:08:13 pm


to test email , you can modify the script.
Code: [Select]
293     -  delegate_task.excute()                                                                                                                                         
294     + delegate_task.pay_notify("anything", "your bts id to receive payment", 100, 1.0)




Thanks alt.  You rock.
Title: Re: BTS api for python
Post by: alt on June 04, 2015, 11:18:56 pm
Thanks alt but I failed to install the tool. Can you explain how to install from the scratch? (e.g. required packages, line-by-line commands)
my English is not good, so the document is not clear...
step by step:
1. git clone source code to directory python-bts
2. change dir to python-bts, and run command
Code: [Select]
python setup.py build
sudo python setup.py install
3. configure
configure directory is $HOME/.python-bts, for the first time, you can copy sample config file from sourcecode_direcotry/config
Code: [Select]
mkdir ~/.python-bts
cp config/* ~/.python-bts

1) setup rpc info at config file bts_client.json
2) setup price feed info at delegate_task.jon:
this you must configure
Code: [Select]
config["delegate_task"]["delegate_list"]
these you can adjust for price rule, there is a common for each parameter
Code: [Select]
19             "price_limit": {
 20                 "common": "only update price feed when the change rate is between 0.5% ~ 50%",
 21                 "change_ignore": 0.2,
 22                 "change_min": 0.5,
 23                 "change_max": 50,
 24                 "common": "spread bid price to price*(1+spread), ask price to price*(1-spread)",
 25                 "common": "excute the order book, get the real price",
 26                 "spread": 0.01,
 27                 "common": "we use the median price, how many samples need to use",
 28                 "median_length": 9
 29             },
 30             "market_weight": {
 31                 "common": "weight depenth on (depth * scale)",
 32                 "wallet_usd": 0.001,
 33                 "wallet_cny": 1,
 34                 "yunbi_cny": 1,
 35                 "btc38_cny": 1,
 36                 "btc38_btc": 1,
 37                 "bter_cny": 1
 38             }
Title: Re: BTS api for python
Post by: clayop on June 05, 2015, 12:24:58 am
Code: [Select]
git clone https://github.com/pch957/python-bts
cd python-bts
python setup.py build

Got an error

Code: [Select]
Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Title: Re: BTS api for python
Post by: alt on June 05, 2015, 12:37:39 am
ah, you need to install python-setuptools,
Code: [Select]
sudo apt-get install python-setuptools
in fact you can run directly  without install
Code: [Select]

python scripts/bts_delegate_task.py

Code: [Select]
git clone https://github.com/pch957/python-bts
cd python-bts
python setup.py build

Got an error

Code: [Select]
Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Title: Re: BTS api for python
Post by: clayop on June 05, 2015, 01:01:05 am
I made it! Thanks :)
Title: Re: BTS api for python
Post by: puppies on June 05, 2015, 02:45:56 am
Thanks alt.  I figured it out with your help.  I had
Code: [Select]
            "mail_list": {
                "dele-puppy": ["thisismyemail@puppies.com"]
but since I am withdrawing to account puppies I had to change it to
Code: [Select]
            "mail_list": {
                "dele-puppy": ["thisismyemail@puppies.com"],
                "puppies": ["thisismyemail@puppies.com"]
Title: Re: BTS api for python
Post by: xeroc on June 05, 2015, 07:59:15 am
btw ... wouldn't it make sense for the delegates to publish their mail address ON-CHAIN?
http://wiki.bitshares.org/index.php/Delegate/PublicData

see it like an "abuse" mail in IP networks and domains .. or like a tech mail ...
That would

a) greatly improve hardfork coordination
b) make implementing a watching thread a no-brainer
Title: Re: BTS api for python
Post by: liondani on June 05, 2015, 09:16:19 am
With your last script all delegates even the standby delegates have published feeds.
Right now my standby delegate "martin-38ptswarrior-raum" are not publishing feeds anymore even I have him on the "delegate.list"
 "delegate_list": ["delegate.liondani","jcalfee1-developer-team.helper.liondani","martin-38ptswarrior-raum"],

only my two active delegates are publishing feeds.... 
any suggestion?
Title: Re: BTS api for python
Post by: xeroc on June 05, 2015, 09:38:48 am
With your last script all delegates even the standby delegates have published feeds.
Right now my standby delegate "martin-38ptswarrior-raum" are not publishing feeds anymore even I have him on the "delegate.list"
 "delegate_list": ["delegate.liondani","jcalfee1-developer-team.helper.liondani","martin-38ptswarrior-raum"],

only my two active delegates are publishing feeds.... 
any suggestion?
Are you using my scripts? are alt's? or emski's or wackous?

Is the standby delegate funded because you still need to pay the tx fee
Title: Re: BTS api for python
Post by: alt on June 05, 2015, 09:56:10 am
yes, only publish feed for top 101 delegate. when your vote up, it will publish automatic

With your last script all delegates even the standby delegates have published feeds.
Right now my standby delegate "martin-38ptswarrior-raum" are not publishing feeds anymore even I have him on the "delegate.list"
 "delegate_list": ["delegate.liondani","jcalfee1-developer-team.helper.liondani","martin-38ptswarrior-raum"],

only my two active delegates are publishing feeds.... 
any suggestion?

来自我的 HUAWEI P7-L00 上的 Tapatalk

Title: Re: BTS api for python
Post by: liondani on June 05, 2015, 10:33:18 am
With your last script all delegates even the standby delegates have published feeds.
Right now my standby delegate "martin-38ptswarrior-raum" are not publishing feeds anymore even I have him on the "delegate.list"
 "delegate_list": ["delegate.liondani","jcalfee1-developer-team.helper.liondani","martin-38ptswarrior-raum"],

only my two active delegates are publishing feeds.... 
any suggestion?
Are you using my scripts? are alt's? or emski's or wackous?

Is the standby delegate funded because you still need to pay the tx fee
I am experimenting with all feeds but right now the question goes to alt :) The standby delegate is funded and  scan progress at 100%....

Sent from my ALCATEL ONE TOUCH 997D

Title: Re: BTS api for python
Post by: alt on June 05, 2015, 10:36:28 am
With your last script all delegates even the standby delegates have published feeds.
Right now my standby delegate "martin-38ptswarrior-raum" are not publishing feeds anymore even I have him on the "delegate.list"
 "delegate_list": ["delegate.liondani","jcalfee1-developer-team.helper.liondani","martin-38ptswarrior-raum"],

only my two active delegates are publishing feeds.... 
any suggestion?
Are you using my scripts? are alt's? or emski's or wackous?

Is the standby delegate funded because you still need to pay the tx fee
I am experimenting with all feeds but right now the question goes to alt :) The standby delegate is funded and  scan progress at 100%....

Sent from my ALCATEL ONE TOUCH 997D
yes, save money for you, will not publish for standby delegate

来自我的 HUAWEI P7-L00 上的 Tapatalk

Title: Re: BTS api for python
Post by: liondani on June 05, 2015, 11:13:54 am
With your last script all delegates even the standby delegates have published feeds.
Right now my standby delegate "martin-38ptswarrior-raum" are not publishing feeds anymore even I have him on the "delegate.list"
 "delegate_list": ["delegate.liondani","jcalfee1-developer-team.helper.liondani","martin-38ptswarrior-raum"],

only my two active delegates are publishing feeds.... 
any suggestion?
Are you using my scripts? are alt's? or emski's or wackous?

Is the standby delegate funded because you still need to pay the tx fee
I am experimenting with all feeds but right now the question goes to alt :) The standby delegate is funded and  scan progress at 100%....

Sent from my ALCATEL ONE TOUCH 997D
yes, save money for you, will not publish for standby delegate

来自我的 HUAWEI P7-L00 上的 Tapatalk

Actually I want to continue to publish feeds for Martin because  marketing wise it is very good for him.   Hmmmm....  ::)
I wanted to boost his delegate proposal promoting on his thread that he supports the new Indexes right now.
Please make it like it was before.If somebody don't want to publish feeds for a standby delegate he can just remove him from the "delegate list" temporary  ;)
I think it is a good behavior for delegates to publish feeds before they get elected... They are screaming: "I AM READY!"  :)
Title: Re: BTS api for python
Post by: puppies on June 06, 2015, 12:39:48 am
what is pusher.json for?
Title: Re: BTS api for python
Post by: alt on June 06, 2015, 05:29:53 am
what is pusher.json for?
this is the account for pusher.btsbots.com.
bts_publish_market.py use this to publish market data to the push server.
Title: Re: BTS api for python
Post by: alt on June 06, 2015, 05:44:15 am
I have add a new option to enable publish feed price for standby delegate
Code: [Select]
   14         "price_feed":{
   15             "common": "call every run_timer*base_timer, set it to 0,you can disable this task ",
   16             "run_timer": 6,
   17             "common": "update the feed price at least 23.5 hours a time",
   18             "max_update_hours": 23.5,
+  19             "common": "change to 1 if you want to publish even it's a stand by delegate",
+  20             "allow_stand_by": 0,
   21             "price_limit": {
   22                 "common": "only update price feed when the change rate is between 0.5% ~ 50%",
   23                 "change_ignore": 0.2,
With your last script all delegates even the standby delegates have published feeds.
Right now my standby delegate "martin-38ptswarrior-raum" are not publishing feeds anymore even I have him on the "delegate.list"
 "delegate_list": ["delegate.liondani","jcalfee1-developer-team.helper.liondani","martin-38ptswarrior-raum"],

only my two active delegates are publishing feeds.... 
any suggestion?
Are you using my scripts? are alt's? or emski's or wackous?

Is the standby delegate funded because you still need to pay the tx fee
I am experimenting with all feeds but right now the question goes to alt :) The standby delegate is funded and  scan progress at 100%....

Sent from my ALCATEL ONE TOUCH 997D
yes, save money for you, will not publish for standby delegate

来自我的 HUAWEI P7-L00 上的 Tapatalk

Actually I want to continue to publish feeds for Martin because  marketing wise it is very good for him.   Hmmmm....  ::)
I wanted to boost his delegate proposal promoting on his thread that he supports the new Indexes right now.
Please make it like it was before.If somebody don't want to publish feeds for a standby delegate he can just remove him from the "delegate list" temporary  ;)
I think it is a good behavior for delegates to publish feeds before they get elected... They are screaming: "I AM READY!"  :)
Title: Re: BTS api for python
Post by: testz on July 07, 2015, 07:52:43 am
I have add a new option to enable publish feed price for standby delegate

Script stop working  :'(, error:
2015-07-07 13:51:23,182[INFO]: fetch price is 0.03798 CNY/BTS, volume is 35493.036
2015-07-07 13:51:48,158[ERROR]: dictionary changed size during iteration
Traceback (most recent call last):
  File "bts_delegate_task.py", line 307, in excute
    self.task_feed_price()
  File "bts_delegate_task.py", line 257, in task_feed_price
    self.check_median_price(median_price, current_feed_price)
  File "bts_delegate_task.py", line 202, in check_median_price
    for asset in median_price.keys():
RuntimeError: dictionary changed size during iteration

Title: Re: BTS api for python
Post by: alt on July 07, 2015, 08:55:03 pm
have you update to the newest version?
Title: Re: BTS api for python
Post by: testz on July 07, 2015, 10:34:26 pm
I have add a new option to enable publish feed price for standby delegate

Script stop working  :'(, error:
2015-07-07 13:51:23,182[INFO]: fetch price is 0.03798 CNY/BTS, volume is 35493.036
2015-07-07 13:51:48,158[ERROR]: dictionary changed size during iteration
Traceback (most recent call last):
  File "bts_delegate_task.py", line 307, in excute
    self.task_feed_price()
  File "bts_delegate_task.py", line 257, in task_feed_price
    self.check_median_price(median_price, current_feed_price)
  File "bts_delegate_task.py", line 202, in check_median_price
    for asset in median_price.keys():
RuntimeError: dictionary changed size during iteration

Looks like this ("change_max": 50000) fix the problem: https://bitsharestalk.org/index.php/topic,16783.msg222035.html#msg222035
Title: Re: BTS api for python
Post by: alt on September 05, 2015, 03:41:37 pm
update: add exchange poloniex for feed price
after update new version, you need to add a line at the config file ~/.python-bts/delegate_task.json
Code: [Select]
            "market_weight": {
                "common": "weight depenth on (depth * scale)",
                "wallet_usd": 0,
                "wallet_cny": 1,
+                "poloniex_btc": 1,
                "yunbi_cny": 1,