flowctl is a CLI-driven event-stream engine that ingests Stellar ledger data, transforms it through pluggable processors, and delivers typed Protobuf messages to user-defined sinks.
- Unix-style CLI interface
- Pluggable processor architecture
- Support for multiple sink types
- YAML-based configuration
- Structured logging with Uber's Zap
- Built-in health monitoring
- Prometheus metrics
- Multi-platform deployment (Docker, Kubernetes, Nomad)
- DAG-based processor chaining with buffered channels
- Flexible pipeline topologies with fan-out/fan-in support
- Secure communication with TLS and mutual TLS support
# Clone the repository
git clone https://github.com/withobsrvr/flowctl.git
cd flowctl
# Build the binary
make build
# Install dependencies
make deps
- Create a pipeline configuration file (see
examples/minimal.yaml
for a template) - Run the pipeline:
./bin/flowctl run examples/minimal.yaml
The pipeline is configured using YAML files. Here's a minimal example:
version: 0.1
log_level: info
source:
type: mock
params:
interval_ms: 1000
processors:
- name: mock_processor
plugin: mock
params:
pass_through: true
sink:
type: stdout
params:
pretty: true
For more complex examples, see:
examples/stellar-pipeline.yaml
- Traditional pipelineexamples/dag-pipeline.yaml
- DAG-based pipeline with complex topology
flowctl uses structured logging powered by Uber's Zap library. You can control the log level using:
- Configuration file: Set the
log_level
field in your YAML configuration - Command line: Use the
--log-level
flag (e.g.,--log-level=debug
)
Available log levels:
debug
: Detailed information for debugginginfo
: General operational information (default)warn
: Warning conditionserror
: Error conditions
Example:
./bin/flowctl apply -f examples/minimal.yaml --log-level=debug
flowctl supports translating pipeline configurations to different deployment formats:
# Translate a pipeline to Docker Compose
./bin/flowctl translate -f examples/docker-test.yaml -o docker-compose
# Save the output to a file
./bin/flowctl translate -f examples/docker-test.yaml -o docker-compose --to-file docker-compose.yml
# Add a resource prefix for naming consistency
./bin/flowctl translate -f examples/docker-test.yaml -o docker-compose --prefix myapp
# Specify a container registry
./bin/flowctl translate -f examples/docker-test.yaml -o docker-compose --registry ghcr.io/myorg
# Generate local execution script
./bin/flowctl translate -f examples/local-test.yaml -o local --to-file run_pipeline.sh
Supported output formats:
docker-compose
: Docker Compose YAMLkubernetes
: Kubernetes manifests (coming soon)nomad
: Nomad job specifications (coming soon)local
: Local execution configuration (Docker Compose or bash script)
flowctl supports a Directed Acyclic Graph (DAG) based processing pipeline, which allows complex topologies beyond simple linear chains. This enables:
- Parallel processing of data streams
- Fan-out/fan-in patterns
- Buffered channels for flow control
- Strongly typed event connections
For more information, see DAG-Based Processing.
flowctl supports secure communication between components using Transport Layer Security (TLS):
- Server-side TLS for encrypted communication
- Mutual TLS (mTLS) where both client and server authenticate each other
- Certificate validation options, including CA certificate support
- TLS skip verification for development environments (not recommended for production)
For server configuration:
# Start a server with TLS
flowctl server --port 8080 --tls-cert server.crt --tls-key server.key
# Start a server with mutual TLS
flowctl server --port 8080 --tls-cert server.crt --tls-key server.key --tls-ca-cert ca.crt
For client configuration, add a tls
section to your YAML configuration:
tls:
mode: "enabled" # Options: disabled, enabled, mutual
cert_file: "client.crt"
key_file: "client.key"
ca_file: "ca.crt" # Required for mutual TLS
skip_verify: false
server_name: "flowctl-server.example.com" # For SNI verification
For more information, see TLS Configuration.
When using the local
output format, flowctl generates a configuration for running your pipeline locally. By default, it creates a Docker Compose configuration with profiles, but you can also use the legacy bash script generator if needed.
The Docker Compose-based local generator creates:
- A Docker Compose configuration file with profile support
- An environment file with all required variables
- Proper dependency ordering between components
- Health check monitoring
- Volume management for persistent data and logs
# Generate Docker Compose configuration for local execution
./bin/flowctl translate -f examples/local-test.yaml -o local --to-file docker-compose.yaml
# Start the pipeline
docker compose --profile local up -d
# View logs
docker compose logs -f
# Stop the pipeline
docker compose down
See Local Execution with Docker Compose for more details.
For compatibility with existing workflows, you can still use the bash script generator:
# Set environment variable to use bash script generator
export FLOWCTL_LOCAL_GENERATOR_TYPE=bash
# Generate local execution script
./bin/flowctl translate -f examples/local-test.yaml -o local --to-file run_pipeline.sh
# Make the script executable
chmod +x run_pipeline.sh
# Run the pipeline
./run_pipeline.sh
The bash script generator creates:
- A bash script to start and manage pipeline components
- An environment file with all required variables
- Proper dependency ordering between components
- Health check monitoring
- Process supervision with automatic restart
If you encounter permission errors when running flowctl sandbox commands, the tool will provide platform-specific guidance. Common solutions include:
- Run with sudo:
sudo flowctl sandbox start --use-system-runtime ...
- Add your user to the docker group:
sudo usermod -aG docker $USER
(then log out and back in) - Check if Docker service is running:
sudo systemctl status docker
- Ensure Docker Desktop is running
- Check Docker Desktop permissions in System Preferences
- Try restarting Docker Desktop
- See detailed setup guide: docs/nixos-docker-setup.md
- Quick fix: Run with sudo
- Permanent fix: Add user to docker group in configuration.nix
If flowctl cannot find Docker or nerdctl:
- Install Docker: https://docs.docker.com/get-docker/
- Or install nerdctl: https://github.com/containerd/nerdctl
- Always use the
--use-system-runtime
flag (bundled runtime is not yet available)
For sandbox-specific issues, refer to docs/sandbox.md for detailed troubleshooting steps.
# Build for current platform
make build
# Build for multiple platforms
make build-all
make test
make run-example
MPL-2.0
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request