-
Notifications
You must be signed in to change notification settings - Fork 10
Not production ready #14
Comments
Hey I'm trying to just get pushy.py to work. How do I import the "tools" folder? I am not 100% familiar with Pythons structure on installing from GIT yet. |
If you have Then to import: from marconi import tools
# to import pushy:
from marconi import pushy
# to import the push application object that pushy uses:
from marconi.tools.poloniex import push
class myWAMPapp(push.Application): Pushy is using https://github.com/absortium/poloniex-api under the hood (which uses asyncio and only works on python3) |
Yeah thats where I am having issues. I've installed it correctly, but when
I try 'from marconi import tools', I get an unresolved reference on tools
…On Wed, Jun 14, 2017 at 3:20 AM, s4w3d0ff ***@***.***> wrote:
If you have git and pip installed you should be able to just pip3 install
git+https://github.com/s4w3d0ff/marconibot.git (this can be done with
just about any git repo that has a setup.py file)
Then to import:
from marconi import tools
# to import pushy:from marconi import pushy
# to import the push application object that pushy uses:from marconi.tools.poloniex import push
class myWAMPapp(push.Application):
Pushy is using https://github.com/absortium/poloniex-api under the hood
(which uses asyncio and only works on python3)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AO6QwweGXZPefaVmvrfSHEe8bvDWjGasks5sD4mjgaJpZM4M_rgE>
.
|
I figured out what was going wrong with the imports, but when testing pushy I got this error (seems like the same error as the mongodbTicker.py example):
This is an open issue here: absortium/poloniex-api#17 Both the examples in the s4w3d0ff/poloniex repo (uses twisted) and pushy (uses asyncio) was working fine until poloniex started working on their 'backend', something has changed within poloniex that is causing (what seems like) ssl errors (maybe poloniex generated a new ssl cert and we are trying to send an old one?) I use linux, but windows users have claimed that making adjustments to the registry fixes the issue: s4w3d0ff/python-poloniex#115 (comment) I personally would not recommend making changes to your registry unless you know for certain that it is required. I am going to submit a ticket with polo support, hopefully they can fix it on their end or shed some light on the issue. |
Ok cool. Yeah queuedTicker.py works fine for grabbing data. Is there
someway to use that with the database storage? Just trying to store all the
tick data into a mongo database
…On Jun 14, 2017 12:24 PM, "s4w3d0ff" ***@***.***> wrote:
I figured out what was going wrong with the imports, but when testing
pushy I got this error (seems like the same error as the mongodbTicker.py
example):
> pip3 uninstall marconi -y
> git clone https://github.com/s4w3d0ff/marconibot.git
> cd marconibot
marconibot> python3 marconi/pushy.py
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): poloniex.com
DEBUG:urllib3.connectionpool:https://poloniex.com:443 "GET /public?command=returnTicker HTTP/1.1" 200 None
INFO:__main__:Populated markets database with ticker data
INFO:__main__:Subscribed to ticker
Traceback (most recent call last):
File "marconi/pushy.py", line 55, in <module>
app.run()
..., ...
File "/home/s4w3d0ff/.local/lib/python3.5/site-packages/aiohttp/client.py", line 636, in __aenter__
self._resp = yield from self._coro
File "/home/s4w3d0ff/.local/lib/python3.5/site-packages/aiohttp/client.py", line 399, in _ws_connect
headers=resp.headers)
aiohttp.client_exceptions.WSServerHandshakeError: 502, message='Invalid response status'
This is an open issue here: absortium/poloniex-api#17
<absortium/poloniex-api#17>
Both the examples in the s4w3d0ff/poloniex repo (uses twisted) and pushy
(uses asyncio) was working fine until poloniex started working on their
'backend', something has changed within poloniex that is causing (what
seems like) ssl errors (maybe poloniex generated a new ssl cert and we are
trying to send an old one?)
I use linux, but windows users have claimed that making adjustments to the
registry fixes the issue: s4w3d0ff/python-poloniex#115 (comment)
<s4w3d0ff/python-poloniex#115 (comment)>
I personally would not recommend making changes to your registry unless
you know for certain that it is required.
I am going to submit a ticket with polo support, hopefully they can fix it
on their end or shed some light on the issue.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AO6QwzWO1aj_t26C0mPBOdXtbP61Em9Xks5sEAj2gaJpZM4M_rgE>
.
|
Are you sure the queuedTicker.py works? I cant get it to work, I'm getting the same handshake errors from the push api. Within your WAMP application you need to create a I'm used The simplest WAMP app would look something like: from pymongo import MongoClient
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
class TickPitcher(ApplicationSession):
""" WAMP application """
@inlineCallbacks
def onJoin(self, details):
self.db = MongoClient().poloniex['ticker']
yield self.subscribe(self.onTick, 'ticker')
print('Subscribed to Ticker')
def onTick(self, *data):
self.db.update_one(
{"_id": data[0]},
{"$set": {'last': data[1],
'lowestAsk': data[2],
'highestBid': data[3],
'percentChange': data[4],
'baseVolume': data[5],
'quoteVolume': data[6],
'isFrozen': data[7],
'high24hr': data[8],
'low24hr': data[9]
}},
upsert=True)
def onDisconnect(self):
if reactor.running:
reactor.stop() Then make another db connection and You could create a function within the queuedTicker that does what |
yep queuedticker works for me. I'm not that great with Python so bear with me here. I'm trying to hack the two python scripts together so I get it working. I'll take a look at what you have above and try to get this working Edit: Not working :-( |
Ok so actually I think its just printing the same ticker value over and over again, so maybe it's not working 👎 Also it doesn't store anything into the database. Here is what I put together:
|
Hey did you ever hear back from poloniex on this? I'm also willing to change my registry settings I just can't find out what to change. I didn't see the registry file on that other post. Do you still have it? |
No, nothing from poloniex yet... Someone in other post mentioned using regedit.exe s4w3d0ff/python-poloniex#115 (comment), I would not recommend touching your registry especially if you don't know what you are doing, messing with the registry can mess up your system. At least back up your system and/or try it on a VM first. |
Yeah I saw that but they never said what to change lol. I have a virtual box setup running python so I don't have any issues changing registry. Do you know the specifics of what I need to change? |
lol... I still have not heard from poloniex support about this ssl issue, this repo now uses the |
I have successfully created a fully working 'test' bot that uses just the tools from this library, so i am closing this issue. Imports have been cleaned up enough to easily navigate the packages and the structure (somewhat) makes sense. |
TODO:
The text was updated successfully, but these errors were encountered: