Introduction to ArcBlock Blocklet
2019-09-16
What are blocklets?
Blocklets are reusable building blocks to help developers and community users to build things on ArcBlock platform. On its simplest level, Blocklets are ready-made components and modules, libraries, front-end views, and more that make it very simple to start building a dApp. Simply pick the Blocklet you need to start and install it instantly to get yourself up and running. One of the key features of Blocklets is that it is very easy to combine multiple blocklets to build a more complex application or dApp.
Blocklets come in different packages depending on their use case including, but not limited, to the following:
- A starter template, from which a developer can bootstrap an dapp already connected to forge-powered blockchain within minutes;
- A full-featured dApp, with which a miner or community user can install and get it up and running quickly;
- A smart contract, which defines the on-chain pipeline of a business logic and can be deployed to forge-powered chains with one click;
- Web components or services to support ABT Blockchain Nodes
- Azure, AWS or other cloud-ready samples
- and more
Blocklets will come in 3 flavors to start - official, partner and community versions.
What is blocklet registry?
To help developers to find usable blocklets more easily, all blocklets built by ArcBlock and community developers are listed on blocklet.arcblock.io, which is a website built from ArcBlock/blocklets, users can search and view listed blocklets and use the blocklet with just one command, this website is called the blocklet registry.
How do define a blocklet?
There are several key piece of information to make a blocklet:
KeyInfo: blocklet.json
This is the key file when defining a blocklet, may contain the following fields:
KeyInfo: blocklet.md
A detailed introduction to the blocklet, should clearify the following questions for a potential user to the blocklet:
- What the blocklet can do after installation? Though can be inferred from it's group, but worth a few words of description
- What are the requirements to use this blocklet? Including hardware, software, developer experience and skills
- What problems may users encounter when use the blocklet? and how to resolve them?
KeyInfo: logo.png
The logo of the blocklet, can be any valid image, png recommended, will be displayed on blocklet detail page, should be a 200px x 200px transparent image.
KeyInfo: screenshots
The screenshots folder should contain several images of what's the output of the blocklet so that users can easily grasp the idea behind the blocklet.
Other Info
Including scripts that run during the process.
Meta Info Resolving
To avoid duplicate fields defined in package.json
, some fields can be omitted from blocklet.json
, and the build process is smart enough to merge those fields together.
How to create a blocklet?
Initialize a blocklet config with forge blocklet:create
, will be supported soon in forge-cli
.
- How to create a starter blocklet?
- How to create a dapp blocklet?
- How to create a contract blocklet?
How to publish a blocklet?
- Create your blocklet and make sure it's working
- Fork this repository
- Change
registry.yml
to include your repo - Send a pull request to this repository
- Your blocklet is listed on official registry once your pull request is accepted and merged