Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する
Command Reference

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.

FilesystemBlocklet CLIUserFilesystemBlocklet CLIUserblocklet server init"Are you sure to initialize? [y/N]"yGenerate server wallet (DID)Ask configuration questions (name, port, etc.)Provide answersCreate .abtnode directoryWrite .abtnode/k (encryption key)Write config.yml"Configuration is successfully generated!""Run 'blocklet start' to start the server."

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., purple-rain)

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.

8089

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.

/admin

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.

true

What's ip wildcard domain?

The domain used for accessing blocklets via IP address.

ip.abtnet.io

Where to download the wildcard certificate?

The URL to fetch wildcard certificates for HTTPS.

https://cert.abtnet.io

Max Upload File Size allowed by the server (MB)?

The maximum file size for uploads.

16 MB

Which http port do you want your service gateway to listen on?

The public-facing port for HTTP traffic.

80

Which https port do you want your service gateway to listen on?

The public-facing port for HTTPS traffic.

443

What is the max memory limit of Blocklet Server (GB)?

The maximum RAM allocated to the server daemon.

1.6 GB

What is the max memory limit of each Blocklet (GB)?

The default maximum RAM allocated to each blocklet instance.

0.6 GB

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

--force

Bypasses the confirmation prompt before initializing.

blocklet server init --force

--interactive

Ensures the command runs in interactive mode, even if other flags are present.

blocklet server init --interactive

--mode <mode>

Sets the node mode. Valid options are production or debug.

blocklet server init --mode debug

--https <boolean>

Sets the default for enabling HTTPS (true or false).

blocklet server init --https false

--http-port <port>

Sets the default HTTP port for the service gateway.

blocklet server init --http-port 8080

--https-port <port>

Sets the default HTTPS port for the service gateway.

blocklet server init --https-port 8443

--web-wallet-url <url>

Specifies the default web wallet URL.

blocklet server init --web-wallet-url https://wallet.example.com

--sk <key>

Initializes the server with a custom secret key instead of a random one.

blocklet server init --sk <your-secret-key>

Generated Files#

After running the command, two critical files are created:

  1. config.yml: The main configuration file for your Blocklet Server. It's a YAML file containing all the settings defined during the init process. You can manually edit this file later if needed.
  2. .abtnode/k: A binary file that holds the encryption key. This key is used to secure your server's wallet secret key (sk) stored inside config.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.