if __name__ == '__main__': # Let's find out how often blocks are generated! config = rpc.get_config() block_interval = config["STEEMIT_BLOCK_INTERVAL"] # We are going to loop indefinitely #Initialize count to store blocks produced for each witness count={} for witness in watch_accounts: count[witness] = 0 while True: # Get chain properies to identify the # head/last reversible block props = rpc.get_dynamic_global_properties() # Get block number block_number = props['head_block_number'] # We loop through all blocks we may have missed since the last # block defined above while (block_number - last_block) > 0: last_block += 1 # Get full block block = rpc.get_block(last_block) #Match witness from block to witness from list and increase block production count of that witness for witness in watch_accounts:
print("%d | %s | %s -> %s: %s -- %s" % (blockid, block["timestamp"], op["from"], op["to"], op["amount"], op["memo"])) if __name__ == '__main__': # Let's find out how often blocks are generated! config = rpc.get_config() block_interval = config["STEEMIT_BLOCK_INTERVAL"] # We are going to loop indefinitely while True: # Get chain properies to identify the # head/last reversible block props = rpc.get_dynamic_global_properties() # Get block number # We here have the choice between # * head_block_number: the last block # * last_irreversible_block_num: the block that is confirmed by # 2/3 of all block producers and is thus irreversible! # We recommend to use the latter! # block_number = props['head_block_number'] block_number = props['last_irreversible_block_num'] # We loop through all blocks we may have missed since the last # block defined above while (block_number - last_block) > 0: last_block += 1