-
-
Notifications
You must be signed in to change notification settings - Fork 12
Running ON1Builder
This guide covers the various ways to run ON1Builder, including command-line options, running modes, and production deployment.
ON1Builder can be run in several modes:
flowchart TB
Start([Start ON1Builder]) --> Config[Load Configuration]
Config --> ModeSelect{Select Running Mode}
ModeSelect -->|Single Chain| SingleChain[Initialize Single Chain Mode]
ModeSelect -->|Multi Chain| MultiChain[Initialize Multi Chain Mode]
ModeSelect -->|Development| DevMode[Initialize Development Mode]
ModeSelect -->|Production| ProdMode[Initialize Production Mode]
SingleChain --> Connect[Connect to Blockchain]
MultiChain --> ConnectMulti[Connect to Multiple Blockchains]
DevMode --> EnableDebug[Enable Debug Features]
ProdMode --> EnableSecurity[Enable Security Features]
Connect --> Run[Run Core System]
ConnectMulti --> Run
EnableDebug --> Run
EnableSecurity --> Run
Run --> Monitor[Monitor System]
Monitor --> End([System Running])
style Start fill:#bbf,stroke:#333,stroke-width:2px
style End fill:#bbf,stroke:#333,stroke-width:2px
style Config fill:#bfb,stroke:#333,stroke-width:1px
style ModeSelect fill:#fbb,stroke:#333,stroke-width:1px
style Run fill:#fbf,stroke:#333,stroke-width:1px
- Single-Chain Mode: Running on a single blockchain
- Multi-Chain Mode: Running on multiple blockchains simultaneously
- Development Mode: For testing and development
- Production Mode: For secure, reliable production operation
Before running ON1Builder, ensure you have:
- Completed the installation process
- Created a configuration file
- Set up your wallet and obtained the necessary API keys
The basic command to run ON1Builder is:
python -m on1builder run --config CONFIG_PATH [OPTIONS]Where:
-
CONFIG_PATHis the path to your configuration YAML file -
[OPTIONS]are additional command-line parameters
sequenceDiagram
actor User
participant CLI as Command Line Interface
participant Config as Configuration Loader
participant Core as ON1Builder Core
participant Chain as Chain Interface
User->>CLI: on1builder run --config path/to/config.yaml
activate CLI
CLI->>Config: Load configuration file
activate Config
Config-->>CLI: Configuration loaded
deactivate Config
CLI->>Core: Initialize core with config
activate Core
Core->>Chain: Connect to blockchain(s)
activate Chain
Chain-->>Core: Connection established
Core->>Core: Start monitoring loop
Note over User,Chain: System is now running
User->>CLI: Ctrl+C (Interrupt)
CLI->>Core: Signal shutdown
Core->>Chain: Close connections
deactivate Chain
Core-->>CLI: Shutdown complete
deactivate Core
CLI-->>User: Process terminated
deactivate CLI
| Option | Description |
|---|---|
--config |
Path to configuration file |
--debug |
Enable debug logging |
--dry-run |
Simulate transactions without execution |
--chain-id |
Only run on specified chain ID (for multi-chain configs) |
--log-level |
Set logging level (DEBUG, INFO, WARNING, ERROR) |
--help |
Show help message and exit |
To run ON1Builder on a single blockchain:
python -m on1builder run --config configs/chains/config.yamlThis will:
- Load the specified configuration
- Connect to the blockchain
- Start monitoring for opportunities
- Execute transactions according to your configuration
To run ON1Builder across multiple blockchains:
python -m on1builder run --config configs/chains/config_multi_chain.yamlThis will start separate workers for each chain defined in your multi-chain configuration.
To run in dry-run mode (simulating but not executing transactions):
python -m on1builder run --config configs/chains/config.yaml --dry-runTo enable more verbose logging:
python -m on1builder run --config configs/chains/config.yaml --debugTo test that your blockchain connection is working without starting the full system:
python -m on1builder test-connection --config configs/chains/config.yamlTo run on a testnet, use a configuration file with testnet settings:
python -m on1builder run --config configs/chains/testnet_config.yamlFor production environments, we recommend using Docker for reliable operation.
Start the application using Docker Compose:
# Start in detached mode
docker-compose -f docker/compose/docker-compose.prod.yml up -d
# View logs
docker-compose -f docker/compose/docker-compose.prod.yml logs -f
# Stop the application
docker-compose -f docker/compose/docker-compose.prod.yml downThe project includes a deployment helper script:
# Interactive deployment helper
./infra/bash/deploy_helper.shThis script will guide you through deployment options including:
- Single-chain or multi-chain deployment
- Configuration validation
- Starting and stopping the application
- Viewing logs and monitoring data
While ON1Builder is running, you can:
- Check logs in
data/logs/ - View Prometheus metrics at
http://localhost:9090(if enabled) - Access Grafana dashboards at
http://localhost:3000(if configured)
For more information on monitoring, see the Monitoring Guide.
ON1Builder includes a comprehensive CLI with the following commands:
| Command | Description |
|---|---|
run |
Run the main application |
test-connection |
Test blockchain connection |
validate-config |
Validate a configuration file |
version |
Show version information |
| Option | Description | Default |
|---|---|---|
--config |
Path to configuration file | Required |
--debug |
Enable debug logging | False |
--dry-run |
Simulate without execution | False |
--chain-id |
Only run on specified chain ID | All chains |
--log-level |
Set logging level | INFO |
--log-file |
Path to log file | data/logs/on1builder.log |
Test a configuration file:
python -m on1builder validate-config --config configs/chains/my_config.yamlRun with custom log file:
python -m on1builder run --config configs/chains/config.yaml --log-file custom_log.logRun only on Ethereum Mainnet in a multi-chain configuration:
python -m on1builder run --config configs/chains/config_multi_chain.yaml --chain-id 1To gracefully stop a running instance:
- If running in the foreground: Press
Ctrl+C - If running in Docker:
docker-compose -f docker/compose/docker-compose.prod.yml down - For emergency shutdown:
./infra/bash/emergency_shutdown.sh
To restart:
- Simply run the application again with the same command
- For Docker:
docker-compose -f docker/compose/docker-compose.prod.yml up -d
Now that you know how to run ON1Builder, you might want to:
- Learn how to monitor your running instance
- Troubleshoot common issues
- Explore advanced configurations