Skip to content

andrcmdr/cdk-dev-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Homepage GitHub release GitHub release Rust Toolchain License

CDK Dev Stack

πŸ¦€ A comprehensive Rust-based blockchain development stack for Polygon CDK (Chain Development Kit) networks, providing production-ready services for blockchain monitoring, indexing, testing, and Web3 infrastructure.

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CDK Dev Stack                                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
β”‚           β”‚   Events    β”‚  β”‚   Blocks    β”‚  β”‚  Mempool    β”‚            β”‚
β”‚           β”‚   Monitor   β”‚  β”‚   Monitor   β”‚  β”‚  Monitor    β”‚            β”‚
β”‚           β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜            β”‚
β”‚                  β”‚                β”‚                β”‚                   β”‚
β”‚                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚                                   β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                     Core Infrastructure                         β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚   β”‚
β”‚  β”‚  β”‚  PostgreSQL β”‚  β”‚    NATS     β”‚  β”‚  AWS RDS        β”‚          β”‚   β”‚
β”‚  β”‚  β”‚  Database   β”‚  β”‚  Messaging  β”‚  β”‚  Cloud storage  β”‚          β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    Application Services                         β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚   β”‚
β”‚  β”‚  β”‚   Airdrop     β”‚  β”‚   Agentic     β”‚  β”‚   Oracle    β”‚          β”‚   β”‚
β”‚  β”‚  β”‚   Backend     β”‚  β”‚   Payment     β”‚  β”‚   Service   β”‚          β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    Development Tools                            β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚   β”‚
β”‚  β”‚  β”‚  TX Producer  β”‚  β”‚ Load Tester   β”‚  β”‚ Merkle Trie   β”‚        β”‚   β”‚
β”‚  β”‚  β”‚               β”‚  β”‚    CLI        β”‚  β”‚    CLI        β”‚        β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚   β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚   β”‚
β”‚  β”‚  β”‚  ABI Fetcher  β”‚  β”‚   ABI2Sol     β”‚  β”‚  User ID      β”‚        β”‚   β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  Fetcher      β”‚        β”‚   β”‚
β”‚  β”‚                                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“¦ Components

πŸ” Monitoring Services

Component Description Documentation
events-monitor Real-time blockchain event monitoring and indexing service with WebSocket/HTTP subscriptions README
blocks-monitor Block tracking and indexing service for chain state monitoring README
mempool-monitor Pending transaction monitoring from the mempool README

πŸ’° Application Services

Component Description Documentation
airdrop-backend Airdrop eligibility verification service with Merkle tree proof generation README
agentic-payment-service AI-agent payment processing with X-402 and AP2 protocol support README
oracle-service Blockchain oracle service (for on-chain data providing) README

πŸ› οΈ Development & Testing Tools

Component Description Documentation
tx-producer Transaction generation and broadcasting library README
load-tester-cli Blockchain load testing CLI benchmarking tool with support of multiple test scenarios, configurable rate limiting (TPS) for throughput and bandwidth testing, and detailed statistics output README, Usage Guide
merkle-trie-cli Merkle trie generation and proof verification CLI README: MERKLE-TRIE-CLI VIEM COMPATIBLE, README: MERKLE-TRIE-CLI
abi-fetcher Smart contract ABI fetching from block explorers README
abi2sol ABI to Solidity interface generator README
user-id-fetcher User identity resolution and fetching CLI tool README

πŸ“ Legacy Components

Located in ./legacy/:

πŸ“¦ Summary of Components

Category Component Purpose
Monitoring events-monitor Real-time blockchain event indexing
Monitoring blocks-monitor Block data tracking and storage
Monitoring mempool-monitor Pending transaction monitoring
Services airdrop-backend Token airdrop eligibility verification
Services agentic-payment-service AI agent payment processing
Services oracle-service Blockchain oracle service
Tools tx-producer Transaction generation library
Tools load-tester-cli Blockchain load testing
Tools merkle-trie-cli Merkle proof generation
Tools abi-fetcher ABI retrieval from explorers
Tools abi2sol ABI to Solidity conversion
Services user-id-fetcher User identity resolution

πŸš€ Quick Start

