docs: update refactoring summary and mastery plan to reflect completion of all 11 atomic skills
Some checks failed
Some checks failed
- Mark Phase 2 as completed with all 11/11 atomic skills created - Update skill counts: AITBC skills (6/6), OpenClaw skills (5/5) - Move aitbc-node-coordinator and aitbc-analytics-analyzer from remaining to completed - Update Phase 3 status from PLANNED to IN PROGRESS - Add Gitea-based node synchronization documentation (replaces SCP) - Clarify two-node architecture with same port (8006) on different I
This commit is contained in:
234
.windsurf/workflows/blockchain-communication-test.md
Normal file
234
.windsurf/workflows/blockchain-communication-test.md
Normal file
@@ -0,0 +1,234 @@
|
||||
---
|
||||
description: Blockchain communication testing workflow for multi-node AITBC setup
|
||||
title: Blockchain Communication Test
|
||||
version: 1.0
|
||||
---
|
||||
|
||||
# Blockchain Communication Test Workflow
|
||||
|
||||
## Purpose
|
||||
Test and verify blockchain communication between aitbc (genesis) and aitbc1 (follower) nodes running on port 8006 on different physical machines.
|
||||
|
||||
## Prerequisites
|
||||
- Both nodes (aitbc and aitbc1) must be running
|
||||
- AITBC CLI accessible: `/opt/aitbc/aitbc-cli`
|
||||
- Network connectivity between nodes
|
||||
- Git repository access for synchronization
|
||||
|
||||
## Quick Start
|
||||
```bash
|
||||
# Run complete communication test
|
||||
cd /opt/aitbc
|
||||
./scripts/blockchain-communication-test.sh --full
|
||||
|
||||
# Run specific test type
|
||||
./scripts/blockchain-communication-test.sh --type connectivity
|
||||
./scripts/blockchain-communication-test.sh --type transaction
|
||||
./scripts/blockchain-communication-test.sh --type sync
|
||||
|
||||
# Run with debug output
|
||||
./scripts/blockchain-communication-test.sh --full --debug
|
||||
```
|
||||
|
||||
## Test Types
|
||||
|
||||
### 1. Connectivity Test
|
||||
Verify basic network connectivity and service availability.
|
||||
|
||||
```bash
|
||||
# Test genesis node (aitbc)
|
||||
curl http://10.1.223.40:8006/health
|
||||
|
||||
# Test follower node (aitbc1)
|
||||
curl http://<aitbc1-ip>:8006/health
|
||||
|
||||
# Test P2P connectivity
|
||||
./aitbc-cli network ping --node aitbc1 --host <aitbc1-ip> --port 8006 --verbose
|
||||
./aitbc-cli network peers --verbose
|
||||
```
|
||||
|
||||
### 2. Blockchain Status Test
|
||||
Verify blockchain status and synchronization on both nodes.
|
||||
|
||||
```bash
|
||||
# Check genesis node status
|
||||
NODE_URL=http://10.1.223.40:8006 ./aitbc-cli blockchain info --verbose
|
||||
NODE_URL=http://10.1.223.40:8006 ./aitbc-cli blockchain height --output json
|
||||
|
||||
# Check follower node status
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli blockchain info --verbose
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli blockchain height --output json
|
||||
|
||||
# Compare block heights
|
||||
NODE_URL=http://10.1.223.40:8006 ./aitbc-cli blockchain height --output json
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli blockchain height --output json
|
||||
```
|
||||
|
||||
### 3. Transaction Test
|
||||
Test transaction propagation between nodes.
|
||||
|
||||
```bash
|
||||
# Create test wallets
|
||||
./aitbc-cli wallet create --name test-sender --password test123 --yes --no-confirm
|
||||
./aitbc-cli wallet create --name test-receiver --password test123 --yes --no-confirm
|
||||
|
||||
# Fund sender wallet (if needed)
|
||||
./aitbc-cli wallet send --from genesis-ops --to test-sender --amount 100 --password <password> --yes
|
||||
|
||||
# Send transaction
|
||||
./aitbc-cli wallet send --from test-sender --to test-receiver --amount 10 --password test123 --yes --verbose
|
||||
|
||||
# Verify on both nodes
|
||||
./aitbc-cli wallet transactions --name test-sender --limit 5 --format table
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli wallet transactions --name test-receiver --limit 5 --format table
|
||||
```
|
||||
|
||||
### 4. Agent Messaging Test
|
||||
Test agent message propagation over blockchain.
|
||||
|
||||
```bash
|
||||
# Send agent message
|
||||
./aitbc-cli agent message --to <agent_id> --content "Test message from aitbc" --debug
|
||||
|
||||
# Check messages
|
||||
./aitbc-cli agent messages --from <agent_id> --verbose
|
||||
|
||||
# Verify on follower node
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli agent messages --from <agent_id> --verbose
|
||||
```
|
||||
|
||||
### 5. Synchronization Test
|
||||
Verify git-based synchronization between nodes.
|
||||
|
||||
```bash
|
||||
# Check git status on both nodes
|
||||
cd /opt/aitbc && git status --verbose
|
||||
ssh aitbc1 'cd /opt/aitbc && git status --verbose'
|
||||
|
||||
# Sync from Gitea
|
||||
git pull origin main --verbose
|
||||
ssh aitbc1 'cd /opt/aitbc && git pull origin main --verbose'
|
||||
|
||||
# Verify sync
|
||||
git log --oneline -5 --decorate
|
||||
ssh aitbc1 'cd /opt/aitbc && git log --oneline -5 --decorate'
|
||||
```
|
||||
|
||||
## Automated Script
|
||||
|
||||
### Script Location
|
||||
`/opt/aitbc/scripts/blockchain-communication-test.sh`
|
||||
|
||||
### Script Usage
|
||||
```bash
|
||||
# Full test suite
|
||||
./scripts/blockchain-communication-test.sh --full
|
||||
|
||||
# Specific test types
|
||||
./scripts/blockchain-communication-test.sh --type connectivity
|
||||
./scripts/blockchain-communication-test.sh --type blockchain
|
||||
./scripts/blockchain-communication-test.sh --type transaction
|
||||
./scripts/blockchain-communication-test.sh --type sync
|
||||
|
||||
# Debug mode
|
||||
./scripts/blockchain-communication-test.sh --full --debug
|
||||
|
||||
# Continuous monitoring
|
||||
./scripts/blockchain-communication-test.sh --monitor --interval 300
|
||||
```
|
||||
|
||||
### Script Features
|
||||
- **Automated testing**: Runs all test types sequentially
|
||||
- **Progress tracking**: Detailed logging of each test step
|
||||
- **Error handling**: Graceful failure with diagnostic information
|
||||
- **Report generation**: JSON and HTML test reports
|
||||
- **Continuous monitoring**: Periodic testing with alerts
|
||||
|
||||
## Production Monitoring
|
||||
|
||||
### Monitoring Script
|
||||
```bash
|
||||
# Continuous monitoring with alerts
|
||||
./scripts/blockchain-communication-test.sh --monitor --interval 300 --alert-email admin@example.com
|
||||
```
|
||||
|
||||
### Monitoring Metrics
|
||||
- Node availability (uptime)
|
||||
- Block synchronization lag
|
||||
- Transaction propagation time
|
||||
- Network latency
|
||||
- Git synchronization status
|
||||
|
||||
### Alert Conditions
|
||||
- Node unreachable for > 5 minutes
|
||||
- Block sync lag > 10 blocks
|
||||
- Transaction timeout > 60 seconds
|
||||
- Network latency > 100ms
|
||||
- Git sync failure
|
||||
|
||||
## Training Integration
|
||||
|
||||
### Integration with Mastery Plan
|
||||
This workflow integrates with Stage 2 (Intermediate Operations) of the OpenClaw AITBC Mastery Plan.
|
||||
|
||||
### Training Script
|
||||
`/opt/aitbc/scripts/training/stage2_intermediate.sh` includes blockchain communication testing as part of the training curriculum.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
#### Node Unreachable
|
||||
```bash
|
||||
# Check network connectivity
|
||||
ping <aitbc1-ip>
|
||||
curl http://<aitbc1-ip>:8006/health
|
||||
|
||||
# Check firewall
|
||||
iptables -L | grep 8006
|
||||
|
||||
# Check service status
|
||||
ssh aitbc1 'systemctl status aitbc-blockchain-rpc'
|
||||
```
|
||||
|
||||
#### Block Sync Lag
|
||||
```bash
|
||||
# Check sync status
|
||||
./aitbc-cli network sync status --verbose
|
||||
|
||||
# Force sync if needed
|
||||
./aitbc-cli cluster sync --all --yes
|
||||
|
||||
# Restart services if needed
|
||||
ssh aitbc1 'systemctl restart aitbc-blockchain-p2p'
|
||||
```
|
||||
|
||||
#### Transaction Timeout
|
||||
```bash
|
||||
# Check wallet balance
|
||||
./aitbc-cli wallet balance --name test-sender
|
||||
|
||||
# Check transaction status
|
||||
./aitbc-cli wallet transactions --name test-sender --limit 10
|
||||
|
||||
# Verify network status
|
||||
./aitbc-cli network status --verbose
|
||||
```
|
||||
|
||||
## Success Criteria
|
||||
- Both nodes respond to health checks
|
||||
- Block heights match within 2 blocks
|
||||
- Transactions propagate within 30 seconds
|
||||
- Agent messages sync within 10 seconds
|
||||
- Git synchronization completes successfully
|
||||
- Network latency < 50ms between nodes
|
||||
|
||||
## Log Files
|
||||
- Test logs: `/var/log/aitbc/blockchain-communication-test.log`
|
||||
- Monitoring logs: `/var/log/aitbc/blockchain-monitor.log`
|
||||
- Error logs: `/var/log/aitbc/blockchain-test-errors.log`
|
||||
|
||||
## Related Workflows
|
||||
- [Multi-Node Operations](/multi-node-blockchain-operations.md)
|
||||
- [Multi-Node Setup Core](/multi-node-blockchain-setup-core.md)
|
||||
- [Ollama GPU Test OpenClaw](/ollama-gpu-test-openclaw.md)
|
||||
121
.windsurf/workflows/openclaw-cross-node-communication.md
Normal file
121
.windsurf/workflows/openclaw-cross-node-communication.md
Normal file
@@ -0,0 +1,121 @@
|
||||
---
|
||||
description: OpenClaw specialized training workflow for agent-to-agent cross-node communication via AITBC blockchain
|
||||
title: OpenClaw Cross-Node Communication Training
|
||||
version: 1.0
|
||||
---
|
||||
|
||||
# OpenClaw Cross-Node Communication Training
|
||||
|
||||
## Purpose
|
||||
This specialized training module teaches OpenClaw agents how to establish, verify, and utilize cross-node communication channels over the AITBC blockchain network (between genesis node `aitbc` and follower node `aitbc1`).
|
||||
|
||||
## Learning Objectives
|
||||
1. **Agent Registration**: Register OpenClaw agents on multiple distinct blockchain nodes.
|
||||
2. **Peer Discovery**: Discover agent endpoints and IDs across the blockchain state.
|
||||
3. **Cross-Node Messaging**: Send and receive secure messages via blockchain transactions.
|
||||
4. **Task Coordination**: Delegate AI tasks from a genesis-based agent to a follower-based agent.
|
||||
5. **Event Monitoring**: Subscribe to and parse blockchain events for incoming messages.
|
||||
|
||||
## Prerequisites
|
||||
- Completed [Stage 2 of the Mastery Plan](/OPENCLAW_AITBC_MASTERY_PLAN.md)
|
||||
- Both nodes synchronized and communicating on port 8006
|
||||
- Funded wallets on both nodes (`openclaw-trainee` and `follower-ops`)
|
||||
|
||||
## Training Modules
|
||||
|
||||
### Module 1: Cross-Node Agent Registration
|
||||
Agents must be registered on the blockchain to receive messages.
|
||||
|
||||
```bash
|
||||
# Genesis Node (aitbc: 10.1.223.40)
|
||||
NODE_URL=http://10.1.223.40:8006 ./aitbc-cli agent create \
|
||||
--name "openclaw-genesis-commander" \
|
||||
--description "Primary coordinator agent on genesis node" \
|
||||
--verification full \
|
||||
--verbose
|
||||
|
||||
# Follower Node (aitbc1: <aitbc1-ip>)
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli agent create \
|
||||
--name "openclaw-follower-worker" \
|
||||
--description "Worker agent on follower node" \
|
||||
--verification full \
|
||||
--debug
|
||||
```
|
||||
|
||||
### Module 2: Cross-Node Messaging Protocol
|
||||
Learn to format and transmit messages between the registered agents.
|
||||
|
||||
```bash
|
||||
# Get follower agent ID
|
||||
FOLLOWER_AGENT_ID=$(NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli agent list --output json | jq -r '.[] | select(.name=="openclaw-follower-worker") | .id')
|
||||
|
||||
# Send instruction from genesis to follower
|
||||
NODE_URL=http://10.1.223.40:8006 ./aitbc-cli agent message \
|
||||
--to $FOLLOWER_AGENT_ID \
|
||||
--content "{\"cmd\":\"STATUS_REPORT\",\"priority\":\"high\"}" \
|
||||
--verbose
|
||||
```
|
||||
|
||||
### Module 3: Message Retrieval and Parsing
|
||||
The follower agent must listen for and decode messages.
|
||||
|
||||
```bash
|
||||
# Retrieve messages on follower node
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli agent messages \
|
||||
--from openclaw-genesis-commander \
|
||||
--output json
|
||||
|
||||
# Acknowledge receipt (Follower -> Genesis)
|
||||
GENESIS_AGENT_ID=$(NODE_URL=http://10.1.223.40:8006 ./aitbc-cli agent list --output json | jq -r '.[] | select(.name=="openclaw-genesis-commander") | .id')
|
||||
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli agent message \
|
||||
--to $GENESIS_AGENT_ID \
|
||||
--content "{\"cmd\":\"ACK\",\"status\":\"READY\"}" \
|
||||
--debug
|
||||
```
|
||||
|
||||
### Module 4: Distributed Task Execution
|
||||
Combine AI job submission with cross-node agent coordination.
|
||||
|
||||
```bash
|
||||
# Genesis instructs Follower to execute AI Job
|
||||
NODE_URL=http://10.1.223.40:8006 ./aitbc-cli agent message \
|
||||
--to $FOLLOWER_AGENT_ID \
|
||||
--content "{\"cmd\":\"EXECUTE_AI_JOB\",\"type\":\"inference\",\"prompt\":\"Analyze load\"}"
|
||||
|
||||
# Follower receives, executes locally, and returns result to Genesis
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli ai job submit \
|
||||
--type inference \
|
||||
--prompt "Analyze load" \
|
||||
--yes
|
||||
|
||||
NODE_URL=http://<aitbc1-ip>:8006 ./aitbc-cli agent message \
|
||||
--to $GENESIS_AGENT_ID \
|
||||
--content "{\"cmd\":\"JOB_COMPLETE\",\"result_id\":\"job_123\"}"
|
||||
```
|
||||
|
||||
## Automated Training Script
|
||||
Execute the specialized training script to practice these operations autonomously.
|
||||
|
||||
**Script Path:** `/opt/aitbc/scripts/training/openclaw_cross_node_comm.sh`
|
||||
|
||||
```bash
|
||||
# Run the interactive training
|
||||
cd /opt/aitbc/scripts/training
|
||||
./openclaw_cross_node_comm.sh
|
||||
|
||||
# Run in automated evaluation mode
|
||||
./openclaw_cross_node_comm.sh --auto-eval
|
||||
```
|
||||
|
||||
## Success Validation
|
||||
An OpenClaw agent has mastered cross-node communication when it can:
|
||||
1. Parse the local state to find remote agent IDs.
|
||||
2. Construct and broadcast a valid JSON payload in an `agent message` transaction.
|
||||
3. Automatically poll or listen for response messages on the remote node.
|
||||
4. Handle network latency or temporary sync delays gracefully using retry logic.
|
||||
5. Successfully complete a round-trip (Genesis -> Follower -> Genesis) message exchange within 60 seconds.
|
||||
|
||||
## Related Skills
|
||||
- [aitbc-node-coordinator](/aitbc-node-coordinator.md)
|
||||
- [openclaw-coordination-orchestrator](/openclaw-coordination-orchestrator.md)
|
||||
Reference in New Issue
Block a user