Example #1
0
]
for op in chainsync.get_ops_in_transactions(transactions):
    print_event('op', op)

print('\nGetting blocks 1, 10, 50, 250, 500')
blocks = chainsync.get_blocks([1, 10, 50, 250, 500])
for block in blocks:
    print_event('block', block)

print('\nGetting blocks 1000-1005')
blocks = chainsync.get_block_sequence(1000, 5)
for block in blocks:
    print_event('block', block)

print('\nGetting all ops in block 9284729...')
for op in chainsync.get_ops_in_block(9284729):
    print_event('op', op)

print('\nGetting withdraw_vesting ops in block 9284729...')
for op in chainsync.get_ops_in_block(9284729, whitelist=['withdraw_vesting']):
    print_event('op', op)

print('\nGetting all ops in block 1000000, 5000000, and 2000000...')
for op in chainsync.get_ops_in_blocks([1000000, 5000000, 2000000]):
    print_event('op', op)

print('\nGetting producer_reward ops in block 1000000, 5000000, and 2000000...')
for op in chainsync.get_ops_in_blocks([1000000, 5000000, 2000000], whitelist=['producer_reward']):
    print_event('op', op)

print('\nStreaming blocks from head...')
Example #2
0
print('\nGetting block 1')
block = chainsync.get_block(1)
print(block)

print('\nGetting blocks 1, 10, 50, 250, 500')
blocks = chainsync.get_blocks([1, 10, 50, 250, 500])
for block in blocks:
    print(block)

print('\nGetting blocks 1000-1005')
blocks = chainsync.get_block_sequence(1000, 5)
for block in blocks:
    print(block)

print('\nGetting all ops in block 6274087...')
for op in chainsync.get_ops_in_block(6274087):
    print("{}: {} [{}] - {}".format(datetime.datetime.now(), op['block_num'],
                                    op['transaction_id'],
                                    op['operation_type']))

print('\nGetting withdraw_vesting ops in block 6274087...')
for op in chainsync.get_ops_in_block(6274087, whitelist=['feed_publish']):
    print("{}: {} [{}] - {}".format(datetime.datetime.now(), op['block_num'],
                                    op['transaction_id'],
                                    op['operation_type']))

print('\nGetting all ops in block 1000000, 5000000, and 2000000...')
for op in chainsync.get_ops_in_blocks([1000000, 5000000, 2000000]):
    print("{}: {} [{}] - {}".format(datetime.datetime.now(), op['block_num'],
                                    op['transaction_id'],
                                    op['operation_type']))