Skip to content

Instantly share code, notes, and snippets.

@Netherdrake
Created April 24, 2017 17:10
Show Gist options
  • Save Netherdrake/0515e438b5a3f0c6d35319cf3ca00ce3 to your computer and use it in GitHub Desktop.
Save Netherdrake/0515e438b5a3f0c6d35319cf3ca00ce3 to your computer and use it in GitHub Desktop.
Blockchain.stream_from
In [1]: from steem.blockchain import Blockchain
In [2]: b = Blockchain()
In [3]: g = b.stream_from()
In [4]: next(g)
Out[4]:
{'block': 11351325,
'op': ['vote',
{'author': 'otisbrown',
'permlink': '73fmdw-i-want-this',
'voter': 'warren.buffett',
'weight': 111}],
'op_in_trx': 0,
'timestamp': '2017-04-24T17:07:30',
'trx_id': '507a2fd598dd87434be9cc641dbadff5ea213dc3',
'trx_in_block': 0,
'virtual_op': 0}
In [5]: g = b.stream_from(batch_operations=True)
In [6]: next(g)
Out[6]:
[{'block': 11351327,
'op': ['comment',
{'author': 'nulls',
'body': '<html>\n<p>&nbsp;Hello Steemit Community!</p>\n<p>Free Pinkcoin faucet for you here special steemit members.</p>\n<p>How to get free pinkcoin is easy enough to stay your pinkcoin address here and I will send 5 pinkcoin in 24 hours.</p>\n<p><img src="https://s14.postimg.org/xipzq3rn5/ooo.jpg" width="799" height="443"/></p>\n<h2>&nbsp;About Pinkcoin</h2>\n<blockquote>People helping people to create a better world through microtipping and automated trading.</blockquote>\n<ul>\n <li>Website: <a href="http://pinkcoin.ca/">http://pinkcoin.ca</a></li>\n <li>Explorer: <a href="http://explorer.pinkarmy.ml/">http://explorer.pinkarmy.ml</a></li>\n <li>Donate4Life: 2Kh7SDeJWy7pqwDHKS3XqZzMw8dcqHtFv7</li>\n <li>CHAT: <a href="http://slack.with.pink/">http://slack.with.pink/</a></li>\n <li>Forum 1: <a href="https://bitcointalk.org/index.php?topic=1783421.0">https://bitcointalk.org/index.php?topic=1783421.0</a></li>\n <li>Forum 2: <a href="https://bitcointalk.org/index.php?topic=1874696.0">https://bitcointalk.org/index.php?topic=1874696.0</a></li>\n <li>Market: <a href="http://coinmarketcap.com/currencies/pinkcoin">http://coinmarketcap.com/currencies/pinkcoin</a></li>\n</ul>\n<p>&nbsp;</p>\n<h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;It\'s very easy and fast.</h1>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You can get up to 5 pinkcoin reward every 24 hours.<br>\n &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Minimal payout 5 pinkcoin. Within the next 0-24 hours)</p>\n<h1>Faucet Balance (PINK): 1000</h1>\n<p>&nbsp;Please enter your pinkcoin wallet address</p>\n<p>follow @nulls and share</p>\n</html>',
'json_metadata': '{"tags":["pinkcoin"],"users":["nulls"],"image":["https://s14.postimg.org/xipzq3rn5/ooo.jpg"],"links":["http://pinkcoin.ca/","http://explorer.pinkarmy.ml/","http://slack.with.pink/","https://bitcointalk.org/index.php?topic=1783421.0","https://bitcointalk.org/index.php?topic=1874696.0","http://coinmarketcap.com/currencies/pinkcoin"],"app":"steemit/0.1","format":"html"}',
'parent_author': '',
'parent_permlink': 'pinkcoin',
'permlink': 'faucet-pinkcoin-25-04-2017',
'title': 'Faucet Pinkcoin 25/04/2017'}],
'op_in_trx': 0,
'timestamp': '2017-04-24T17:07:36',
'trx_id': '6a934c28ff708a825f4dec37e18011461c761033',
'trx_in_block': 0,
'virtual_op': 0},
{'block': 11351327,
'op': ['vote',
{'author': 'nulls',
'permlink': 'faucet-pinkcoin-25-04-2017',
'voter': 'nulls',
'weight': 10000}],
'op_in_trx': 1,
'timestamp': '2017-04-24T17:07:36',
'trx_id': '6a934c28ff708a825f4dec37e18011461c761033',
'trx_in_block': 0,
'virtual_op': 0},
{'block': 11351327,
'op': ['vote',
{'author': 'kevinwong',
'permlink': 'steem-the-ultimate-paywall-destroyer',
'voter': 'richardjuckes',
'weight': 10000}],
'op_in_trx': 0,
'timestamp': '2017-04-24T17:07:36',
'trx_id': 'fead33fd8849fbd69c021523ff09e62298b89594',
'trx_in_block': 1,
'virtual_op': 0},
{'block': 11351327,
'op': ['claim_reward_balance',
{'account': 'homeartpictures',
'reward_sbd': '0.033 SBD',
'reward_steem': '0.000 STEEM',
'reward_vests': '535.677936 VESTS'}],
'op_in_trx': 0,
'timestamp': '2017-04-24T17:07:36',
'trx_id': '6e90efc79b5ba818f2e2844eb4f457ca746eb2d6',
'trx_in_block': 2,
'virtual_op': 0},
{'block': 11351327,
'op': ['vote',
{'author': 'johnjgeddes',
'permlink': 'first-drops-of-rain-part-3-of-3-to-seek-love-you-have-to-find-all-the-barriers-within-yourself-you-ve-built-against-it',
'voter': 'ubg',
'weight': 111}],
'op_in_trx': 0,
'timestamp': '2017-04-24T17:07:36',
'trx_id': '29a44c61ffb2875be6531527a4e1f62a1bf658e7',
'trx_in_block': 3,
'virtual_op': 0},
{'block': 11351327,
'op': ['vote',
{'author': 'heavenlly',
'permlink': 'do-you-represent-who-you-preach-about',
'voter': 'rynow',
'weight': 10000}],
'op_in_trx': 0,
'timestamp': '2017-04-24T17:07:36',
'trx_id': '8dfaf6e00f96fc6316e59286001ad07692a6e210',
'trx_in_block': 4,
'virtual_op': 0},
{'block': 11351327,
'op': ['claim_reward_balance',
{'account': 'evildeathcore',
'reward_sbd': '0.000 SBD',
'reward_steem': '0.000 STEEM',
'reward_vests': '2.076273 VESTS'}],
'op_in_trx': 0,
'timestamp': '2017-04-24T17:07:36',
'trx_id': 'd9256b7c062c57154f8500673b98d80248b9dbc3',
'trx_in_block': 5,
'virtual_op': 0},
{'block': 11351327,
'op': ['curation_reward',
{'comment_author': 'stephenkendal',
'comment_permlink': 're-sebhaj-re-stephenkendal-crowdsourced-marketing-marketing-initiative-part-4-bloggers-blog-for-free-on-tripadvisor-while-shareholders-reap-the-benefits-20170417t170735425z',
'curator': 'etcmike',
'reward': '43.601643 VESTS'}],
'op_in_trx': 1,
'timestamp': '2017-04-24T17:07:39',
'trx_id': '0000000000000000000000000000000000000000',
'trx_in_block': 6,
'virtual_op': 0},
{'block': 11351327,
'op': ['author_reward',
{'author': 'stephenkendal',
'permlink': 're-sebhaj-re-stephenkendal-crowdsourced-marketing-marketing-initiative-part-4-bloggers-blog-for-free-on-tripadvisor-while-shareholders-reap-the-benefits-20170417t170735425z',
'sbd_payout': '0.007 SBD',
'steem_payout': '0.000 STEEM',
'vesting_payout': '68.516868 VESTS'}],
'op_in_trx': 1,
'timestamp': '2017-04-24T17:07:39',
'trx_id': '0000000000000000000000000000000000000000',
'trx_in_block': 6,
'virtual_op': 0}]
In [7]: g = b.stream_from(full_blocks=True)
In [8]: next(g)
Out[8]:
{'extensions': [],
'previous': '00ad35315d422012f8e39d893a1f44ff3a525e63',
'timestamp': '2017-04-24T17:08:36',
'transaction_merkle_root': '08fc198bf9c1f6cd8878f89fcbc29f8d0b7d084f',
'transactions': [{'expiration': '2017-04-24T17:08:58',
'extensions': [],
'operations': [['vote',
{'author': 'homeartpictures',
'permlink': 'german-landscapes-at-different-seasons-deutsche-landschaften-zu-unterschiedlichen-jahreszeiten-homeartpictures-originalcontent',
'voter': 'speda',
'weight': 10000}]],
'ref_block_num': 13615,
'ref_block_prefix': 3782767539,
'signatures': ['1f365225f0d67c002ada662b7060f3db4d27091592ce0d6c2fe619b4eb26110bfa01dec78392db5c4301080c625657add3f87f420378f83daa9983304a857e63ef']},
{'expiration': '2017-04-24T17:08:48',
'extensions': [],
'operations': [['vote',
{'author': 'digitaltyrants',
'permlink': 'first-doctor-caricature',
'voter': 'yasemin-gencer',
'weight': 10000}]],
'ref_block_num': 13617,
'ref_block_prefix': 304104029,
'signatures': ['1f7d4f4da18f0d71944ad8b7e7e716df41e0eb6b9e4acbc7d2fd53eb7c0b50ac09296248b44a0140dec2431368ea6840de5af8ef54d096c28b4c3b453e657ef0bb']}],
'witness': 'witness.svk',
'witness_signature': '205b774cf358cf239d1f7541c5d266cf79e2314ba69841f7a1d5ca99da8c0c80b10c171b41e2e24a618e7993b687dfb85b960ecc2a486c78726f8473769ea943db'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment