dev-ptera / yellow-spyglass-server Goto Github PK
View Code? Open in Web Editor NEWExpress API used to explore the banano network.
Home Page: https://www.yellowspyglass.com
Express API used to explore the banano network.
Home Page: https://www.yellowspyglass.com
// 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);
}
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.