config-default.yaml
Overview
config-default.yaml serves as the default configuration file for the system's core networking, storage, security, and contract interaction parameters. It specifies connection endpoints, database paths, cryptographic keys, token lifetimes, and contract metadata required for the operation of the block manager and related components.
This YAML file primarily defines key-value pairs for service URLs, security credentials, and contract interfaces that other parts of the system load at startup or runtime to configure various modules.
Configuration Entries and Their Purpose
Network Endpoints
bk_api_endpoint
Defines the HTTP API endpoint URL for the block manager service.Example:
http://127.0.0.1:11000Usage: Used by clients or internal modules to send API requests.
bk_stream_blocks_endpoint
Specifies the HTTPS endpoint for streaming block data.Example: https://node0:12000
Usage: Used for receiving or subscribing to streaming blockchain data.
api_listen_addr
The address and port on which the Block Manager API listens.Example:
0.0.0.0:8600Usage: Binding address for incoming API connections.
default_bp
Default block producer endpoint address.Example: node0:8600
Usage: Used as a fallback or default node for block production interactions.
Storage Path
db_path
Local filesystem path to the SQLite database file.Example:
./dataUsage: Used for persistent storage of blockchain or block manager data.
Security and Authentication
bm_owner_wallet_pubkey
Public key of the block manager owner's wallet.Example:
e2c9d4be54d342d3f0e6394a7738fc39b93d4fe3fdba317aa699f7305566de2bUsage: Used for verifying ownership or signing authority in cryptographic operations.
keys
Path to the JSON file containing block manager signing keys.Usage: Used for cryptographic signing of transactions or messages.
token_ttl
Token time-to-live expressed in seconds.Example:
30Usage: Defines the validity period for issued tokens controlling session or API access.
Contract Metadata
The contracts section defines local contract configurations that the system interacts with:
bm_root
Contains the blockchain address and ABI file path for the Block Manager root contract.address: Blockchain address string, e.g.,0:6666666666666666666666666666666666666666666666666666666666666666abi: Relative file path to the contract ABI JSON file, e.g.,
../contracts/bksystem/BlockManagerContractRoot.abi.jsonUsage: Used for contract calls or event decoding for the root contract.
license
Contains the ABI file path for the LicenseBM contract.abi: Relative file path to the ABI JSON, e.g.,
../contracts/bksystem/LicenseBM.abi.jsonUsage: Used to interface with the license contract for license validation or management.
Important Implementation Details
The file uses YAML syntax for hierarchical key-value mappings.
Relative paths (e.g., contract ABI files and key files) are used to locate resources, which implies the file must be placed or referenced from the correct working directory.
Cryptographic keys and wallet public keys are stored as strings, which are critical for authentication and transaction signing processes.
Token TTL is a short duration (30 seconds), which suggests tokens are ephemeral and require frequent renewal or reauthentication.
The contract section supports extensibility by allowing multiple contract definitions, each with its own address and ABI.
Interaction with Other System Parts
The configuration parameters are loaded by the block manager service and possibly other blockchain-related modules at initialization.
Network endpoints configure API clients and servers facilitating communication between nodes and services.
Database path is accessed by persistence layers managing blockchain data storage.
Security keys are used by cryptographic modules to sign and verify transactions and messages.
Contract ABIs and addresses enable smart contract interaction modules to encode/decode calls and listen to events, linking on-chain contracts with off-chain logic.
Visual Diagram of config-default.yaml Structure
flowchart TD
A[config-default.yaml]
A --> B[Network Endpoints]
A --> C[Storage Path]
A --> D[Security & Authentication]
A --> E[Contracts]
B --> B1[bk_api_endpoint]
B --> B2[bk_stream_blocks_endpoint]
B --> B3[api_listen_addr]
B --> B4[default_bp]
C --> C1[db_path]
D --> D1[bm_owner_wallet_pubkey]
D --> D2[keys]
D --> D3[token_ttl]
E --> E1[bm_root]
E --> E2[license]
E1 --> E1a[address]
E1 --> E1b[abi]
E2 --> E2a[abi]
This diagram illustrates the main configuration categories and their key entries in the file. It shows the hierarchical structure and relationships between configuration elements.