blocktrail-sdk-python icon indicating copy to clipboard operation
blocktrail-sdk-python copied to clipboard

Google App engine support

Open shayanb opened this issue 10 years ago • 7 comments

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

shayanb avatar Oct 19 '15 21:10 shayanb

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

shayanb avatar Oct 20 '15 04:10 shayanb

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

rubensayshi avatar Oct 21 '15 09:10 rubensayshi

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 avatar Oct 21 '15 16:10 shayanb

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 avatar Oct 22 '15 03:10 shayanb

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

shayanb avatar Oct 22 '15 05:10 shayanb

can you give me one of the failing TXs? if you don't want to publicly link one then mail me [email protected]

rubensayshi avatar Oct 22 '15 09:10 rubensayshi

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

peterlie avatar Feb 04 '17 14:02 peterlie