feat: integrate actual blockchain mining with PoA consensus and fix CLI wallet operations
All checks were successful
CLI Tests / test-cli (push) Successful in 42s
Integration Tests / test-service-integration (push) Successful in 45s
Python Tests / test-python (push) Successful in 1m16s
Security Scanning / security-scan (push) Successful in 1m27s

🔗 Mining Integration:
• Connect mining RPC endpoints to PoA proposer for real block production
• Initialize PoA proposer in app lifespan for mining integration
• Add mining status, start, stop, and stats endpoints with blockchain data
• Track actual block production rate and mining statistics
• Support 1-8 mining threads with proper validation

🔧 PoA Consensus Integration:
• Set global PoA proposer reference for mining operations
• Start
This commit is contained in:
aitbc1
2026-03-29 17:30:04 +02:00
parent 8251853cbd
commit 1e60fd010c
7 changed files with 372 additions and 54 deletions

View File

@@ -8,32 +8,32 @@ echo "=== AITBC Wallet Creation (Enhanced CLI) ==="
echo "1. Pre-creation verification..."
echo "=== Current wallets on aitbc ==="
ssh aitbc 'python /opt/aitbc/cli/simple_wallet.py list'
ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py list'
echo "2. Creating new wallet on aitbc..."
ssh aitbc 'python /opt/aitbc/cli/simple_wallet.py create --name aitbc-user --password-file /var/lib/aitbc/keystore/.password'
ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py create --name aitbc-user --password-file /var/lib/aitbc/keystore/.password'
# Get wallet address using CLI
WALLET_ADDR=$(ssh aitbc 'python /opt/aitbc/cli/simple_wallet.py balance --name aitbc-user --format json | jq -r ".address"')
WALLET_ADDR=$(ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py balance --name aitbc-user --format json | jq -r ".address"')
echo "New wallet address: $WALLET_ADDR"
# Verify wallet was created successfully using CLI
echo "3. Post-creation verification..."
echo "=== Updated wallet list ==="
ssh aitbc "python /opt/aitbc/cli/simple_wallet.py list --format json | jq '.[] | select(.name == \"aitbc-user\")'"
ssh aitbc "/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py list --format json | jq '.[] | select(.name == \"aitbc-user\")'"
echo "=== New wallet details ==="
ssh aitbc 'python /opt/aitbc/cli/simple_wallet.py balance --name aitbc-user'
ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py balance --name aitbc-user'
echo "=== All wallets summary ==="
ssh aitbc 'python /opt/aitbc/cli/simple_wallet.py list'
ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py list'
echo "4. Cross-node verification..."
echo "=== Network status (aitbc1) ==="
python /opt/aitbc/cli/simple_wallet.py network
/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py network
echo "=== Network status (aitbc) ==="
ssh aitbc 'python /opt/aitbc/cli/simple_wallet.py network'
ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py network'
echo "✅ Wallet created successfully using enhanced CLI!"
echo "Wallet name: aitbc-user"

View File

@@ -9,48 +9,48 @@ echo "=== AITBC Enterprise Automation Demo ==="
# 1. Batch Transaction Processing
echo "1. Batch Transaction Processing"
echo "Creating sample batch file..."
python /opt/aitbc/cli/enterprise_cli.py sample
/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py sample
echo "Processing batch transactions (demo mode)..."
# Note: This would normally require actual wallet passwords
echo "python /opt/aitbc/cli/enterprise_cli.py batch --file sample_batch.json --password-file /var/lib/aitbc/keystore/.password"
echo "/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py batch --file sample_batch.json --password-file /var/lib/aitbc/keystore/.password"
# 2. Mining Operations
echo -e "\n2. Mining Operations"
echo "Starting mining with genesis wallet..."
python /opt/aitbc/cli/enterprise_cli.py mine start --wallet aitbc1genesis --threads 2
/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py mine start --wallet aitbc1genesis --threads 2
echo "Checking mining status..."
python /opt/aitbc/cli/enterprise_cli.py mine status
/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py mine status
echo "Stopping mining..."
python /opt/aitbc/cli/enterprise_cli.py mine stop
/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py mine stop
# 3. Marketplace Operations
echo -e "\n3. Marketplace Operations"
echo "Listing marketplace items..."
python /opt/aitbc/cli/enterprise_cli.py market list
/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py market list
echo "Creating marketplace listing (demo)..."
# Note: This would normally require actual wallet details
echo "python /opt/aitbc/cli/enterprise_cli.py market create --wallet seller --type 'Digital Art' --price 1000 --description 'Beautiful NFT artwork' --password-file /var/lib/aitbc/keystore/.password"
echo "/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py market create --wallet seller --type 'Digital Art' --price 1000 --description 'Beautiful NFT artwork' --password-file /var/lib/aitbc/keystore/.password"
# 4. AI Service Operations
echo -e "\n4. AI Service Operations"
echo "Submitting AI compute job (demo)..."
# Note: This would normally require actual wallet details
echo "python /opt/aitbc/cli/enterprise_cli.py ai submit --wallet client --type 'text-generation' --prompt 'Generate a poem about blockchain' --payment 50 --password-file /var/lib/aitbc/keystore/.password"
echo "/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py ai submit --wallet client --type 'text-generation' --prompt 'Generate a poem about blockchain' --payment 50 --password-file /var/lib/aitbc/keystore/.password"
# 5. Cross-Node Operations
echo -e "\n5. Cross-Node Operations"
echo "Checking network status on aitbc1..."
python /opt/aitbc/cli/simple_wallet.py network
/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py network
echo "Checking network status on aitbc..."
ssh aitbc 'python /opt/aitbc/cli/simple_wallet.py network'
ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/simple_wallet.py network'
echo "Running batch operations on aitbc..."
ssh aitbc 'python /opt/aitbc/cli/enterprise_cli.py sample'
ssh aitbc '/opt/aitbc/venv/bin/python /opt/aitbc/cli/enterprise_cli.py sample'
echo -e "\n✅ Enterprise Automation Demo Completed!"
echo "All advanced features are ready for production use."