Initialize Server
The blocklet server init command initializes a new Blocklet Server instance by creating a dedicated configuration directory, .blocklet-server, in the current working directory. This directory contains the config.yml file and other necessary assets to run the server. The process can be executed interactively through a guided setup or non-interactively using command-line flags.
Usage#
To initialize a new server configuration, navigate to the desired directory and execute the following command:
Basic Initialization Command
blocklet server initExecuting this command without any flags will launch an interactive setup wizard to guide you through the configuration process.
Interactive Configuration#
When running in interactive mode, the CLI will prompt you for the necessary configuration details. The table below outlines each question, its description, and the default value provided.
Prompt | Description | Default Value |
|---|---|---|
Naming the server? | A human-readable name for your Blocklet Server instance. | A randomly generated name (e.g., |
Description of the server? | A brief description outlining the server's purpose. |
|
Which port do you want your server to listen on? | The internal port for the Blocklet Server daemon process. |
|
Choose routing engine | The routing provider to manage incoming traffic (e.g., Nginx). | Automatically detects existing providers like |
Where do you want to mount your admin dashboard? | The URL path for accessing the server's administrative interface. |
|
Which web wallet do you want to use? | The URL of the web wallet to be integrated with the server. | Varies by 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 for accessing blocklets via the server's IP address. |
|
Where to download the wildcard certificate? | The URL for fetching wildcard certificates for HTTPS support. |
|
Max Upload File Size allowed by the server (MB)? | The maximum file size permitted for uploads. |
|
Which http port do you want your service gateway to listen on? | The public-facing HTTP port for the routing engine. |
|
Which https port do you want your service gateway to listen on? | The public-facing HTTPS port for the routing engine. |
|
What is the max memory limit of Blocklet Server (GB)? | The maximum RAM allocated to the Blocklet Server daemon. |
|
What is the max memory limit of each Blocklet (GB)? | The maximum RAM allocated to each individual blocklet. |
|
Command Options#
The initialization process can be customized or automated using the following command-line options.
Option | Description |
|---|---|
| Initializes the server non-interactively, accepting all default values. This is useful for automated scripts. |
| An alias for |
| Sets the server's operational mode. Valid options are |
| Disables HTTPS support for the server. HTTPS is enabled by default. |
| Specifies the public-facing HTTP port for the service gateway, overriding the interactive prompt. |
| Specifies the public-facing HTTPS port for the service gateway, overriding the interactive prompt. |
| Provides a custom secret key to generate the server's wallet instead of creating a new random one. |
| Forces the command to run in interactive mode, even if other non-interactive flags are present. |
Non-Interactive Example#
To initialize a server without any prompts, use the -y flag. This command is ideal for scripting and automation.
Non-Interactive Initialization
blocklet server init -y --mode production --http-port 8080Generated Files#
Upon successful initialization, the following files and directories are created in the current working directory:
.blocklet-server/: The primary configuration directory for the Blocklet Server instance..blocklet-server/config.yml: The main configuration file in YAML format. It stores all the settings provided during setup, such as the server name, ports, routing information, and wallet details..blocklet-server/.sock: A file containing the encryption key used to secure the server wallet's secret key withinconfig.yml. This file is critical for wallet recovery and must be backed up securely.
Next Steps#
With the server configuration in place, the next step is to start the server. Proceed to the next section to learn how to start the Blocklet Server daemon.