npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

didhub-scheduler

v1.0.0

Published

This is the scheduler for DIDHub. It fetches data from the blockchain and store in mongoDB and Redis

Downloads

2

Readme

DIDhub Scheduler

This repo contains scheduler that periodically fetches data from the blockchain and send to the databases. It also contains scheduler that periodically computes statistics based on the nft marketplace data and the domain data.

Running the project in Development or Stage

Install

Install dependencies

yarn

Build and Start

yarn start

Troubleshoot

If you encounter installation error this may help

sudo apt-get install build-essential

Running the project in Production

Install dependencies

yarn

Build

yarn build:ts

Open different terminals with tmux

tmux

Or attach to running terminals with tmux

tmux attach -t {window_number}

Running the corresponding scheduling task in the window

schedule:{scheduler_number}

Project Structure

src/config

  • constants: Import constants from didhubCore package. These constants includes fields that describe the projects, collections, tokens, contracts used in our project

  • initData: Code inside this directory overwrites the database collection with the configuration from DIDhubCore. This method is temporary and should be replaced with admin input from the admin dashboard in the future. It is save to not use this code

src/plugins

The plugins defines the modules that will be shared by the schedulers

  • elasticsearch: The initialisation of elasticsearch cluster connection

  • mongo: The initialisation of mongoDB connections

  • redis: The initialisation of redis connections

  • statistics: The computation of domain statistics. This is set up for didhub website rankings, hotnames etc

  • web3: The initialisation of node providers. Please modify if you are integrating with new blockchains

  • support.ts: This file imports the plugins and expose for global usage

src/scheduler

This directory defines all the schedulars that are run at a pre-defined time period

  • activity: This directory contains schedule tasks that routinely fixes existing data

  • caching: This directory contains schedule tasks that compute and caches results for our didhub api

  • domain: This directory contains schedule tasks that fetches data from our supported project. Each sub-directory corresponds to a single project

  • marketplace: This directory contains schedule tasks that computes secondary market statistics, inlcuidng floor price, hotnames, and manages marketplace orders

  • meta: This directory contains schedule tasks that computes domain level statistics, including registration, collection, project statistics

  • misc: This directory contains unused code for fixing data

  • test: This directory contains schedule tasks for seting up testing database

  • utils: This directory contains supporting functions such as smart block scanner (helper for fetching events and storing results), evebtFetcher (function that fetchings event from corresponding node provider), and metadata fetching functions

  • index.ts: this page imports all schedulars can manages which to run on different environment. It also supports schduler groups configuration that group and run schedular of similar blockchain/characteristics.

Learn More

To learn Fastify, check out the Fastify documentation.