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

@notifi-network/local-fusion

v3.2.4-alpha.0

Published

This package contains the tooling required to execute a Notifi fusion source locally on a developer machine, or via the Notifi dev container environments.

Downloads

15

Readme

Local Fusion

This package contains the tooling required to execute a Notifi fusion source locally on a developer machine, or via the Notifi dev container environments.

Usage

Note: The npx command is temporarily broken so you will need to install ts-node in the parser sources packahe and run the command with

node --loader ts-node/esm <node_modules_directory>/@notifi-network/local-fusion/dist/cli/bin.js <commands> [options]

The package exposes a CLI tool that can be used to execute a fusion source locally. The tool can be invoked with the following command:

npx local-fusion-cli <command> [options]

The following commands are available:

  1. 'EVM' - Executes a fusion source in the EVM environment

EVM

The EVM command is used to execute an EVM fusion source locally. The command can be invoked with the following command:

npx local-fusion-cli EVM [options]

| Option | Description | Type | Default | Required | | ------------------ | --------------------------------------------------- | ------- | ------------------------------------------- | -------- | | rpcUrl | EVM RPC URL (Websocket or HTTP) | string | N/A | true* | | blockchainType | Blockchain Type | number | N/A | true* | | parserFilePath | Absolute path to parser file (relative or absolute) | string | './src/parser.ts' | false | | parserConfigPath | File path to fusion parser config | string | N/A | false | | bcmUrl | Blockchain manager URL | string | N/A | false | | ephemeralUrl | Ephemeral storage URL | string | N/A | false | | persistentUrl | Persistent storage URL | string | N/A | false | | logOutput | Log output from parser | boolean | true | false | | blockTag | Block number or tag to execute parser at | number | 'latest' | false | | filter | Fusion filter to trigger parser execution | string | '{"contractAddresses":[],"topicHashes":[]}' | false |

Note: The rpcUrl and blockchainType options can be omitted, but only if the parserConfigPath option is provided. If the parserConfigPath option is provided, the fusion parser config will be used to determine the rpcUrl, blockchainType and other options. If the parserConfigPath option is not provided, the rpcUrl and blockchainType options must be provided.

Filter Types

At the heart of fusion lies a scheduling mechanism which detects when a parser should be executed. This is done by defining a filter which is used to determine whether a parser should be triggered by some on-chain event or not. The filter is defined as a string and is parsed by the fusion scheduler. The following filter types are supported:

| Filter Type | Type Definition | Description | Default | | ----------------- | ------------------------------------------------------ | -------------------------- | ----------------------------------------- | | EvmFusionFilter | {contractAddresses: string[], topicHashes: string[]} | TODO: Add description here | {contractAddresses: [],topicHashes: []} |

Supported Blockchains

Note:: Within fusion we refer to different Blockchains by their enum value in the BlockchainType enum. This list is subject to change as we add support for more blockchains, please verify by looking at the source code for the BlockchainType enum inside the @notifi-network/fusion-types package and the source code within this repo.

Below is a table of the support status for each supported blockchain, alongside their enums and the FilterType that is used to trigger parser execution.

| Blockchain Name | BlockchainType | FilterType | Status | | --------------- | -------------- | ----------------- | ----------- | | Ethereum | 3 | EvmFusionFilter | In Progress | | Polygon | 5 | EvmFusionFilter | In Progress | | Arbitrum | 6 | EvmFusionFilter | In Progress | | Bnb | 7 | EvmFusionFilter | In Progress | | Avalanche | 10 | EvmFusionFilter | In Progress | | Optimism | 12 | EvmFusionFilter | In Progress | | ZkSync | 16 | EvmFusionFilter | In Progress |

Additional Exports

Aside from exposing the CLI tool, this package also exports the lib directory which contains various helper functions, and the LocalEvmHost class which can be used to execute a fusion source locally in the EVM environment.

TODO's

  • [ ] Fix the npx command
  • [ ] Add better support for subscriptions: users should be able to provide a list of subscribed addresses AND/OR a real endpoint which serves the subscriptions.
  • [ ] Add a real storage layer to the local host environment - we can stub out calls to our admin GraphQL endpoints rather than using the real Storage interfaces.
  • [ ] Add support for other blockchains (incl. FilterTypes, host environments, etc.)