How hypermusic-ai/pt works
Project type and purpose
• This is a multi-stack blockchain project called “Performative Transactions.”
• It has three main codebases:
• cpp/ – an off-chain C++ node framework (server, networking, registry, operand processing)
• solidity/ – Ethereum smart-contract modules, scripts, tests (Hardhat, Ethers/Web3)
• solana/ – Solana chain-program code (C++ via CMake, Dockerized)
File structure
• Top-level dirs:
• cpp/ – subdivided into include (PT core, concepts, registry, operand), network (TCP/UDP/Server), native wrappers (Unix/Windows), src, and CMake configs.
• solidity/ – Hardhat config, contracts (organized by feature, condition, ownable, registry, transformation), scripts, tests, package.json, tsconfig.
• solana/ – CMakeLists, Dockerfile, src/lib.cpp and main.cpp for the Solana program.
• assets/ – CSS/images for documentation or UI site.
• Config/build files: CMakeLists, deps.cmake, Dockerfile, hardhat.config.ts, .vscode settings, tsconfig.json.
README insights
• The repo is explicitly divided by smart-contract language (Solidity on Ethereum vs C++ for server node).
• External documentation link provided (docs site).
a. Main components:
1. Front-end/docs (optional UI or assets/css site)
2. Off-chain C++ node
– Core modules: PT (Performative Transaction) logic, concepts, operands, registry
– Native abstraction layer (Unix/Windows)
– Network layer (TCP, UDP, Server endpoints)
3. Ethereum blockchain
– Solidity contracts (conditions, features, transformations, registry, ownable)
– Deployment scripts (Hardhat/Ethers/Web3)
4. Solana blockchain
– Solana program (C++ chain-code)
– Docker container for Solana runtime
b. Relationships & interactions:
– C++ node ⇄ Ethereum: via JSON-RPC over HTTP/WebSocket, invoking contract functions, listening to events
– C++ node ⇄ Solana: via RPC endpoints or direct program instructions, submitting transactions
– Front-end/UI (if present) ⇄ C++ node: REST or WebSocket APIs
– Deployment scripts ⇄ blockchains: orchestrate contract/program deployment
c. Architectural patterns and design principles:
– Modular layering: separation of core logic, network, and native abstraction
– Adapter pattern: native wrapper to decouple OS specifics
– Plugin‐style grouping in solidity/contracts to allow independent features (conditions, transformations, etc.)
– Infrastructure-as-code: Dockerfile for Solana, CMake for cross-platform builds, Hardhat for Ethereum
d. Technologies/frameworks:
– C++17, CMake, cross‐platform (Unix/Windows)
– Boost.Asio-style networking (TCP/UDP server)
– Hardhat, TypeScript, Web3/Ethers.js for Ethereum
– Solana SDK in C++ with Docker for on‐chain program