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

@ipcexplorer/ipc-explorer

v1.0.5

Published

The goal of this project is to build a minimum viable product (MVP) of the IPC explorer. See [what's next](#whats-next) after the MVP.

Downloads

3

Readme

IPC Explorer

The goal of this project is to build a minimum viable product (MVP) of the IPC explorer. See what's next after the MVP.

InterPlanetary Consensus (IPC) is a revolutionary blockchain technology that powers planetary-scale web3 apps.

You can learn more about this technology

Using IPC Explorer you can:

  • [x] Browse subnets.
  • [x] View subnet configuration.
  • [x] View the last committed bottom-up checkpoint of a subnet.
  • [x] View subnet genesis validators.
  • [x] View recent subnet deposits.
  • [x] View recent subnet withdrawals.
  • [x] View recent subnet transactions.

Check out IPC Explorer website or run the application locally.

How it's made

  • To narrow the scope of the MVP the decision was made to not build an indexing backend at this stage.
  • The application relies on public Filecoin RPC providers.
  • IPC Explorer is a single page application (SPA) built using React.
  • The application uses ethers.js to:
    • Call various methods of the IPC Subnet Actor (ISA) and the IPC Gateway Actor (IGA) smart contracts to collect various information about subnets.
    • Fetch blocks, transactions, and events from the root network and its child subnets.

Known issues and limitations

  • Listing subnet withdrawals may not work. It relies on the NewBottomUpMsgBatch event of the IPC Gateway Actor smart contract. But for some reason, I do not observe such events via a local subnet RPC during manual testing.
  • Connecting to a subnet RPC provider is subject to same-origin policy. Therefore, you can only connect to a local subnet RPC provider from a locally running application. Connecting to a public subnet RPC provider is possible if the provider explicitly allows it by setting corresponding CORS headers.
  • Not displaying when the last bottom-up checkpoint of a subnet was committed to the parent. Finding in what parent block a subnet committed its last bottom-up checkpoint is inefficient without having an indexing backend. In the worst-case scenario, you'd have to scan the parent from its current block down to the subnet's genesis block to find the last checkpoint transaction.

Why building from scratch?

Since the Filecoin Virtual Machine used by IPC is an EVM-compatible runtime, you may wonder, can't we just use some existing open-source blockchain explorer like Blockscout? And the short answer is yes, we can. But, the user experience will be poor out-of-the-box.

  • Blockscout doesn't support simultaneously connecting to multiple RPC providers. This means you either look at a parent or a child IPC network at a time. Or have to deploy a separate Blockscout instance for every subnet. Which seems inefficient.
  • Blockscout is a general-purpose blockchain explorer and knows nothing about IPC subnets. Even if you upload and verify IPC-specific smart contracts into it, this will improve visibility into subnets just a little. And the UX will remain poor. Because you still need to manually call a set of Gateway and Subnet Actor methods to gather info about subnets.

So for the best visibility into subnets and a good user experience you either fork and extend something like Blockscout or build your own IPC explorer from scratch. For this MVP I chose the latter.

What's next?

Before the IPC General Availability launch (planned for 2024 Q3) I want to build a production-ready IPC explorer. The key difference from the current MVP will be having an indexing backend. This backend will greatly improve the UX of the explorer and enable new features. To name a few:

  • Full history of transactions, messages, events, etc. is available and searchable.
  • Various charts and analytics based on real-time and historical data.
  • Quicker application load times.

Another useful feature will be the ability to connect your Metamask wallet to a subnet.

Development

Connecting to a local subnet RPC

You can only connect to a local subnet RPC from a locally running application due to same-origin policy. You also need a workaround because Fendermint Ethereum API Facade doesn't set CORS headers that would allow such connection from your browser.

The suggested workaround is to run a reverse proxy that sets required CORS headers. In the following instruction, it's assumed that you're already running a subnet with Ethereum API Facade listening on http://localhost:8545. This should be the case if you followed the official instruction about deploying a subnet.

  1. Install mitmproxy.
  2. Run it with a custom cors.py module:
mitmdump --mode reverse:http://localhost:8545 --listen-host localhost --listen-port 9545 -s mitmproxy/cors.py

Now you should be able to connect to subnet RPC from the locally running application. Note the non-standard provider URL (which is our reverse proxy) that you must enter after you click on the "Connect" button in the application:

http://localhost:9545