Giter Club home page Giter Club logo

quick-query-blockchain-data's Introduction

Getting Started with Create Blocklet

This project was bootstrapped with Create Blocklet.

This blocklet is a static project, which means this is a frontend application. It's contained client code.

File Structure

  • public/ - static files
    • favicon.ico - favicon
    • favicon.svg - favicon
    • index.html - main html file, template for react
  • screenshots/ - Screenshots
  • src/ - Client side code (A standard react app structure)
  • tools/ - Tools
    • publish.sh - Scripts for github CI
  • .env - Environment variables
  • .env.local - Local environment variables
  • .eslintrc.js - ESLint configuration
  • .gitignore - Git ignore file
  • .prettierrc - Prettier configuration
  • blocklet.md - Blocklet README
  • blocklet.yml - Blocklet configuration
  • LICENSE - License file
  • logo.png - Blocklet logo file
  • Makefile - Makefile
  • package.json - Npm package file
  • README.md - A guide for this blocklet
  • version - Version file

Development

  1. Make sure you have @abtnode/cli installed

    Blocklet needs abtnode as a dependency. So you need to install it first.
    npm install -g @abtnode/cli
    See details in https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#use-the-binary-distribution

  2. Init abtnode & start abtnode

    Before starting an abtnode, you need to init abtnode.
    abtnode init --mode=debug
    abtnode start
    See details in https://docs.arcblock.io/abtnode/en/introduction/abtnode-setup#configure-abt-node

  3. Go to the project directory cd [name]

  4. Install dependencies: npm install or yarn

  5. Start development server: blocklet dev

Bundle

After developing a blocklet, you may need to bundle it. Use npm run bundle command.

Deploy

  • If you want to deploy this blocklet to local abtnode, you can use blocklet deploy .blocklet/bundle command(Make sure the blocklet is bundled before deployment.)

    Or you can simply use npm run deploy command.

  • If you want to deploy this blocklet to remote abtnode, you can use the command below.

    blocklet deploy .blocklet/bundle --endpoint {your abtnode url} --access-key {abtnode access key} --access-secret {abtnode access secret}

    Make sure the blocklet is bundled before deployment.

Publish

  • If you want to publish the blocklet to any registry for other users to download and use, you can following the following instructions.

    Bump version at first.

    make bump-version

    Get a developer-sk by using this command.

    Why we need a developer-sk?
    A developer-sk means we have a self-signed key, which help us publish our blocklet to any registry.

    blocklet developer:init

    Then config registry publish url to a blocklet registry

    You can use those registry url in below.

    1. https://registry.arcblock.io/
    2. https://dev.registry.arcblock.io/
    3. A blocklet registry started by yourself.

      Make sure you have installed a blocklet registry on your own abtnode. Check it on here: https://registry.arcblock.io/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ

    blocklet config registry {registry url}

    Release a new version to a registry.

    Make sure the blocklet is bundled before publish.

    blocklet publish

    Or you can simply use npm run release command.

  • You also can publish a new version to a registry by Github CI.
    Bump version at first.

    make bump-version

    Push your code to Github main/master branch, or make a pull request to the main/master branch.
    The CI workflow will automatically publish a new version to a registry.

Q & A

  1. Q: How to change a blocklet's name?

    A: Change the name field in the package.json file, change the name field in the blocklet.yml file.

    You can also change the title field and description field in the blocklet.yml file.

    Run blocklet meta command, you will get a did config, copy the did value.

    Replace this command "bundle": "PUBLIC_URL='/.blocklet/proxy/{did}' npm run build", in package.json

    Replace did field in the blocklet.yml

  2. Q: How to change a blocklet's logo?

    Change the logo.png file root folder.

    Or you can change the logo field in the blocklet.yml file.

    Make sure you have added the logo path to the blocklet.yml file files field.

Learn More

License

The code is licensed under the Apache 2.0 license found in the LICENSE file.

quick-query-blockchain-data's People

Contributors

chachaxw avatar

Watchers

James Cloos avatar  avatar  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.