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

portalnetwork

v0.0.1

Published

A partially complete Typescript library for interacting with the Portal Network

Downloads

12

Readme

Portal Network Module

A partially complete Typescript library for interacting with the Portal Network

See API for more details

Routing Table Management

The Portal Network module currently supports two overlay routing tables for use with tbe below two subnetworks:

  • State Network
  • History Network

The Ultralight implementation of the Portal Network uses the following strategy to maintain a live and up to date routing table for each subnetwork

Joining the network

Each time portal.addBootNode is called, Ultralight will try to connect to the bootnode with the provided ENR. Once a discv5 session is established, the client sends a Portal Network PING request to the bootnode for each supported Portal Network subnetwork and adds the bootnode to the corresponding k-bucket in each subnetwork routing table. It follows on with FINDNODES requests at all log2 distances between 239-256 where the node has empty k-buckets.

Routing Table Maintenance

  • To keep k-buckets fresh, every 30 seconds, the client selects a random bucket from the nearest 10 buckets that are not full (i.e. have 16 ENRs already), generates a random Node ID that would fall in that bucket, and then initiates a nodeLookup request. Whenever a discv5 session is established with a new node in the network, the client also sends a Portal Network PING message to that node and adds it to the corresponding Subnetwork routing table.
  • Whenever a NODES response contains 1 or more ENRs here is received, any ENRs not currently held in the routing table are added and the corresponding node sent a PING message to verify liveness.
  • Nodes are removed from a specified subnetwork routing table whenever a node doesn't respond to a PING requests.

Content Management

History Network

Content for the history network is stored in the DB as key/value pairs consisting of the below:

  • key -- hex string encoded representation of the History Network content-id (e.g. 0xfac2ca64257e97b691a0ff405c4f8d62ab52a6e0f0d2f92e25022ca12a56a881 is the content-id for the header for Block 1 on mainnet)
  • value -- hex string encoded representation of the RLP serialized content (block header, block body, receipt)

Acknowledgements

Chainsafe's discv5 implementation without which none of this would be possible