steemit / steem-python

The official Python (3) library for the Steem Blockchain.
https://steem.io
MIT License
154 stars 100 forks source link

blockchain.stream_from nodes? #156

Closed devopsjourney1 closed 6 years ago

devopsjourney1 commented 6 years ago

im not having any luck with blockchain.stream on any node...

Is there a list of nodes that support this functionality?

E-D-A commented 6 years ago

Please specify what failed. A snippet of your code and the output showing the error would be helpful. For sure it works. :smile: Tested recently against rpc.buildteam.io, api.steemit.com & rpc.steemviz.com.

devopsjourney1 commented 6 years ago

it just sits there forever and doesn't do anything... like it's not finding any posts Edit After like 5-10 minutes it errors out. Added error at bottom of post

This is code that used to work, i've had to swap nodes a few times but since Feb 17th I haven't been able to get one that I can stream from properly..

Any ideas on what's wrong with my code? I'm just trying to find random posts.

custom_instance = Steemd(nodes='rpc.buildteam.io')
b = Blockchain(steemd_instance=custom_instance)

stream = b.stream()
for post in stream:
     if 'title' in post:
          title = post['title']
          print('title')

WARNING:urllib3.connectionpool:Retrying (Retry(total=16, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f536319dbe0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=15, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f536319dd30>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=14, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f536319de10>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=13, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f536319df28>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=12, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f53631300b8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=11, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130198>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=10, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f53631302b0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=9, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f53631303c8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=8, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f53631304e0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=7, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f53631305f8>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=6, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130710>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=5, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130828>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=4, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130940>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=3, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130a58>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=2, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130b70>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=1, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130c88>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / WARNING:urllib3.connectionpool:Retrying (Retry(total=0, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5363130da0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': / Big Error: encoding with 'idna' codec failed (UnicodeError: label empty or too long)

crokkon commented 6 years ago

I think nodes should be a list, not a string. This works for me:

>>> from steem.blockchain import Blockchain
>>> from steem.steem import Steem
>>> s = Steem(nodes=['https://rpc.buildteam.io'])
>>> b = Blockchain(s)
>>> for post in b.stream():
...     print(post)
clayop commented 6 years ago

I failed with nodes list ['127.0.0.1:8090']

devopsjourney1 commented 6 years ago

this is still an issue.

cyon1c commented 6 years ago

Will look into this issue this week.

idikuci commented 6 years ago

Hey, Is this still an outstanding error? I get it too.