Configuration
Blocklet Server and its command-line interface (CLI) rely on two main types of configuration: the server's primary configuration file for a specific node, and the CLI's client-side settings for developer interaction.
Server Configuration (config.yml
)#
Every Blocklet Server instance is defined by a central configuration file, config.yml
. This file contains all essential settings, including the server's identity, network configuration, and data storage paths.
File Location#
The CLI automatically finds the config.yml
file by looking for a .blocklet-server
directory (or a legacy .abtnode
directory) in the current working directory and then searching upwards through parent directories. This allows you to run blocklet server
commands from anywhere within a project's subdirectories without needing to specify a configuration path.
This diagram illustrates how the CLI locates the configuration file when a command is run from a nested directory:
Core Parameters#
The following are key parameters you can define in your config.yml
file:
Key | Description |
---|---|
| The display name for your ABT Node. |
| A brief description of your ABT Node. |
| The secret key for the node's wallet. |
| The public key for the node's wallet. |
| The Decentralized Identifier (DID) of the node. |
| The absolute path where the node's data and blocklets are stored. |
| The domain name or IP address for accessing the node's dashboard. |
| The port number for the node's dashboard. |
| Set to |
| A secret string used for dashboard session management. |
| The public key of the node's owner. |
| The DID of the node's owner. |
| The starting port number for blocklet processes. Each blocklet will use an incremented port. |
| The URL of the blocklet registry where available blocklets are listed. |
Example config.yml
#
# Node config
node:
# Meta
name: 'ABT Node'
description: 'Container of official ArcBlock blocklets'
# Node wallet
sk: '0xf80939b4ff688cd148ceab330b451683d41bb616b259507ae3e96a1188706d367efeabbebdc0cb49bcf865c77a15993d87245b124bbc5125d2c3997437d1fda3'
pk: '0x7efeabbebdc0cb49bcf865c77a15993d87245b124bbc5125d2c3997437d1fda3'
did: 'zNKgjyuEWQQqfuJcAVruPRHUaDD1PzcsAjaD'
# Where to store ABT Node data
dataDir: /Users/username/.blocklet-server
# Node dashboard
domain: 192.168.1.2
port: 5554
https: false
# Node dashboard session secret
secret: 'a-very-strong-and-long-secret-string'
# Owner info
owner:
pk: ''
did: ''
blocklet:
# On which port should blocklet process listen on
port: 5555
# Where to fetch available blocklets
registry: https://blocklet.arcblockio.cn
CLI Client Configuration#
The CLI maintains its own configuration for interacting with blocklet stores and identifying you as a developer. These settings are managed with the blocklet config
command.
Management Commands#
blocklet config set <key> <value>
: Sets or updates a configuration key.blocklet config get <key>
: Retrieves the value of a specific configuration key.blocklet config list
: Displays all currently set CLI configurations.blocklet config unset <key>
: Deletes a configuration key (aliases:del
,delete
).
Configurable Keys#
Key | Description |
---|---|
| The URL of the Blocklet Store for uploading and managing blocklets. |
| The URL of the Blocklet Registry to fetch blocklets from. |
| The secret key used to authenticate with a Blocklet Store or Server. |
| Your developer DID, used to sign and identify your blocklets. |
| Your developer name, associated with your blocklet submissions. |
| Your developer email address. |
Usage Examples#
1. Set your developer info and store URL:
# Set the blocklet store you want to publish to
blocklet config set store https://store.blocklet.dev/
# Set your developer DID
blocklet config set developerDid zxxxxx...xxxxx
2. View a specific configuration:
blocklet config get store
3. List all current configurations:
blocklet config list
4. Remove a configuration:
blocklet config unset store
Managing Multiple Profiles#
The CLI supports multiple configuration profiles, allowing you to switch between different developer identities or stores easily. Use the --profile
option to specify a profile name. If not specified, the default
profile is used.
# Set the store for a 'work' profile
blocklet config set store https://work.store.dev/ --profile work
# List the configurations for the 'work' profile
blocklet config list --profile work
With your server and CLI configured, you are ready to manage your server and develop blocklets. For a detailed list of all commands, see the Command Reference.