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

keybase-player

v0.0.5

Published

Query merkle root in Stellar blockchain

Downloads

11

Readme

player

Travis CI

Library to read Merkle root out of Stellar blockchain, and play back sigchains

Install

$ npm i -g keybase-player

Demo

$ keybase-player --file out.json max
✔ 1. fetch keybase path from root for max: got back seqno #14580525
✔ 2. check hash equality for null: skipped
✔ 3. extract UID for max: map to dbb165b7879fe7b1174df73bed0b9500 via legacy tree
✔ 4. fetch latest root from stellar: returned #28191757, closed at 2020-02-12T14:00:05Z
✔ 5. fetch historical keybase path from root for dbb165b7879fe7b1174df73bed0b9500: got back seqno #14579852
✔ 6. walk path to leaf for dbb165b7879fe7b1174df73bed0b9500: tail hash is b548aff2992c404cdb223c225e98c59425912fee66f5538ee284c330af6fe78d
✔ 7. check hash equality for f4ae8f348c7a579c798a10f812b21a297c10e342cbe5164c056b438df088b84a: match
✔ 8. check skips from 14580525<-14579852: done
✔ 9. walk path to leaf for dbb165b7879fe7b1174df73bed0b9500: tail hash is b548aff2992c404cdb223c225e98c59425912fee66f5538ee284c330af6fe78d
✔ 10. fetch sigchain from keybase for dbb165b7879fe7b1174df73bed0b9500: got back 693 links
✔ 11. fetch all public keys from keybase: got 62 keys
✔ 12. play sigchain for dbb165b7879fe7b1174df73bed0b9500: got key family: PUK generation: 21; live devices: 7; live PGP keys: 2
$ cat out.json | jq .devices[0]
{
  "name": "cry glass",
  "id": "9e6c67030acbcb8f1b970f2eb9eddf18",
  "type": "backup",
  "keys": {
    "sig": "012065ae849d1949a8b0021b165b0edaf722e2a7a9036e07817e056e2d721bddcc0e0a",
    "enc": "0121813f9488c921ef2277fd32c4165655e12deefd6457dcaee79412fdce3d9cf70e0a"
  }
}

The Code

The main operations can be found in the Runner class:

  async runWithReporter(r: Reporter): Promise<UserSigChain | UserKeys> {
    const treeWalker = new TreeWalker(r)
    const userSigChain = await treeWalker.walkUidOrUsername(this.username)
    if (this.opts.tree) {
      return userSigChain
    }
    const keyring = new KeyRing(userSigChain.uid, r)
    await keyring.fetch()
    const player = new Player(r)
    const userKeys = await player.play(userSigChain, keyring)
    return userKeys
  }