Files
smom-dbis-138/docs/ccip/archive-import/README_KEEPER.md
2026-06-02 05:59:06 -07:00

5.7 KiB

Price Feed Keeper - Complete Integration Guide

Status: ALL INTEGRATION OPTIONS COMPLETE

This document provides a quick reference for all keeper integration options.


Quick Start

Option 1: Standalone Service (Simplest)

# Deploy keeper
forge script script/reserve/DeployKeeper.s.sol:DeployKeeper --rpc-url chain138 --broadcast

# Start service
export KEEPER_PRIVATE_KEY=<key>
export PRICE_FEED_KEEPER_ADDRESS=<address>
node scripts/reserve/keeper-service.js

Option 2: Complete Deployment (All Options)

# Install Node.js dependencies
npm install

# Deploy everything
./scripts/reserve/deploy-all.sh

Integration Options

1. Standalone Service

Best for: Development, testing, simple deployments

  • Node.js service: scripts/reserve/keeper-service.js
  • Bash service: scripts/reserve/keeper-service.sh

Setup: See KEEPER_SETUP.md


Best for: Decentralized, reliable automation

  • Contract: ChainlinkKeeperCompatible.sol
  • Setup: scripts/reserve/chainlink-keeper-setup.js

Requirements:

  • Chainlink KeeperRegistry address
  • LINK token for funding
  • Gas limit configuration

Setup:

# Deploy compatible contract
forge script script/reserve/DeployChainlinkKeeper.s.sol:DeployChainlinkKeeper --rpc-url chain138 --broadcast

# Register upkeep
export LINK_TOKEN_ADDRESS=<link>
export KEEPER_REGISTRY_ADDRESS=<registry>
node scripts/reserve/chainlink-keeper-setup.js

3. Gelato Network

Best for: Cost-effective automation

  • Contract: GelatoKeeperCompatible.sol
  • Setup: scripts/reserve/gelato-keeper-setup.js

Requirements:

  • Gelato Ops address
  • Native token for funding

Setup:

# Deploy compatible contract
forge script script/reserve/DeployGelatoKeeper.s.sol:DeployGelatoKeeper --rpc-url chain138 --broadcast

# Create task
export GELATO_OPS=<ops>
node scripts/reserve/gelato-keeper-setup.js

4. Systemd Service

Best for: Production Linux servers

  • Service file: systemd/price-feed-keeper.service

Setup:

sudo cp systemd/price-feed-keeper.service /etc/systemd/system/
sudo systemctl enable price-feed-keeper
sudo systemctl start price-feed-keeper

5. Docker Container

Best for: Containerized deployments

  • Compose file: docker/docker-compose.keeper.yml
  • Dockerfile: docker/Dockerfile.keeper

Setup:

docker-compose -f docker/docker-compose.keeper.yml up -d

Monitoring

Start Monitor Service

export PRICE_FEED_KEEPER_ADDRESS=<address>
export ALERT_WEBHOOK=<webhook_url>  # Optional
node scripts/reserve/monitor-keeper.js

Health Checks

curl http://localhost:3000/health
curl http://localhost:3000/stats

Configuration

Required Environment Variables

export RPC_URL_138=https://rpc.d-bis.org
export PRIVATE_KEY=<deployer_private_key>
export PRICE_FEED_KEEPER_ADDRESS=<keeper_address>
export KEEPER_PRIVATE_KEY=<keeper_wallet_private_key>
export UPDATE_INTERVAL=30

Optional Variables

# Chainlink
export LINK_TOKEN_ADDRESS=<link>
export KEEPER_REGISTRY_ADDRESS=<registry>
export UPKEEP_INTERVAL=30
export GAS_LIMIT=500000
export FUNDING_AMOUNT=10

# Gelato
export GELATO_OPS=<ops>
export EXECUTION_INTERVAL=30
export FUNDING_AMOUNT=0.1

# Monitoring
export ALERT_WEBHOOK=<webhook_url>
export CHECK_INTERVAL=60
export ALERT_THRESHOLD=3

File Structure

contracts/reserve/
├── PriceFeedKeeper.sol                    # Core keeper
├── ChainlinkKeeperCompatible.sol          # Chainlink wrapper
└── GelatoKeeperCompatible.sol             # Gelato wrapper

script/reserve/
├── DeployKeeper.s.sol                     # Deploy keeper
├── DeployChainlinkKeeper.s.sol            # Deploy Chainlink wrapper
├── DeployGelatoKeeper.s.sol               # Deploy Gelato wrapper
├── PerformUpkeep.s.sol                    # Manual upkeep
└── CheckUpkeep.s.sol                      # Check status

scripts/reserve/
├── keeper-service.js                      # Node.js service
├── keeper-service.sh                      # Bash service
├── chainlink-keeper-setup.js              # Chainlink setup
├── gelato-keeper-setup.js                 # Gelato setup
├── monitor-keeper.js                      # Monitoring
└── deploy-all.sh                          # Deployment automation

systemd/
└── price-feed-keeper.service               # Systemd service

docker/
├── docker-compose.keeper.yml               # Docker Compose
└── Dockerfile.keeper                      # Docker image

docs/integration/
├── KEEPER_SETUP.md                         # Setup guide
├── KEEPER_COMPLETE.md                      # Completion summary
└── KEEPER_INTEGRATION_COMPLETE.md          # Full integration guide

Documentation


Support

For issues or questions:

  1. Check KEEPER_SETUP.md troubleshooting section
  2. Review KEEPER_INTEGRATION_COMPLETE.md
  3. Check keeper logs: journalctl -u price-feed-keeper -f

Status

ALL INTEGRATION OPTIONS COMPLETE

  • Standalone Service
  • Chainlink Keepers
  • Gelato Network
  • Systemd Service
  • Docker Container
  • Monitoring & Alerting
  • Deployment Automation

Ready for production deployment on ChainID 138