Advanced Configuration
This guide covers advanced features and configuration options for Merobox.
Overview
Merobox provides several advanced configuration options organized into specialized areas:
- Environment Variables - Configure Merobox behavior and Docker settings
- Docker Image Management - Manage Docker images and containers
- Network Configuration - Basic network setup and port management
- Authentication Service Integration - Auth service configuration
- Workflow Advanced Features - Conditional execution and parallel steps
- Testing Framework Integration - Basic testing configuration
- Resource Management - Basic resource limits and monitoring
- Security Configuration - Basic security settings
Quick Reference
Common Configuration Patterns
# Basic workflow configuration
nodes:
count: 3
image: ghcr.io/calimero-network/merod:latest
chain_id: testnet-1
prefix: calimero-node
CLI Configuration
# Core configuration
merobox run --count 3 --image ghcr.io/calimero-network/merod:edge
# Network settings
merobox run --count 3 --base-port 3000 --base-rpc-port 4000
Configuration Best Practices
1. Environment-Specific Configuration
Use different configurations for different environments:
# Development
development:
nodes:
count: 2
image: ghcr.io/calimero-network/merod:edge
# Production
production:
nodes:
count: 5
image: ghcr.io/calimero-network/merod:latest
2. Resource Planning
Plan resources based on your workload:
- CPU: 0.5-2.0 cores per node depending on workload
- Memory: 1-4GB per node for typical applications
- Storage: 10-100GB depending on data requirements
- Network: Consider bandwidth and latency requirements
3. Security Considerations
Implement security best practices:
- Use non-root users
- Enable read-only filesystems where possible
- Drop unnecessary capabilities
- Implement network segmentation
- Use secrets management
- Enable audit logging
4. Monitoring and Observability
Set up basic monitoring:
# Basic monitoring
monitoring:
enabled: true
metrics:
- cpu_usage
- memory_usage
- disk_usage
- network_io
Troubleshooting Advanced Issues
Debug Mode
Enable comprehensive debugging:
# Enable debug logging
export LOG_LEVEL=DEBUG
# Run with verbose output
merobox bootstrap run workflow.yml --verbose
# Enable Docker debug
export DOCKER_BUILDKIT=0
export DOCKER_CLI_EXPERIMENTAL=enabled
Performance Profiling
Profile Merobox performance:
# Monitor resource usage
docker stats $(docker ps -q --filter "name=calimero-")
# Analyze logs
merobox logs calimero-node-1 | grep -E "(ERROR|WARN|PERF)"
Network Diagnostics
Diagnose network issues:
# Check Docker networks
docker network ls
docker network inspect calimero-web
# Test connectivity
docker exec calimero-node-1 ping calimero-node-2
# Check port binding
netstat -tulpn | grep -E "(2428|2528)"
Best Practices for Advanced Usage
Production Deployment
- Resource Planning: Allocate appropriate resources for your workload
- Security: Implement proper security measures and access controls
- Monitoring: Set up comprehensive monitoring and alerting
- Backup: Implement regular backup and recovery procedures
- Documentation: Maintain detailed documentation of your configuration
Development Workflow
- Environment Isolation: Use separate environments for different stages
- Version Control: Track configuration changes in version control
- Testing: Implement comprehensive testing at all levels
- CI/CD Integration: Integrate Merobox into your CI/CD pipeline
- Code Review: Review configuration changes before deployment
Performance Optimization
- Resource Tuning: Optimize resource allocation based on usage patterns
- Caching: Implement appropriate caching strategies
- Parallelization: Use parallel execution where possible
- Monitoring: Continuously monitor and optimize performance
- Scaling: Implement auto-scaling based on demand
Next Steps
Now that you understand advanced configuration:
- Python Customization - Basic Python integration
- Troubleshooting - Common issues and solutions
Was this page helpful?