server init
The blocklet server init command initializes a new Blocklet Server instance in the current directory. It creates a config.yml file and a directory for storing server data (.abtnode) after guiding you through an interactive setup process or by using command-line flags for automation.
This process sets up all the essential parameters for your server, including its name, network ports, and security credentials. For a deeper dive into the configuration file itself, see the Configuration guide.
Initialization Process#
The init command follows a straightforward sequence to configure your server. It first confirms the initialization directory, generates a unique digital identity (wallet) for the server, and then prompts for configuration details before writing the final config.yml file.
Interactive Initialization#
When you run blocklet server init without any flags, it launches an interactive wizard. The wizard will ask a series of questions to configure your server. Below is a list of the prompts you can expect.
Prompt | Description | Default Value |
|---|---|---|
Naming the server? | The human-readable name for your Blocklet Server instance. | A generated name (e.g., |
Description of the server? | A brief description of your server's purpose. | A generated description |
Which port do you want your server to listen on? | The main port for the Blocklet Server daemon. |
|
Choose routing engine | The routing provider to handle incoming traffic (e.g., Nginx). | The first available provider found |
Where do you want to mount your admin dashboard? | The URL path for accessing the server's admin dashboard. |
|
Which web wallet do you want to use? | The URL of the web wallet for DID Connect. | Varies based on environment |
Do you want to enable https support? | Enables or disables SSL/TLS for the dashboard and blocklets. |
|
What's ip wildcard domain? | The domain used for accessing blocklets via IP address. |
|
Where to download the wildcard certificate? | The URL to fetch wildcard certificates for HTTPS. |
|
Max Upload File Size allowed by the server (MB)? | The maximum file size for uploads. |
|
Which http port do you want your service gateway to listen on? | The public-facing port for HTTP traffic. |
|
Which https port do you want your service gateway to listen on? | The public-facing port for HTTPS traffic. |
|
What is the max memory limit of Blocklet Server (GB)? | The maximum RAM allocated to the server daemon. |
|
What is the max memory limit of each Blocklet (GB)? | The default maximum RAM allocated to each blocklet instance. |
|
Command Options#
For non-interactive or automated setups, you can provide configuration details using command-line flags. These options override the default values and will skip the corresponding interactive prompts.
Option | Description | Example |
|---|---|---|
| Bypasses the confirmation prompt before initializing. |
|
| Ensures the command runs in interactive mode, even if other flags are present. |
|
| Sets the node mode. Valid options are |
|
| Sets the default for enabling HTTPS ( |
|
| Sets the default HTTP port for the service gateway. |
|
| Sets the default HTTPS port for the service gateway. |
|
| Specifies the default web wallet URL. |
|
| Initializes the server with a custom secret key instead of a random one. |
|
Generated Files#
After running the command, two critical files are created:
config.yml: The main configuration file for your Blocklet Server. It's a YAML file containing all the settings defined during theinitprocess. You can manually edit this file later if needed..abtnode/k: A binary file that holds the encryption key. This key is used to secure your server's wallet secret key (sk) stored insideconfig.yml.
Example config.yml#
A typical configuration file generated by the init command will look like this:
node:
name: My ABT Node
description: A newly initialized Blocklet Server
mode: production
version: 1.16.29 # Current CLI version
sk: <encrypted-secret-key>
pk: <public-key>
did: <server-did>
port: 8089
secret: <randomly-generated-session-secret>
owner:
pk: ''
did: ''
ownerNft:
holder: ''
issuer: ''
routing:
provider: nginx
adminPath: /admin
headers:
X-Powered-By: '"Blocklet Server/1.16.29"'
maxUploadFileSize: 16
https: true
httpPort: 80
httpsPort: 443
wildcardCertHost: https://cert.abtnet.io
ipWildcardDomain: ip.abtnet.io
enableDefaultServer: false
enableIpServer: false
runtimeConfig:
daemonMaxMemoryLimit: 1638
proxyMaxMemoryLimit: 256
blockletMaxMemoryLimit: 614
didRegistry: https://did.abtnet.io
didDomain: did.abtnet.io
slpDomain: slp.abtnet.io
enablePassportIssuance: true
trustedPassports: []
webWalletUrl: https://web.abtwallet.io/
database:
engine: sqlite
blocklet:
port: 8089
initialize:
blocklets: []What's Next?#
With your server configuration in place, you are ready to launch it. The next step is to run the server daemon.
- Continue to the next command: server start