Commit Graph

8 Commits

Author SHA1 Message Date
creslinux
efbeabf141 Added Local RPC client
- added only "Daily" call so far, submitting for early review/feedback

This depends on zerorpc as a requirement.
simple examples here:
http://www.zerorpc.io/

Installed with pip3 install zerorpc

localRCP is enabled/disabled from within config.json
e.g
    "localrpc": {
        "enabled": true
       },

The server is enabled from within existing rpc manager
and makes use of the existing superclass (RPC)

Though making use of the existing hardwork done in rpc.py
It *should be easy to add the other Telegram calls into local_rpy_server.py

The server is wrapped in a thread to be non-blocking
The server and client accept serialised calls or not, used in daily to return json
The client can be used from command line or in a python script

As example, from cmdline for last 3 days Daily

/Users/creslin/PycharmProjects/freqtrade_new/.env/bin/zerorpc tcp://127.0.0.1:4242 daily 3
connecting to "tcp://127.0.0.1:4242"
False
('[\n'
 '    [\n'
 '        "2018-06-08",\n'
 '        "0.00000000 BTC",\n'
 '        "0.000 USDT",\n'
 '        "0 trade"\n'
 '    ],\n'
 '    [\n'
 '        "2018-06-07",\n'
 '        "0.00000000 BTC",\n'
 '        "0.000 USDT",\n'
 '        "0 trade"\n'
 '    ],\n'
 '    [\n'
 '        "2018-06-06",\n'
 '        "0.00000000 BTC",\n'
 '        "0.000 USDT",\n'
 '        "0 trade"\n'
 '    ]\n'
 ']')

Programitcally this would be:
import zerorpc

c = zerorpc.Client()
c.connect("tcp://127.0.0.1:4242")

for item in c.daily(3):
    print item
2018-06-08 18:35:01 +00:00
xmatthias
69006b8fe8 flake8 2018-05-31 21:08:26 +02:00
xmatthias
0d251cbfdd rpc type hints 2018-05-31 20:55:26 +02:00
gcarq
fa7f74b4bc use native python logger 2018-03-25 21:43:00 +02:00
gcarq
3f8d7dae39 make name a required argument and add fallback to getEffectiveLevel 2018-03-25 21:42:03 +02:00
gcarq
7078bc00bd rpc: apply correct typehints; remove redundant parentheses 2018-03-20 19:50:04 +01:00
Gerald Lonlas
390501bac0 Make Pylint Happy chapter 1 2018-03-03 09:33:54 +08:00
Gerald Lonlas
f4ec073099 Move RPC and Telegram to classes 2018-03-03 09:33:54 +08:00