3.2.3 • Published 6 days ago

@notifi-network/local-fusion v3.2.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 days ago

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]
OptionDescriptionTypeDefaultRequired
rpcUrlEVM RPC URL (Websocket or HTTP)stringN/Atrue*
blockchainTypeBlockchain TypenumberN/Atrue*
parserFilePathAbsolute path to parser file (relative or absolute)string'./src/parser.ts'false
parserConfigPathFile path to fusion parser configstringN/Afalse
bcmUrlBlockchain manager URLstringN/Afalse
ephemeralUrlEphemeral storage URLstringN/Afalse
persistentUrlPersistent storage URLstringN/Afalse
logOutputLog output from parserbooleantruefalse
blockTagBlock number or tag to execute parser atnumber'latest'false
filterFusion filter to trigger parser executionstring'{"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 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 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.)
3.2.2

6 days ago

3.2.1

6 days ago

3.2.3

6 days ago

3.2.0

7 days ago

3.1.16

1 month ago

3.1.17

1 month ago

3.1.15

2 months ago

3.1.14

2 months ago

3.1.12

2 months ago

3.1.13

2 months ago

3.1.11

2 months ago

3.1.10

2 months ago

3.1.9-alpha.1

2 months ago

3.1.9-alpha.0

2 months ago

3.1.9

2 months ago

3.1.7

3 months ago

3.1.6

3 months ago

3.1.5

3 months ago

3.1.4

3 months ago

3.0.27

4 months ago

3.0.28

4 months ago

3.0.26

4 months ago

3.1.3

4 months ago

3.1.2

4 months ago

3.1.1

4 months ago

3.0.32

4 months ago

3.1.0

4 months ago

3.0.33

4 months ago

3.0.30

4 months ago

3.0.31

4 months ago

3.0.29

4 months ago

3.0.25

4 months ago

3.0.23

4 months ago

3.0.24

4 months ago

3.0.22

4 months ago

3.0.21

4 months ago

3.0.20

4 months ago

3.0.18

4 months ago

3.0.19

4 months ago

3.0.17

4 months ago

3.0.16

5 months ago

3.0.12

5 months ago

3.0.13

5 months ago

3.0.10

5 months ago

3.0.11

5 months ago

3.0.14

5 months ago

3.0.15

5 months ago

3.0.4

5 months ago

3.0.3

5 months ago

3.0.8

5 months ago

3.0.7

5 months ago

3.0.6

5 months ago

3.0.5

5 months ago

3.0.9

5 months ago

3.0.2

5 months ago

3.0.1

5 months ago

3.0.0

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

6 months ago

1.0.0

6 months ago