def read_from_head(p):
    global contract_dict
    while (len(contract_dict) != 0):
        for contract_hash in contract_dict.keys():
            head_level = p.shell.head.header()['level']
            data = p.contract(contract_hash).storage(head_level)
            if (data != contract_dict[contract_hash]['last_data']):
                print('Ntf head:', contract_hash, head_level, data, '\n')
                contract_dict[contract_hash]['last_data'] = data
        sleep(5)
def read_from_head(p):
    global contract_dict
    while (len(contract_dict) != 0):
        for contract_hash in contract_dict.keys():
            head_level = p.shell.head.header()['level']
            data = p.contract(contract_hash).storage(head_level)
            if (data != contract_dict[contract_hash]['last_data']):
                print('Ntf head:', contract_hash, head_level, data, '\n')
                contract_dict[contract_hash]['last_data'] = data
        sleep(5)