GithubHelp home page GithubHelp logo

dev-ptera / yellow-spyglass-server Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 517 KB

Express API used to explore the banano network.

Home Page: https://www.yellowspyglass.com

TypeScript 98.18% JavaScript 1.82%
api banano banano-currency express representative typescript uptime-monitor wallets

yellow-spyglass-server's People

Contributors

dev-ptera avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

ffd-fly

yellow-spyglass-server's Issues

online-reps API call results don't always match representatives table

// Get all online reps from nano rpc.
// The representatives_online RPC call is unreliable, so I mark reps as offline if they have been offline for OFFLINE_AFTER_PINGS pings.
const onlineReps = (await NANO_CLIENT.representatives_online().catch((err) =>
Promise.reject(LOG_ERR('cacheRepresentatives.representatives_online', err))
)) as RPC.RepresentativesOnlineResponse;

// Update online pings
AppCache.onlineReps.clear();
AppCache.repPings.currPing++;
for (const address of onlineReps.representatives) {
    // Use nano rpc results to add online/offline status to untracked reps.
    AppCache.onlineReps.add(address);
    AppCache.repPings.map.set(address, AppCache.repPings.currPing);
}

// Use the AppCache to mark trackedReps as online or offline.
for (const address of trackedReps.keys()) {
    const rep = trackedReps.get(address);
    rep.online = isRepOnline(address);
    // Update onlinReps cache results to match trackedReps cache results.
    rep.online ? AppCache.onlineReps.add(rep.address) : AppCache.onlineReps.delete(rep.address);
}

TODO

  1. Catch uncaught promises
  2. Insights Max TX check

Bug: Small Reps marked as offline

Any rep with less than 100K Banano is marked as offline because they are getting filtered out in the rep-service. Fix this.

Example:
ban_1nannerspntaoqyrtnzjj76joe6yqjcterj6ef3qkdc6kfgswqu3pfaaqphe

Use the representatives_online RPC command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.