1.0.6 • Published 4 days ago

@blockflow-labs/cli v1.0.6

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

blockflow-cli

This is a CLI extension to the blockflow's IFTTT pipeline creation

Installation

To install the CLI extension, you can use the following command:

npm i -g @blockflow-labs/cli

Usage

Once the CLI extension is installed, you can use the following commands.

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

Before using other commands mentioned below, update the studio.yaml file with your authenticationId from app.blockflow.network under userId and startBlock for your project.

Instance

Generate Events List

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

blockflow instance-generate

Generate Handlers

To generate an trigger handlers fromstudio.yaml, use the blockflow instance-codegen command. The handler will be generated at the config.?handler path with the folder name as config.?name.

blockflow instance-codegen

Test the Code

It is required that you have a mongo db local running at uri "mongodb://localhost:27017"

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_TEST_DB

blockflow instance-test

Deploy the Project

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

List of all user instances

To get a list of all user instances, use the blockflow instances-list command. You can specify the network with the -network option.

blockflow instances-list -network <network>

API

Generate API

To generate an API, use the blockflow api-generate command. This command will update the studio.yaml file with api fields

blockflow api-generate

Generate API Code

To generate API code, use the blockflow api-codegen command. it will generate the handler at path specified under studio.yaml under api.handler

blockflow api-codegen

Deploy API

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

blockflow api-deploy

Get API Info

To get information about a specific API, use the blockflow api-info command. You need to specify the API ID with the -apiId option.

blockflow api-info -apiId <apiId>

CLI Parameters

The CLI commands accept various parameters to customize their behavior. Here are some of them:

  • blockflow instance-test accepts -path to specify the DB output path, -retry to specify the total retries to check for logs, and -startBlock to specify the start block number for testing.
  • blockflow instance-deploy does not accept any additional parameters.
  • blockflow instances-list accepts -network to specify the network.
  • blockflow api-info accepts -apiId to specify the API ID.
1.0.6

4 days ago

1.0.6-beta

8 days ago

1.0.6-beta-1

8 days ago

1.0.5

1 month ago

1.0.4

4 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.0.9-beta

5 months ago

0.0.9

6 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago