process command

Manage AO processes for your application.

Syntax

ao-forge process <subcommand> [options]

Subcommands

  • start - Start AO process
  • stop - Stop AO process
  • restart - Restart AO process
  • list - List processes
  • status - Check process status
  • monitor - Monitor process
  • watch - Watch process output
  • logs - View process logs
  • help - Show help information

start subcommand

Syntax

ao-forge process start [process-name] [options]

Options

OptionDescriptionDefault
--name <name>Process nameDefault from config
--wallet <path>Wallet file pathDefault wallet
--module <id>Module IDDefault module
--cron <schedule>Cron schedule-
--sqliteUse SQLite modulefalse
--monitorEnable monitoringfalse
--tag-name <name>Tag name-
--tag-value <value>Tag value-
--helpShow help information-

Examples

# Start default process
ao-forge process start

# Start specific process
ao-forge process start counter

# Start with custom name
ao-forge process start --name my-process

# Start with specific wallet
ao-forge process start --wallet ./wallet.json

# Start with monitoring
ao-forge process start --monitor

# Start with cron job
ao-forge process start --cron "1-minute"

# Start with SQLite module
ao-forge process start --sqlite

stop subcommand

Syntax

ao-forge process stop [process-name] [options]

Examples

# Stop default process
ao-forge process stop

# Stop specific process
ao-forge process stop counter

# Stop all processes
ao-forge process stop --all

# Force stop
ao-forge process stop --force

restart subcommand

Syntax

ao-forge process restart [process-name] [options]

Examples

# Restart default process
ao-forge process restart

# Restart specific process
ao-forge process restart counter

# Restart with new configuration
ao-forge process restart --reload-config

list subcommand

Syntax

ao-forge process list [options]

Examples

# List all processes
ao-forge process list

# List with details
ao-forge process list --details

# List for specific wallet
ao-forge process list --wallet ./wallet.json

# List with format
ao-forge process list --format json

status subcommand

Syntax

ao-forge process status [process-name] [options]

Examples

# Check default process status
ao-forge process status

# Check specific process status
ao-forge process status counter

# Check with details
ao-forge process status --details

# Check all processes
ao-forge process status --all

monitor subcommand

Syntax

ao-forge process monitor [process-name] [options]

Examples

# Monitor default process
ao-forge process monitor

# Monitor specific process
ao-forge process monitor counter

# Monitor with real-time updates
ao-forge process monitor --real-time

# Monitor with filtering
ao-forge process monitor --filter "error"

watch subcommand

Syntax

ao-forge process watch [process-name] [options]

Examples

# Watch default process
ao-forge process watch

# Watch specific process
ao-forge process watch counter

# Watch with tail
ao-forge process watch --tail 100

# Watch with follow
ao-forge process watch --follow

logs subcommand

Syntax

ao-forge process logs [process-name] [options]

Examples

# View default process logs
ao-forge process logs

# View specific process logs
ao-forge process logs counter

# View recent logs
ao-forge process logs --tail 50

# View logs with timestamps
ao-forge process logs --timestamps

# View logs with filtering
ao-forge process logs --filter "error"

Process Configuration

ao.config.yml

# Process configuration
processes:
  - name: 'counter'
    file: './ao/counter.lua'
    autoStart: true
    monitoring: true
    wallet: './wallet.json'
    module: 'module-id'
    cron: '1-minute'
    tags:
      - name: 'type'
        value: 'counter'
  - name: 'token'
    file: './ao/token.lua'
    autoStart: false
    monitoring: false

Process Management

# Start all configured processes
ao-forge process start --all

# Start specific processes
ao-forge process start counter token

# Stop all processes
ao-forge process stop --all

# Restart all processes
ao-forge process restart --all

Process Monitoring

Real-time Monitoring

# Monitor with real-time updates
ao-forge process monitor --real-time

# Monitor with custom refresh rate
ao-forge process monitor --refresh 5

# Monitor with filtering
ao-forge process monitor --filter "error" --filter "warning"

Process Health Checks

# Check process health
ao-forge process health

# Check specific process health
ao-forge process health counter

# Check with timeout
ao-forge process health --timeout 30

Process Deployment

Deploy to Arweave

# Deploy process to Arweave
ao-forge process deploy

# Deploy with specific wallet
ao-forge process deploy --wallet ./wallet.json

# Deploy to testnet
ao-forge process deploy --testnet

# Deploy with tags
ao-forge process deploy --tag-name "type" --tag-value "counter"

Process Updates

# Update process
ao-forge process update

# Update specific process
ao-forge process update counter

# Update with new module
ao-forge process update --module new-module-id

Error Handling

Common Errors

  1. Process not found
    Error: Process 'counter' not found
    Solution: Check process name or use 'ao-forge process list' to see available processes
    
  2. Process already running
    Error: Process 'counter' is already running
    Solution: Use 'ao-forge process stop' to stop the process first
    
  3. Process failed to start
    Error: Process failed to start
    Solution: Check process configuration and logs
    

Best Practices

Process Management

  1. Use descriptive names for processes
  2. Monitor processes regularly
  3. Use proper error handling in Lua code
  4. Test processes before deployment
  5. Keep processes updated with latest changes

Performance

  1. Optimize Lua code for better performance
  2. Use appropriate modules for your needs
  3. Monitor resource usage regularly
  4. Scale processes as needed
  5. Use caching where appropriate