Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions Avoscan/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ITS_A_SECRET=shhhhh
5 changes: 5 additions & 0 deletions Avoscan/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
build
dist
.env
.prettierrc
3 changes: 3 additions & 0 deletions Avoscan/.studioignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/**
.env
build/**
95 changes: 95 additions & 0 deletions Avoscan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# BlockFlow Studio

This is your BlockFlow Studio project.

## Configuration (studio.yaml)

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:

- `name`: The name of your BlockFlow project.

- `description`: A description of your BlockFlow project.

- `startBlock`: The starting block number from which the instance

- `network`: The blockchain network you are working with (e.g., Ethereum, Polygon).

- `userId`: You blockflow account userId. (For auth)

- `execution`: Whether the execution of instances should be 'parallel' or 'sequencial'.

- `Resources`: An array of configs. Each config is specific to trigger type.

- `name`: The name of the contract. (should be camelcase without any spaces)

- `contract`: The contract address to sync. (should be in string format)

- `events`: The event signature. (generated by studio create command)

- `abi`: The path to the ABI file for the contract. (should end with `.json`)

- `handler`: The path to the code Handler file.

## How to Use BlockFlow Studio

### 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.

```bash
blockflow init
```

Before using other commands mentioned below, update the `studio.yaml` file with `userId`, `projectId` 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.

> writes to studio.yaml file, should be used with care, we prefer to use it once you init the project

```bash
blockflow generate
```

#### Generate Handlers

To generate an events handler in` studio.yaml`, use the `blockflow instance-codegen` command. The handler will be generated at the `Resources?.Trigger?.Handler` path.

> Once you've everything ready for instances or apis use this command

```bash
blockflow codegen
```

#### Test the Code

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

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

```bash
blockflow instance-test
```

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

#### 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.

```bash
blockflow instance-deploy
```

### API

#### Deploy API

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

```bash
blockflow api-deploy
```
Loading