This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Go-based blockchain testing environment for the Canopy Network with Ethereum oracle functionality. It simulates cross-chain operations between Canopy blockchain (CNPY token) and Ethereum (USDC token) through an automated oracle system and order book.
All development commands use the Task runner (task). Key commands:
task anvil- Start Ethereum testnet with USDC contract deploymenttask canopy- Build and start Canopy blockchain nodetask node-1/2/3- Start individual Canopy nodes with hot-reload
task e2e- Run automated end-to-end oracle testing (builds and runs eth-oracle/e2e/)task monitor- Launch comprehensive monitoring dashboard (balances + orders + storage)task balances- Monitor ETH, USDC, and CNPY account balancestask orders- Monitor Canopy order book statetask store- Monitor oracle disk storage contents
task keygen- Generate BLS keys for validatorstask chain-gen- Generate chain config from eth-oracle profiletask chain-gen-default- Generate default 3-node chain configtask chain-clear-data- Clean all blockchain data directories
go run ./cmd/chain-gen/ <profile>- Generate chain configurations from templatesgo run ./cmd/keygen/- Generate validator keysgo build . && go run .- Build and run E2E tests (from eth-oracle/ directory)
- Multi-node Canopy Blockchain - 3-node network with BLS consensus and committee-based validation
- Ethereum Integration - Local Anvil testnet with USDC ERC20 contract
- Oracle System - Cross-chain order monitoring and transaction processing (node-2 is oracle-enabled)
- Order Book System - CNPY ↔ USDC trading with lock/unlock mechanisms
- cmd/ - CLI utilities (chain-gen, keygen)
- cmd/keygen - Canopy BLS key and keystore generator.
- cmd/chain-gen - Chain generator - reads YAML templates to generate a node's data-dir
- eth-oracle/ - Main testing environment and E2E automation
- chain-profiles/ - YAML network configurations (default.yaml, eth-oracle.yaml)
- data-dir/ - Runtime blockchain data for each node
- templates/ - JSON configuration templates for nodes and genesis
- keys/ - BLS validator keys and Ethereum keystores
- eth-oracle/e2e/eth_oracle_e2e.go - Main E2E testing orchestration (1,038 lines)
- eth-oracle/contracts/USDC.sol - ERC20 USDC contract for testing
- taskfile.yml - Complete task automation and development workflows
- socket.sh - Network cleanup script
Two main configurations:
- default - 3-node basic setup for general testing
- eth-oracle - 2-node setup with oracle functionality (node-2 has oracle: true)
The system uses environment files in eth-oracle/env/:
- usdc_contract.env - USDC contract address and configuration
- testing.env - E2E testing parameters
- Start Ethereum environment:
task anvil - Start Canopy nodes:
task node-1 node-2(oracle setup) ortask canopy(single node) - Run E2E tests:
task e2e - Monitor system:
task monitor
The E2E tests simulate complete cross-chain order lifecycle: order creation → locking on Ethereum → USDC transfer → order completion.
Uses Air for hot-reload development with configuration files in air/ directory. Nodes automatically rebuild on code changes during development.