Test Client
The Test Client is an example application for testing NCN Network functionality, including the complete inference and payment flow.
Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Test Client β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Command Line Interface β β
β β --gateway-addr, --wallet-key, --model-path, --text, etc. β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Inference Pipeline β β
β β 1. Submit request β β
β β 2. Handle payment β β
β β 3. Wait for result β β
β β 4. Verify and display β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Payment Manager β β
β β β’ Wallet management β β
β β β’ Balance checking β β
β β β’ Transaction submission β β
β β β’ Confirmation waiting β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β Connections: β
β βββ Gateway (gRPC) βββββββββββββββββββββΆ :50051 β
β βββ Blockchain (JSON-RPC) ββββββββββββββΆ RPC_URL β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββFeatures
Complete Payment Flow: Handles preprocessing, payment, and completion
Multi-Network Support: Local, forknet, testnet, mainnet
Bark Pipeline: Text-to-audio pipeline testing
Dry Run Mode: Test without actual payments
Detailed Logging: Visual progress indicators
Quick Start
Build
Basic Usage
Full Options
Command Line Options
--gateway-addr
No
http://127.0.0.1:50051
Gateway gRPC address
--wallet-key
No*
-
Client wallet private key
--network
No
local
Network name
--rpc-url
No
Auto
Blockchain RPC URL
--contract-address
No
Auto
Payment contract address
--semantic-model-path
No
-
Semantic model path
--coarse-model-path
No
-
Coarse model path
--fine-model-path
No
-
Fine model path
--text
No
Default
Text input for TTS
--dry-run
No
false
Skip actual payment
*Required if network requires payment
Output Examples
Successful Run
Dry Run Mode
Configuration
Environment Variables
Network Configurations
local
http://127.0.0.1:8545
Local Anvil/Hardhat
forknet
http://127.0.0.1:8545
NCN Forknet
sepolia
Infura/Alchemy URL
Ethereum testnet
mainnet
Infura/Alchemy URL
Ethereum mainnet
Payment Flow
Without Payment (Development)
With Payment
Bark Pipeline
The test client supports the full Bark text-to-audio pipeline:
Pipeline Stages
Usage
Troubleshooting
Common Issues
"Connection refused"
Ensure Gateway is running
Check
--gateway-addris correct
"Insufficient funds"
Check wallet balance
Use faucet to get testnet tokens
Use
--dry-runfor testing
"Model not found"
Verify model paths are correct
Ensure compute node has models
"Payment verification failed"
Wait for more confirmations
Check RPC URL connectivity
Verify contract address
Related Documentation
Usage Examples - More detailed examples
Payment Integration - Payment details
Gateway gRPC API - API reference
Last updated
