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

@blockflow-labs/cli

v1.0.10

Published

CLI tool for blockflow pipelines

Downloads

109

Readme

BlockFlow Studio

Build Status

Blockflow is a state-of-the-art data infrastructure platform that simplifies how you access and utilize on-chain data. With Blockflow, you can effortlessly transform, stream, and integrate data to meet your specific needs, whether you require real-time or historical data.

Blockflow's powerful command-line interface (CLI) allows you to harness the full potential of the platform, enabling you to focus on developing groundbreaking features for your Web3 application while we handle the complexities of the backend.

Installation

Blockflow requires Node.js v18+ to run with typescript enabled.

npm i -g @blockflow-labs/cli

To verify that the CLI extension has been installed correctly

blockflow --version

Configure your cli with blockflow credentials to get started. Check this.

blockflow configure

Project Initialization

To initialize a project in an empty directory, use the blockflow init command. This will open a command prompt where you can configure your project interactively.

blockflow init

Configuration

BlockFlow Studio uses a YAML configuration file to manage your project settings. The configuration file should be named studio.yaml and located in the root folder of your project. Here are the configuration options:

| Configuration | Description | | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | name | This is the name of your project. | | description | A brief description of what your project does. | | startBlock | The block number from which you want to start indexing. You can specify a specific block number or use latest to start from the most recent block. | | userId | Unique identifiers for your Blockflow user account. | | projectId | Unique identifiers for your Blockflow project. | | network | The blockchain network you’re working with. | | user | The Blockflow username associated with your account. | | schema | It contains a file path to your database schemas. | | execution | It tells our system how to run the indexing process over the specified block range. You can choose between “parallel” or “sequential” execution. | | resources | This section defines the smart contracts you want to index. |

Resources

Within the resources section, you can define one or more data sources, each representing a specific blockchain network or smart contract. For each data source, you can provide the following details:

| Resources | Description | | ---------- | ------------------------------------------------------------------------------------------------------------------------ | | Name | The name of the source data. | | Abi | The path to the smart contract's ABI file. The ABI defines the contract’s interface and is used to interact with it. | | Type | The type of resource. | | Address | The address of the source data. | | Triggers | It contains an array of configurations linking smart contract events/functions to their corresponding handler functions. |

To read more about studio.yaml configuration. Check this doc.

Blockflow Commands

To generate an events/functions list in studio.yaml, which will be used to configure the handler, use the blockflow generate command. This will automatically fetch the added contracts ABIs and update the events/functions list.

blockflow generate

To generate handlers in studio.yaml, use the blockflow codegen command. The handler will be generated at the Resources?.Trigger?.Handler path.

blockflow codegen

Instance Testing

To test the code and generate a local mongo database, use the blockflow instance-test command. This will produce a database named blockflow_studio with collection name BLOCKFLOW_STUDIO.

blockflow instance-test

you can even provide a start block --startBlock <startBlock>, or range of blocks to test --range 10

Deploy Instance

Once the project is created and tested, you can deploy it using the blockflow instance-deploy command. This will deploy the handler to the blockflow server for syncing.

blockflow instance-deploy

API Testing

You can create Rest API endpoints to access data filled in your database through Blockflow instances. To test API you need to ensure your local MongoDB is running and filled with instance data.

blockflow api-test

Deploy API

To deploy the API, use the blockflow api-deploy command.

blockflow api-deploy

Using Existing Template

To use existing template and to build over it, use the blockflow template --apply template-name command.

blockflow apply --template template-name

These are our some pre-built templates maintained by team blockflow.

| Template | Description | | --------- | ------------------------------------------------------------------------------------------------- | | ERC20 | A standard interface for fungible tokens on the Ethereum blockchain. | | ERC4337 | A standard for account abstraction, enabling smart contract wallets and improved user experience. | | ERC721 | A standard interface for non-fungible tokens (NFTs) on the Ethereum blockchain. | | Lido | A liquid staking solution for Ethereum, allowing users to stake ETH while maintaining liquidity. | | ENS | Ethereum Name Service, a distributed, open naming system based on the Ethereum blockchain. |

For more detailed information about BlockFlow Studio and its features, please refer to our comprehensive documentation.

Want to contribute or see interesting example? Great! Star mark this examples repo.