1.0.10 • Published 9 months ago

@blockflow-labs/cli v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

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:

ConfigurationDescription
nameThis is the name of your project.
descriptionA brief description of what your project does.
startBlockThe 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.
userIdUnique identifiers for your Blockflow user account.
projectIdUnique identifiers for your Blockflow project.
networkThe blockchain network you’re working with.
userThe Blockflow username associated with your account.
schemaIt contains a file path to your database schemas.
executionIt tells our system how to run the indexing process over the specified block range. You can choose between “parallel” or “sequential” execution.
resourcesThis 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:

ResourcesDescription
NameThe name of the source data.
AbiThe path to the smart contract's ABI file. The ABI defines the contract’s interface and is used to interact with it.
TypeThe type of resource.
AddressThe address of the source data.
TriggersIt 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 instudio.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.

TemplateDescription
ERC20A standard interface for fungible tokens on the Ethereum blockchain.
ERC4337A standard for account abstraction, enabling smart contract wallets and improved user experience.
ERC721A standard interface for non-fungible tokens (NFTs) on the Ethereum blockchain.
LidoA liquid staking solution for Ethereum, allowing users to stake ETH while maintaining liquidity.
ENSEthereum 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.

1.0.10

9 months ago

1.0.10-beta.2

10 months ago

1.0.10-beta.1

11 months ago

1.0.10-beta.3

10 months ago

1.0.9

11 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.7-beta.5

12 months ago

1.0.9-beta.1

11 months ago

1.0.8-beta.1

12 months ago

1.0.7-beta.1

1 year ago

1.0.7-beta.2

1 year ago

1.0.7-beta.3

1 year ago

1.0.7-beta.4

12 months ago

1.0.8-beta.5

12 months ago

1.0.8-beta.4

12 months ago

1.0.8-beta.3

12 months ago

1.0.8-beta.2

12 months ago

1.0.6

1 year ago

1.0.6-beta

1 year ago

1.0.6-beta-1

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.9-beta

1 year ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago