Common Types
Overview
┌─────────────────────────────────────────────────────────────────────────────┐
│ common_types Crate │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Protocol Buffer Types │ │
│ │ Generated from proto/common_types.proto │ │
│ │ • InferenceRequest, InferenceResponse │ │
│ │ • NodeInfo, ModelData, PaymentTree │ │
│ │ • PreprocessingValidation, CompletionValidation │ │
│ │ • SubnetMetadata, ValidatorSignature │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Cryptographic Utilities │ │
│ │ • compute_message_hash() - SHA-256 hashing │ │
│ │ • sign_message() - secp256k1 ECDSA signing │ │
│ │ • verify_signature() - Signature verification │ │
│ │ • recover_signer() - Address recovery │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Payment Utilities │ │
│ │ • PaymentTree calculations │ │
│ │ • Fee estimation │ │
│ │ • Wei/ETH conversions │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ Type Conversions │ │
│ │ • Protobuf ↔ Native type conversions │ │
│ │ • Serialization/deserialization │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘Crate Structure
Usage
Add Dependency
Import Types
Protobuf Types
Core Types
Payment Types
Node Types
Cryptographic Utilities
Message Hashing
Signing
Verification
Preprocessing Message
Completion Message
Payment Utilities
Calculate Payment Tree
Total Payment
Wei/ETH Conversion
gRPC Services
GatewayClientService Stub
P2PRegistryService Stub
Building
Build Protobuf
Regenerate Types
Dependencies
Related Documentation
Last updated
