GithubHelp home page GithubHelp logo

boiler-plate's Introduction

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.

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

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

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

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.

blockflow instance-deploy

API

Deploy API

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

blockflow api-deploy

boiler-plate's People

Contributors

pradyuman-verma avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.