def run_steemd_tests( debug_node ): from steemapi.steemnoderpc import SteemNodeRPC try: print( 'Replaying blocks...', ) sys.stdout.flush() total_blocks = 0 while( total_blocks % 100000 == 0 ): total_blocks += debug_node.debug_push_blocks( 100000, skip_validate_invariants=True ) print( 'Blocks Replayed: ' + str( total_blocks ) ) sys.stdout.flush() print( "Triggering payouts" ) sys.stdout.flush() debug_node.debug_generate_blocks_until( 1467590400 ) print( "Generating blocks to verify nothing broke" ) assert( debug_node.debug_generate_blocks( 10 ) == 10 ) print( "Done!" ) print( "Getting comment dump:" ) sys.stdout.flush() rpc = SteemNodeRPC( 'ws://127.0.0.1:8095', '', '' ) ret = rpc.get_discussions_by_cashout_time( '', '', str( 0xFFFFFFFF ) ); print( 'author, url, total_payout_value, abs_rshares, num_active_votes' ) for comment in ret: print( comment[ 'author' ] + ', ' + comment[ 'url' ] + ', ' + comment[ 'total_payout_value' ] + ', ' + comment[ 'cashout_time' ] ) except ValueError as val_err: print( str( val_err ) )