Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
CLI Tests / test-cli (push) Failing after 3s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Successful in 2s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 3s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Successful in 2s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Deploy to Testnet / deploy-testnet (push) Successful in 1m12s
Documentation Validation / validate-docs (push) Failing after 8s
Documentation Validation / validate-policies-strict (push) Successful in 3s
Integration Tests / test-service-integration (push) Successful in 2m6s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Failing after 4s
P2P Network Verification / p2p-verification (push) Successful in 4s
Package Tests / Python package - aitbc-agent-sdk (push) Successful in 32s
Package Tests / Python package - aitbc-core (push) Successful in 14s
Package Tests / Python package - aitbc-crypto (push) Successful in 12s
Package Tests / Python package - aitbc-sdk (push) Successful in 9s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 17s
Python Tests / test-python (push) Successful in 15s
Security Scanning / security-scan (push) Successful in 27s
Node Failover Simulation / failover-test (push) Successful in 7s
Multi-Node Stress Testing / stress-test (push) Successful in 6s
Cross-Node Transaction Testing / transaction-test (push) Successful in 4s
- Add SQLCipher encryption for ait-mainnet database with configurable flag - Add db_encryption_enabled and db_encryption_key_path config settings - Implement encryption key loading and PRAGMA key setup via connection events - Add shutdown_db function for proper database cleanup - Export middleware classes in aitbc/__init__.py - Fix import path in sync.py for settings - Remove duplicate agent documentation from docs
219 lines
5.4 KiB
Markdown
219 lines
5.4 KiB
Markdown
# Plugin Service
|
|
|
|
**Level**: Intermediate<br>
|
|
**Prerequisites**: Familiarity with AITBC plugin architecture<br>
|
|
**Estimated Time**: 10 minutes<br>
|
|
**Last Updated**: 2026-05-03<br>
|
|
**Version**: 1.0
|
|
|
|
## 🧭 **Navigation Path:**
|
|
**🏠 [Documentation Home](../../README.md)** → **📦 Apps** → **🔌 Plugins** → *You are here*
|
|
|
|
**breadcrumb**: Home → Apps → Plugins → Plugin Service
|
|
|
|
---
|
|
|
|
## 🎯 **See Also:**
|
|
- **📖 [About Documentation](../../about/README.md)** - Template standard and audit checklist
|
|
- **🧭 [Master Index](../../MASTER_INDEX.md)** - Full documentation catalog
|
|
- **🔌 [Plugins Overview](./README.md)** - Plugin system overview
|
|
|
|
---
|
|
|
|
## Overview
|
|
|
|
The Plugin Service provides the infrastructure for managing and executing plugins in the AITBC ecosystem. It handles plugin registration, lifecycle management, and provides a secure execution environment for third-party extensions.
|
|
|
|
## Features
|
|
|
|
- **Plugin Registry**: Central registry for all plugins
|
|
- **Lifecycle Management**: Install, enable, disable, and remove plugins
|
|
- **Sandboxed Execution**: Secure plugin execution environment
|
|
- **Dependency Management**: Automatic dependency resolution
|
|
- **Version Control**: Support for multiple plugin versions
|
|
- **API Gateway**: Plugin API endpoints for external integration
|
|
|
|
## Architecture
|
|
|
|
The Plugin Service consists of:
|
|
|
|
- **Registry**: Stores plugin metadata and configurations
|
|
- **Loader**: Dynamically loads plugin code
|
|
- **Executor**: Runs plugin code in sandboxed environment
|
|
- **API Server**: Exposes plugin endpoints
|
|
- **Dependency Manager**: Handles plugin dependencies
|
|
- **Version Manager**: Manages plugin versions
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
cd /opt/aitbc
|
|
poetry install --with plugin-service
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Configuration is managed through environment variables:
|
|
|
|
```bash
|
|
# Plugin Storage
|
|
PLUGIN_STORAGE_PATH=/var/lib/aitbc/plugins
|
|
|
|
# Registry
|
|
PLUGIN_REGISTRY_URL=http://localhost:9002
|
|
|
|
# Security
|
|
PLUGIN_SANDBOX_ENABLED=true
|
|
PLUGIN_SIGNATURE_VERIFICATION=true
|
|
|
|
# API
|
|
PLUGIN_API_PORT=9003
|
|
```
|
|
|
|
## Running
|
|
|
|
### Development
|
|
```bash
|
|
cd apps/plugin-service
|
|
python -m plugin_service.main
|
|
```
|
|
|
|
### Production (systemd)
|
|
```bash
|
|
sudo systemctl start plugin-service
|
|
sudo systemctl enable plugin-service
|
|
```
|
|
|
|
## Endpoints
|
|
|
|
- `GET /health` - Health check
|
|
- `GET /plugins` - List all plugins
|
|
- `POST /plugins/install` - Install plugin from repository
|
|
- `POST /plugins/{plugin_id}/enable` - Enable plugin
|
|
- `POST /plugins/{plugin_id}/disable` - Disable plugin
|
|
- `DELETE /plugins/{plugin_id}` - Remove plugin
|
|
- `GET /plugins/{plugin_id}/info` - Get plugin information
|
|
- `GET /plugins/{plugin_id}/versions` - List plugin versions
|
|
|
|
## Plugin Development
|
|
|
|
### Plugin Structure
|
|
|
|
```
|
|
my-plugin/
|
|
├── plugin.yaml # Plugin metadata
|
|
├── src/
|
|
│ ├── __init__.py
|
|
│ └── main.py # Plugin entry point
|
|
├── requirements.txt # Plugin dependencies
|
|
└── tests/ # Plugin tests
|
|
```
|
|
|
|
### plugin.yaml Example
|
|
|
|
```yaml
|
|
name: my-plugin
|
|
version: 1.0.0
|
|
description: My custom plugin
|
|
author: Your Name
|
|
license: MIT
|
|
entry_point: src.main:main
|
|
dependencies:
|
|
- aitbc-core>=1.0.0
|
|
permissions:
|
|
- blockchain:read
|
|
- marketplace:read
|
|
```
|
|
|
|
### Installing a Plugin
|
|
|
|
```bash
|
|
# From local directory
|
|
curl -X POST http://localhost:9003/plugins/install \
|
|
-F "plugin=@/path/to/plugin.tar.gz"
|
|
|
|
# From repository
|
|
curl -X POST http://localhost:9003/plugins/install \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"repository": "https://repo.example.com/my-plugin", "version": "1.0.0"}'
|
|
```
|
|
|
|
### Managing Plugins
|
|
|
|
```bash
|
|
# Enable plugin
|
|
curl -X POST http://localhost:9003/plugins/my-plugin/enable
|
|
|
|
# Disable plugin
|
|
curl -X POST http://localhost:9003/plugins/my-plugin/disable
|
|
|
|
# Remove plugin
|
|
curl -X DELETE http://localhost:9003/plugins/my-plugin
|
|
|
|
# Get plugin info
|
|
curl http://localhost:9003/plugins/my-plugin/info
|
|
```
|
|
|
|
## Security
|
|
|
|
- **Sandboxed Execution**: Plugins run in isolated environment
|
|
- **Signature Verification**: Plugin signatures verified before installation
|
|
- **Permission System**: Granular permission controls
|
|
- **Dependency Isolation**: Plugin dependencies isolated from core system
|
|
- **Resource Limits**: CPU and memory limits for plugin execution
|
|
|
|
## Built-in Plugins
|
|
|
|
- **Plugin Analytics**: Analytics and metrics collection
|
|
- **Plugin Marketplace**: Plugin marketplace integration
|
|
- **Plugin Registry**: Plugin registry management
|
|
- **Plugin Security**: Security scanning and validation
|
|
|
|
## Troubleshooting
|
|
|
|
### Plugin Installation Fails
|
|
1. Verify plugin signature is valid
|
|
2. Check plugin dependencies are available
|
|
3. Review plugin logs for specific errors
|
|
|
|
### Plugin Won't Enable
|
|
1. Check plugin permissions are granted
|
|
2. Verify plugin dependencies are satisfied
|
|
3. Review plugin configuration
|
|
|
|
### Plugin Execution Errors
|
|
1. Check resource limits are not exceeded
|
|
2. Verify plugin code is compatible with current version
|
|
3. Review sandbox logs for errors
|
|
|
|
## Monitoring
|
|
|
|
### Health Check
|
|
```bash
|
|
curl http://localhost:9003/health
|
|
```
|
|
|
|
### Plugin Status
|
|
```bash
|
|
curl http://localhost:9003/plugins
|
|
```
|
|
|
|
### Plugin Logs
|
|
```bash
|
|
journalctl -u plugin-service -f
|
|
```
|
|
|
|
## Related Documentation
|
|
|
|
- [Plugin Analytics](./plugin-analytics.md)
|
|
- [Plugin Marketplace](./plugin-marketplace.md)
|
|
- [Plugin Registry](./plugin-registry.md)
|
|
- [Plugin Security](./plugin-security.md)
|
|
|
|
---
|
|
|
|
*Last updated: 2026-05-03*<br>
|
|
*Version: 1.0*<br>
|
|
*Status: Active service*<br>
|
|
*Tags: plugins, extensions, service, management*
|