CLI Tool
Command-line interface for managing tokens, keys, offers, invoices, and payments in the Fractal Engine
The Fractal Engine provides a comprehensive command-line interface (CLI) for managing tokens, keys, offers, invoices, and payments. The CLI tool (fecli) enables users to interact with the Fractal Engine, Balance Master, and Dogecoin nodes through an intuitive command-line interface.
Installation and Setup
See Installation for instructions on how to get the CLI tool.
Before using the CLI, you need to initialize your configuration:
./fecli init --config-path config.tomlThe init command will prompt you for:
- Fractal Engine host and port (default: localhost:8891)
- Balance Master host and port (default: localhost:8899)
- Dogecoin RPC connection details (scheme, host, port, username, password)
Configuration Management
Configuration File Format
The CLI uses a TOML configuration file with the following structure:
fractal_engine_host = "localhost"
fractal_engine_port = "8891"
balance_master_host = "localhost"
balance_master_port = "8899"
doge_scheme = "http"
doge_host = "localhost"
doge_port = "22556"
doge_user = "test"
doge_password = "test"
key_labels = ["mykey1", "mykey2"]
active_key = "mykey1"Environment Configuration
The CLI supports different blockchain environments:
- Mainnet: Production Dogecoin network
- Testnet: Dogecoin test network for development
- Regtest: Local regression test network
Configure your Dogecoin connection based on your target environment:
Mainnet Configuration
doge_scheme = "http"
doge_host = "localhost"
doge_port = "22555"Testnet Configuration
doge_scheme = "http"
doge_host = "localhost"
doge_port = "44555"Regtest Configuration
doge_scheme = "http"
doge_host = "localhost"
doge_port = "22556"Key Management
The CLI provides secure key management using the system keyring for private key storage.
Creating Keys
Generate a new cryptographic key pair for a specific blockchain:
./fecli keys create --config-path config.tomlThis command will prompt for:
- Label: A human-readable name for the key
- Chain: The target blockchain (mainnet, testnet, regtest)
The command generates:
- Private key (stored securely in system keyring)
- Public key (stored securely in system keyring)
- Dogecoin address (stored securely in system keyring)
Listing Keys
View all managed keys and their details:
./fecli keys list --config-path config.tomlOutput includes:
- Active key indicator (*)
- Key label/name
- Dogecoin address
- Public key
Setting Active Key
Change the currently active key for operations:
./fecli keys set --config-path config.tomlSelect from your available keys using the interactive list interface.
Token Management
Listing Token Balances
View your token balances for a specific mint:
./fecli tokens list --config-path config.tomlYou'll be prompted to enter the mint hash to query balances for.
Mint Operations
Creating New Tokens
Create a new token with custom parameters:
./fecli mints create --config-path config.tomlRequired information:
- Title: Token name/title
- Fraction Count: Total number of token fractions
- Description: Token description
The command will:
- Create the mint record on the Fractal Engine
- Generate a blockchain transaction
- Broadcast the transaction to the Dogecoin network
Listing Mints
View all tokens you've created:
./fecli mints list --config-path config.tomlDisplays:
- Mint hash (unique identifier)
- Title and description
- Fraction count
- Block height and transaction hash
- Creation timestamp
- Confirmation status
Trading Operations
Sell Offers
Creating Sell Offers
List tokens for sale:
./fecli sell-offers create --config-path config.tomlProcess:
- Select a token from your mints
- Specify quantity to sell
- Set price per fraction
Listing Sell Offers
View sell offers for a specific token:
./fecli sell-offers list --config-path config.tomlBuy Offers
Creating Buy Offers
Make offers to purchase tokens:
./fecli buy-offers create --config-path config.tomlProcess:
- Enter the mint hash
- Select from available sell offers
- Specify quantity and price
Listing Buy Offers
View your buy offers:
./fecli buy-offers list --config-path config.tomlInvoices
Creating Invoices
Generate invoices for token sales:
./fecli invoices create --config-path config.tomlProcess:
- Enter mint hash
- Select from buy offers
- Specify quantity and price
- Generate and broadcast invoice transaction
Listing Invoices
View invoices for a specific token:
./fecli invoices list --config-path config.tomlPayments
Paying Invoices
Pay outstanding invoices:
./fecli payments pay-invoice --config-path config.tomlProcess:
- Enter mint hash
- Select invoice to pay
- Confirm payment transaction
Health and Diagnostics
System Health Check
Check the status of the Fractal Engine:
./fecli health --config-path config.tomlDisplays:
- Blockchain network (chain)
- Current and latest block heights
- Wallet functionality status
- Last update timestamp
Command Reference
Global Flags
All commands support the --config-path flag:
--config-path config.tomlSpecifies the path to the configuration file (default: "config.toml").
Command Structure
fecli [command] [subcommand] [flags]Available Commands
| Command | Description |
|---|---|
init | Initialize configuration file |
keys | Key management operations |
health | Check Fractal Engine health |
mints | Token creation and management |
tokens | View token balances |
sell-offers | Manage sell offers |
buy-offers | Manage buy offers |
invoices | Invoice operations |
payments | Payment processing |
Key Commands
| Subcommand | Description |
|---|---|
keys create | Generate new key pair |
keys list | Display all keys |
keys set | Set active key |
Mint Commands
| Subcommand | Description |
|---|---|
mints create | Create new token |
mints list | List your tokens |
Trading Commands
| Subcommand | Description |
|---|---|
sell-offers create | Create sell offer |
sell-offers list | List sell offers |
buy-offers create | Create buy offer |
buy-offers list | List buy offers |
invoices create | Create invoice |
invoices list | List invoices |
payments pay-invoice | Pay invoice |
Security Features
Key Storage
- Private keys are stored in the system keyring (not in plain text files)
- Uses the
zalando/go-keyringlibrary for secure storage - Keys are associated with the service name "fractalengine"
Cryptographic Operations
- All transactions are cryptographically signed
- Payload signing uses the active private key
- Supports Dogecoin's cryptographic standards
Address Tracking
- New addresses are automatically tracked by Balance Master
- UTXO management for transaction creation
- Balance verification before operations
Troubleshooting
Common Issues
Configuration File Not Found
Error: Config file not foundSolution: Run fecli init to create a configuration file, or specify the correct path with --config-path.
Connection Errors
Error: Unable to connect to Fractal EngineSolutions:
- Verify Fractal Engine is running
- Check host and port in configuration
- Ensure network connectivity
Insufficient Balance
Error: No utxos found for addressSolutions:
- Ensure your address has Dogecoin balance
- Wait for Balance Master to sync
- Verify address is being tracked
Keyring Access Errors
Error: Failed to access keyringSolutions:
- Ensure system keyring is available
- Check user permissions
- Try recreating keys
Network-Specific Issues
Regtest Environment
For local development using regtest:
-
Ensure Dogecoin Core is running in regtest mode:
dogecoind -regtest -rpcuser=test -rpcpassword=test -
Generate initial blocks:
dogecoin-cli -regtest generate 101 -
Create and fund test addresses as needed
Testnet Environment
For testnet development:
- Use testnet configuration
- Obtain testnet DOGE from faucets
- Allow extra time for block confirmations
Debug Mode
Some commands may have debug modes or verbose output options. Check individual command help:
./fecli [command] --helpBest Practices
Key Management
- Use descriptive labels for keys to identify their purpose
- Backup key information securely outside the system keyring
- Use different keys for different environments (mainnet vs testnet)
Configuration Management
- Keep separate configs for different environments
- Use version control for configuration templates (without sensitive data)
- Validate configuration with
fecli healthafter changes
Transaction Management
- Verify balances before creating offers or payments
- Monitor transaction confirmations on the blockchain
- Keep transaction IDs for record-keeping
Development Workflow
- Start with regtest for local development
- Test on testnet before mainnet deployment
- Monitor logs for error messages and debugging information
For additional support and advanced usage scenarios, refer to the Fractal Engine documentation or community resources.