The following only lists the configurations that developers need to care about. For the complete documentation, see github.com/blocklet/blocklet-specification

did: z8iZrkWYbi3JU3AP9NHJQbBUdrgiRbeorauqf # Blocklet DID
name: example # Human readable Blocklet ID, did derived from name. To define the application name please use title
version: 1.0.0 # Blocklet version number
title: Example APP # application name
description: App Description # App description
logo: logo.png # application logo file
files: # Which files need to be packaged into the bundle
  - logo.png
  - screenshots
  - hooks
screenshots: # Picture introduction, which will be displayed on the store's introduction page
  - 0.png
  - 1.png
  - 2.png
scripts: # Blocklet hook directive
  dev: npm run start # The command actually executed when `blocklet dev` is executed
  preInstall: node hooks/pre-install.js # hooks before installation
  preDeploy: node hooks/pre-deploy.js # pre-deployment hooks (install `blocklet deploy` in deployment mode)
  postInstall: node hooks/post-install.js # hook after installation
  preStart: node hooks/pre-start.js # hook before startup
  preStop: node hooks/pre-stop.js # hook before stop
  preUninstall: node hooks/pre-uninstall.js # Hook before deletion
timeout:
  start: start timeout
payment: # Blocklet Price
  price: # can specify multiple currencies
    - address: z35n6UoHSi9MED4uaQy6ozFgKPaZj2UKrurBG # token address
      value: 8 # price
  share: # share
    - name: Bob # account alias
      address: z1QUDFzp6wKhLFjV4sG1ACY3J3ePcknrviy # Account DID
      value: 0.7 # split ratio
    - name: Store # Account alias
      address: zNKr4EeqcMk4W4TpBYD7MzGj6UEua53vJFx1 # Account DID
      value: 0.3 # split ratio
interfaces: # Blocklet access interface (most of the following configurations do not need to be concerned, just focus on the auth configuration)
  - type: web # access interface type
    services:
      - name: auth # Auth service for this access interface
        config:
          whoCanAccess: all # Who can access
          blockUnauthenticated: false # Whether to automatically intercept unauthenticated requests and jump to the login page
          blockUnauthorized: false # Whether to automatically intercept unauthorized requests
          allowSwitchProfile: true # Whether to support switching profiles
          profileFields: # Information to provide when logging in
            - fullName
            - email
            - avatar
          ignoreUrls: [] # Which interfaces allow any request to access
    protocol: http # access interface type
    name: publicUrl # usually does not need to be modified
    port: BLOCKLET_PORT # Environment variable for receiving port (port number is generated by Blocklet Server)
    path: / # Default prefix when Bloclet receives requests
    prefix: '*' # Blocklet is mounted prefix
environments: # runtime environment variables
  - name: key # variable name
    description: xxxx # variable description
    default: '' # default value
    required: false # Is it required
    secure: false # Whether it is sensitive information
    shared: true # Is it public. Defaults to true, shared must be false when secure is true
requirements:
  server: '>=1.8.0' # server version constraints
  os: '*'
  cpu: '*'
  fuels: # Fuel needed before starting (token)
    endpoint: xxx # The address of the chain
    address: xxx # token address
    value: xxx # price
    reason: xxx # The reason for the need (for example, because the NFT Factory needs to be created before the first boot)
capabilities:
  clusterMode: false # Can blocklet be started in cluster mode
  component: true # Can blocklet become a component and be composed by other blocklets
children: # Usually no manual maintenance is required, it can be maintained through `blocklet add/remove`
  - name: xxx # Human readable ID (required)
    source: # installation source
      # install via url
      url: xxx
      # install via store
      store: xxx # store address
      name: xxx # Blocklet ID
      version: xxx # Blocklet version
    mountPoint: /path/to # mount point
    title: xxx # name
    description: xxx # description
navigation: # navigation information (app map)
  - title: xxx name
    # link to a url
    link: xxx
    # link to child component
    child: xxx # child name or child did
    section: # where I want to show
      - header
      - footer
    icon: mdi:home # icon
theme: # theme
  background: "#f5f5f5" # background color
copyright: # Copyright information
  owner: Arcblock # owner
  year: 2022 # If not written, take the current year

Configure Navigation

A more complete example: Component Demo

i18n support

title: xxx

or

title:
en: xxx
en: xxx
navigation:
- title: a # appears in the header (default)
- title: c
section: footer # only in footer
- title: d
section: # both in header and footer
      - header
      - footer
- title: e
section: social # in footer's social media
- title: f
section: bottom # at the bottom of the footer

show icon

navigation:
- title: a
icon: mdi:home # iconify style
- title: a
icon: 'https://xxx' # url
- title: b
icon: '/path/to/xxx' # icon serve in app
copyright:
owner: xxx
year: xxx # If not written, take the current year

Different backgrounds

background: xxx

or

background:
header: xxx
footer: xxx
default: xxx

Configure Children Source

children:
  - name: c1
    mountPoint: /c1

    # source has two types

    # 1. url: equivalent to the previous resolved, can be any bundle url, no need to serve in the store, such as
# can serve in a github release, or in a local disk
    source:
      url:
- https://store.blocklet.dev/api/blocklets/z8ia4e5vAeDsQEE2P26bQqz9oWR1Lxg9qUMaV/blocklet.json
- file:///Users/wangshijun/Develop/arcblock/nft-store/.blocklet/release/blocklet.json
  - name: c2
    mountPoint: /c2
    # 2. The bundle served in the store can control the version: you can specify the latest version (default) or a fixed version. Later, if necessary, it can support more forms `^x.x.x`, `~x.x.x`, etc.
    # Because the store is decentralized, you need to specify the store
    source:
      store: https://store.blocklet.dev
      name: static-demo # bundle name
      version: latest # latest, 1.3.0
  - name: c3
    mountPoint: /c3
    # url can be set to one or more, when the first url is abnormal, it can be downgraded to the following url
    source:
      url:
        - <primary url>
        - <redundant url>

Configure required resources and operating environment restrictions

Specify the minimum Blocklet Server version

requirements:
   server: '>=1.8.0' # server version must be greater than or equal to 1.8.0

Specify the fuel needed before starting (token)

requirements:
   fuels:
     endpoint: xxx # The endpoint of the chain
     address: xxx # token address
     value: xxx # price
     reason: xxx # The reason for the need (for example, because the NFT Factory needs to be created before the first boot)