Files
aitbc/docs/apps/plugins/plugin-service.md
aitbc 19d415a235
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
feat: add SQLCipher database encryption support and consolidate agent documentation
- 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
2026-05-03 12:00:38 +02:00

5.4 KiB

Plugin Service

Level: Intermediate
Prerequisites: Familiarity with AITBC plugin architecture
Estimated Time: 10 minutes
Last Updated: 2026-05-03
Version: 1.0

🧭 Navigation Path:

🏠 Documentation Home📦 Apps🔌 PluginsYou are here

breadcrumb: Home → Apps → Plugins → Plugin Service


🎯 See Also:


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

cd /opt/aitbc
poetry install --with plugin-service

Configuration

Configuration is managed through environment variables:

# 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

cd apps/plugin-service
python -m plugin_service.main

Production (systemd)

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

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

# 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

# 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

curl http://localhost:9003/health

Plugin Status

curl http://localhost:9003/plugins

Plugin Logs

journalctl -u plugin-service -f

Last updated: 2026-05-03
Version: 1.0
Status: Active service
Tags: plugins, extensions, service, management