def get_all_activenodes(): look_for_nodes = bitshares_ws_client.request('database', 'lookup_activenode_accounts', [0, 1000]) all_activenode_count = len(look_for_nodes) global_properties = bitshares_ws_client.get_global_properties() activenode_count = len(global_properties["current_activenodes"]) activenodes = bitshares_ws_client.request( 'database', 'get_objects', [[look_for_nodes[w][1] for w in range(0, all_activenode_count)]]) now = str(datetime.datetime.now(pytz.timezone('Etc/GMT+0')).time()) x = time.strptime(now.split('.')[0], '%H:%M:%S') seconds = datetime.timedelta(hours=x.tm_hour, minutes=x.tm_min, seconds=x.tm_sec).total_seconds() result = [] for activenode in activenodes: if activenode: activenode["activenode_account_name"] = get_account_name( activenode["activenode_account"]) activenode["activities_approx_count"] = round( ((seconds) / 2) / activenode_count) #localtime +2 hours activenode["activities_aprrox_missed_activities"] = round( (activenode["activities_approx_count"] - activenode["activities_sent"]) / activenode["activities_approx_count"] * 100) result.append([activenode]) return activenodes
def get_fees(): return bitshares_ws_client.get_global_properties()