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

Option
Required
Default
Description

--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

Network
RPC URL
Notes

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-addr is correct

"Insufficient funds"

  • Check wallet balance

  • Use faucet to get testnet tokens

  • Use --dry-run for 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


Last updated