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

@ora-io/reku

v0.1.9

Published

<div align="center"><img src="https://github.com/ora-io/ora-stack/blob/main/assets/reku.logo.png?raw=true" alt="Reku Icon" width="200" /></div>

Downloads

860

Readme

[WIP] Reku: Reliable ETH Kit & Utils

npm version npm downloads bundle JSDocs License

Event Cross-Check

  • used for cross-checking missing events using eth getLogs
  • note: cross-check interval shouldn't < 5min, otherwise rpc call would be expensive. Recommend set to 1 hour + 50 blocks (for redundancy check).

BaseCrossChecker

  • onMissingLog: FnOnMissingLog: the callback function that will be called when there's a missing log found;
  • ignoreLogs?: SimpleLog[] : it allows users to pass in the txhash list (,log index list) that already processed, let the crosschecker to ignore them.

crossCheckRange

crossCheckRetro

crossCheckFrom

AutoCrossCheck

Conceptually it supports 'catchup', 'realtime', 'mix' modes, controled by fromBlock and toBlock;

  • realtime mode: run over the latest block data; enter when fromBlock and toBlock are NOT present; starts from latestblocknum+1 and never ends, always waits until latestblocknum >= lastcheckpoint + batchBlocksCount;
  • catchup mode: run over historical block data; enter when fromBlock and toBlock is present; starts from fromBlock and ends at toBlock;
  • mix mode: start in catchup mode and transit to realtime mode; enter when fromBlock is present and toBlock is NOT; auto-transit when lastcheckpoint > latestblocknum - batchBlocksCount;

i.e. It starts with 'realtime' mode by default.

Options:

  • store?: the Store used to cache the <txhash, logindex> that already processed.
  • storeKeyPrefix?: set the prefix to all keys when set key-value to store (cache), e.g. key = prefix+'txHashList', prefix can be "project:app:network:" to form a "project:app:network:txHashList" redis key., defult: ''
  • storeTtl?: the ttl for <txhash, logindex> record in store, defualt: no limit
  • batchBlocksCount?: how many blocks to get per getLogs check, in readtime mode it waits until the new block num >= batchBlocksCount. default: 10
  • delayBlockFromLatest?: mostly for realtime mode; each time cc wait until latest height > toBlock + delayBlockFromLatest, default: 1
  • blockInterval?: the block interval (in ms) of the given chain, default: 12000 for eth
  • pollingInterval?: how long does it take between 2 block height check polling checks; mostly for limiting getLogs calling rate in catchup mode, default: 3000 ms
  • fromBlock?: once specified, it means start catching up from historical blocks
  • toBlock?: once specified, it means the crosscheck isn't infinite and will end at this height; need fromBlock present if this set

Usage

const acc = new AutoCrossChecker(provider)
await acc.start({
  onMissingLog,
  ignoreLogs,
  fromBlock: 20003371, // optional, empty to start from latest
  toBlock: 20003371, // optional, empty to enter continueous cc
  address: CONTRACT_ADDRESS,
  topics,
  batchBlocksCount: 1,
  pollingInterval: 3000,
})