@blockflow-labs/cli
v2.0.3
Published
CLI tool for building blockflow pipelines
Downloads
101
Readme
BlockFlow Studio
BlockFlow is a cutting-edge data infrastructure platform that revolutionizes how you interact with on-chain data. Our platform enables seamless data transformation, streaming, and integration capabilities, supporting both real-time and historical data access.
With BlockFlow's robust command-line interface (CLI), you can unlock the platform's full potential. Focus on building innovative features for your Web3 application while we manage the complex backend infrastructure.
Installation
BlockFlow requires Docker and Node.js v18+ with TypeScript support.
npm i -g @blockflow-labs/cli
Verify your installation:
blockflow --version
Set up your BlockFlow credentials to get started. Find your credentials here.
blockflow configure
Project Initialization
Create a new project in an empty directory using the blockflow init
command. This launches an interactive setup wizard where you can either configure your project from scratch or build upon existing templates.
blockflow init
Configuration
BlockFlow Studio uses a YAML configuration file (studio.yaml
) in your project's root directory to manage settings. Here are the key configuration components:
| Configuration | Description |
| ------------- | ------------------------------------------------------------------------------ |
| Version
| Specifies the BlockFlow YAML template version (currently 2.0.0) |
| Type
| Determines the deployment mode: either instance
or api
|
| Metadata
| Contains your instance name and description |
| Auth
| Stores BlockFlow credentials required for deployment |
| Path
| Specifies locations of your docker-compose and studio.schema.ts files |
| Environment
| Defines settings for testing and deployment (network, chain, startBlock, RPCs) |
| Secrets
| Stores sensitive variables securely for runtime injection |
| Resources
| Specifies smart contracts for indexing or APIs built on indexed data |
Resources
The resources section lets you define multiple data sources from blockchain networks, smart contracts, or APIs. Each data source includes:
| Parameters | Description |
| ---------- | ------------------------------------------------------------------ |
| name
| Unique identifier for the data source |
| type
| Resource category specification |
| abi
| Location of the smart contract's ABI file for interface definition |
| address
| Data source's blockchain address |
| triggers
| Maps smart contract events/functions to their handler functions |
For detailed configuration information, visit our documentation.
Blockflow Commands
Validate your configuration:
blockflow validate
Generate event/function listings in studio.yaml
:
blockflow generate
Create handlers in your project:
blockflow codegen
Test locally using Docker with MongoDB and PostgreSQL:
blockflow test
Deployment
Deploy your tested project to the BlockFlow server:
blockflow deploy
Template Usage
Jump-start development using pre-built templates:
blockflow apply --template template-name
Available templates from the BlockFlow team:
| Template | Description |
| --------- | -------------------------------------------------------------- |
| ERC20
| Standard fungible token interface for Ethereum |
| ERC4337
| Account abstraction protocol for enhanced wallet functionality |
| ERC721
| Standard non-fungible token (NFT) interface for Ethereum |
| Lido
| Liquid ETH staking protocol with maintained liquidity |
| ENS
| Decentralized domain naming system for Ethereum |
For comprehensive details about BlockFlow Studio and its capabilities, explore our documentation.
Interested in contributing or exploring examples? We'd love your involvement! Star our examples repository.