Prerequisites

  • Rust stable toolchain (see rust-toolchain)
  • PostgreSQL 17+
  • NATS Server 2.x
  • Docker & Docker Compose

Building

# Build all workspace members
cargo build --release

# Build specific component
cargo build --release -p events-monitor

Running with Docker

cd .docker
./build.run.sh
# or for rebuild
./rebuild.run.sh

Configuration

Each service uses YAML configuration files located in their .config directories:

# Example: Events Monitor
cp events-monitor/events_monitor.config.yaml.example events-monitor/events_monitor.config.yaml
# Edit configuration...
cargo run -p events-monitor

πŸ“š Documentation

Comprehensive documentation is available in each corresponding component/service directory in respective REAMDE.md file.

πŸ”§ Tech Stack

  • Language: Rust (stable)
  • Blockchain: Alloy - Modern Ethereum library
  • Async Runtime: Tokio
  • Database: PostgreSQL with tokio-postgres
  • Messaging: NATS
  • Web Framework: Axum
  • Serialization: Serde, JSON, YAML
  • Cryptography: Keccak256, Merkle Trees

πŸ“ Project Structure

cdk-dev-stack/
β”œβ”€β”€ .cargo/              # Cargo configuration
β”œβ”€β”€ .config/             # Global configuration
β”œβ”€β”€ .docker/             # Docker build files
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   └── cdk-soa-backend.dockerfile
β”œβ”€β”€ docs/                # Documentation artefacts
β”œβ”€β”€ legacy/              # Deprecated/archived code
β”‚
β”œβ”€β”€ # Core Monitoring Services
β”œβ”€β”€ events-monitor/      # Event indexing service
β”œβ”€β”€ blocks-monitor/      # Block monitoring service
β”œβ”€β”€ mempool-monitor/     # Mempool monitoring service
β”‚
β”œβ”€β”€ # Application Services
β”œβ”€β”€ airdrop-backend/     # Airdrop eligibility API
β”œβ”€β”€ agentic-payment-service/  # AI payment processing
β”œβ”€β”€ oracle-service/      # Oracle service
β”‚
β”œβ”€β”€ # Development Tools
β”œβ”€β”€ tx-producer/         # Transaction library
β”œβ”€β”€ load-tester-cli/     # Load testing CLI
β”œβ”€β”€ merkle-trie-cli/     # Merkle proof CLI
β”œβ”€β”€ abi-fetcher/         # ABI fetching tool
β”œβ”€β”€ abi2sol/             # ABI to Solidity converter
β”œβ”€β”€ user-id-fetcher/     # User identity service
β”‚
β”œβ”€β”€ Cargo.toml           # Workspace manifest
β”œβ”€β”€ Cargo.lock           # Dependency lock file
β”œβ”€β”€ rust-toolchain       # Rust version specification
└── LICENSE-APACHE       # Apache 2.0 License

πŸ—„οΈ Database Schema

The monitoring services use PostgreSQL. Initialize schemas:

# Events Monitor
psql -U postgres -d cdk_events -f events-monitor/init.sql
psql -U postgres -d cdk_events -f events-monitor/init_aws_rds_schema.sql

# Blocks Monitor
psql -U postgres -d cdk_blocks -f blocks-monitor/init.sql
psql -U postgres -d cdk_blocks -f blocks-monitor/init_aws_rds_schema.sql

# Mempool Monitor
psql -U postgres -d cdk_mempool -f mempool-monitor/init.sql
psql -U postgres -d cdk_mempool -f mempool-monitor/init_aws_rds_schema.sql

# Airdrop Backend
psql -U postgres -d airdrop -f airdrop-backend/initial_schema.sql

πŸ§ͺ Testing

# Run all tests
cargo test

# Run tests for specific component
cargo test -p tx-producer

# Run integration tests
cargo test --test '*' -p load-tester-cli

πŸ”„ Load Testing

Use the load-tester-cli for performance testing:

cd load-tester-cli
# Run full benchmark suite
./scripts/run-benchmarks.sh

See USAGE_GUIDE.md for detailed options.

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE-APACHE file for details.

πŸ™ Acknowledgments


Built with πŸ¦€ by the Sentient Enclaves&CDK Dev Team


About

Development Stack for CDK-Erigon based chains and Agglayer bridge

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •