diff --git a/README.md b/README.md index e13455d..6586ccc 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# PVQ: PolkaVM Query System for Polkadot +# PVQ: PolkaVM Query [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE) -[![Rust](https://github.com/open-web3-stack/PVQ/workflows/Rust/badge.svg)](https://github.com/open-web3-stack/PVQ/actions) +[![Build](https://github.com/open-web3-stack/PVQ/actions/workflows/build.yml/badge.svg)](https://github.com/open-web3-stack/PVQ/actions/workflows/build.yml) -A powerful and secure query system for Polkadot parachains that enables developers to write expressive, sandboxed guest programs using PolkaVM. PVQ provides a safe and efficient alternative to custom RPC endpoints for runtime data queries. +PVQ is a unified query interface that bridges different chain runtime implementations and client tools/UIs. PVQ provides an extension-based system where runtime developers can expose chain-specific functionality through standardized interfaces, while allowing client-side developers to perform custom computations on the data through PolkaVM programs. By abstracting away concrete implementations across chains and supporting both off-chain and cross-chain scenarios, PVQ aims to reduce code duplication and development complexity while maintaining flexibility for custom use cases. ## ✨ Features @@ -14,7 +14,7 @@ A powerful and secure query system for Polkadot parachains that enables develope - **⚡ High Performance**: Efficient RISC-V execution with minimal overhead - **🛠️ Developer Friendly**: Rust-first development experience with procedural macros - **🌐 Runtime Integration**: Seamless integration with Substrate runtimes -- **🔍 Rich Querying**: Support for complex queries involving multiple runtime components +- **🔍 Rich Querying**: Support for complex queries involving functions from multiple pallets ## 🏗️ Architecture @@ -42,7 +42,7 @@ The PVQ system consists of several interconnected components: | **[PVQ Runtime API](pvq-runtime-api/)** | Substrate runtime API for external query submission | | **[PVQ Primitives](pvq-primitives/)** | Common types and utilities shared across components | -### Available Extensions +### Available Example Extensions - **[Core Extension](pvq-extension-core/)**: Fundamental functionalities and extension discovery - **[Fungibles Extension](pvq-extension-fungibles/)**: Asset querying, balances, and metadata @@ -60,18 +60,22 @@ Ensure you have the following installed: ### Installation 1. **Clone the repository with submodules:** + ```bash git clone --recursive https://github.com/open-web3-stack/PVQ.git cd PVQ ``` 2. **Install required tools:** + ```bash make tools ``` + This installs `polkatool` for ELF to PolkaVM blob conversion and `chain-spec-builder`. 3. **Build the project:** + ```bash cargo build --release ``` @@ -81,11 +85,13 @@ Ensure you have the following installed: #### Running Example Programs 1. **Build guest programs:** + ```bash make guests ``` 2. **Run a test program:** + ```bash cargo run -p pvq-test-runner -- --program output/guest-sum-balance ``` @@ -104,11 +110,13 @@ Ensure you have the following installed: #### Testing with PoC Runtime 1. **Start local test chain:** + ```bash make run ``` 2. **Build and test programs:** + ```bash make guests cargo run -p pvq-test-runner -- --program output/guest-total-supply @@ -142,61 +150,3 @@ pub trait MyCustomExtension { fn my_query() -> String; } ``` - -### Component Documentation - -- 📚 **[Development Guide](docs/development.md)** - Comprehensive development setup -- 🔧 **[Extension Development](docs/extensions.md)** - Creating custom extensions -- 🏗️ **[Architecture Deep Dive](docs/architecture.md)** - System design and internals -- 📋 **[API Reference](docs/api.md)** - Complete API documentation - -## 🛠️ Development - -### Project Structure - -``` -PVQ/ -├── poc/runtime/ # PoC Substrate runtime -├── pvq-program/ # Program macro and utilities -├── pvq-executor/ # Core execution engine -├── pvq-extension*/ # Extension system and implementations -├── pvq-runtime-api/ # Runtime API definition -├── pvq-test-runner/ # Testing utilities -├── guest-examples/ # Example programs -└── vendor/polkavm/ # Vendored PolkaVM dependency -``` - -### Building from Source - -```bash -# Development build -cargo build - -# Release build with optimizations -cargo build --release - -# Build guest examples -make guests - -# Run all tests -cargo test --all - -# Run clippy lints -cargo clippy --all --all-targets -``` - -### Testing - -```bash -# Run unit tests -cargo test - -# Run integration tests -cargo test --test integration - -# Test specific component -cargo test -p pvq-executor - -# Run example programs -make test-guests -```