blocktrail / blocktrail-sdk-python

Python BlockTrail's Developer Friendly SDK for the BlockTrail API
MIT License
22 stars 27 forks source link

Google App engine support #7

Open shayanb opened 9 years ago

shayanb commented 9 years ago

Has anyone tried to port this sdk to Google App engine? is there any plans to support app engine?

shayanb commented 9 years ago

I put together a fork that works on Appengine: https://github.com/shayanb/blocktrail-sdk-python

rubensayshi commented 9 years ago

hmm, I thought the requests package would work on GAE, maybe I should switch the sdk to https://pypi.python.org/pypi/urllib3 instead, which does claim to support GAE

shayanb commented 9 years ago

yeah it might be a bit tricky to have a universal library that works on all platforms, for the fork I used from google.appengine.api import urlfetch that is just specific to GAE, but I've used urllib2 before for the same issue and it worked fine, urlib3 could work too.

try:
    from urllib2 import urlopen
except ImportError:
    from urllib.request import urlopen
shayanb commented 9 years ago

using client.transaction(tx) , it sometimes ends up with this error on GAE:

'_URLFetchResult' object has no attribute 'reason' : {}

Any ideas?

p.s I'm using from google.appengine.api import urlfetch

shayanb commented 9 years ago

@rubensayshi they are the double-spends (malleability) tx-hashes that fail to reply.

rubensayshi commented 9 years ago

can you give me one of the failing TXs? if you don't want to publicly link one then mail me ruben@blocktrail.com

peterlie commented 7 years ago

requests-toolbelt is helpful to get requests working on App Engine: https://github.com/sigmavirus24/requests-toolbelt