Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@notifi-network/local-fusion-cli

Package Overview
Dependencies
Maintainers
7
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@notifi-network/local-fusion-cli

This package contains the tooling required to execute a Notifi fusion source locally on a developer machine. The MVP of this tool will be focused on the execution of various fusion sources inside the [https://github.com/notifi-network/notifi-utils/tree/ma

  • 1.0.0
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
7
Weekly downloads
 
Created
Source

Local Fusion

This package contains the tooling required to execute a Notifi fusion source locally on a developer machine. The MVP of this tool will be focused on the execution of various fusion sources inside the [https://github.com/notifi-network/notifi-utils/tree/main/Docker-DevEnv](dev container environments).

Usage

Note: This package is not yet published to npm. To use it, you will need to clone the repo and run npm link in the root directory. Additionally, 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. 'run' - Executes a fusion source in the EVM environment

RUN PARSER

The RUN PARSER command is used to execute a fusion parser source locally inside a stubbed out host environment. The command can be invoked with the following command:

npx local-fusion-cli run:parser [options]

Note:: The parser file path can be absolute or relative to the current working directory

OptionDescriptionTypeDefaultRequired
rpcUrlRPC URLstringN/Atrue
parserFilePathAbsolute path to parser filestring'./src/parser.ts'false
blockTagBlock number or tag to execute parser atnumber | 'latest''latest'false
blockchainTypeBlockchain typeBlockchainTypefalse
filterFusion filter to trigger parser executionstringfalse
logOutputLog output from parserbooleantruefalse

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 TypeType DefinitionDescriptionDefault
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 NameBlockchainTypeFilterTypeStatus
Ethereum3EvmFusionFilterIn Progress
Polygon5EvmFusionFilterIn Progress
Arbitrum6EvmFusionFilterIn Progress
Bnb7EvmFusionFilterIn Progress
Avalanche10EvmFusionFilterIn Progress
Optimism12EvmFusionFilterIn Progress
ZkSync16EvmFusionFilterIn Progress

Additional Exports

Aside from exposing the CLI tool, this package also exports various utilities that can be consumed and used to test parser sources in your own code. In particular the createLocalHost factory function can be used to create a local host environment that can be used to execute parser sources.

TODO's

  • Integrate into the dev container environments created with existing Docker-DevEnv tooling
  • Fix the npx command
  • Use the real fusion RPC client(s) rather than a stubbed out one - this will require some refactoring of the fusion RPC client(s) to make them public facing. This should be optional and enabled by passing a bcmEndpoint option to the CLI tool. Additional work will need to be completed to enable this, including the creation of a local BlockchainManager environment which stubs out the calls to the real blockchain rather than the rpc proxies.
  • 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.)

FAQs

Package last updated on 28 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc