Client Integration

Guides for integrating applications with NCN Network.


Overview

NCN Network provides multiple interfaces for client integration:

Interface
Best For
Documentation

gRPC

High-performance, streaming

HTTP REST

Simple integrations, web apps

WebSocket

Real-time updates


Client Guides

High-performance gRPC integration:

  • Protobuf code generation

  • Connection setup

  • Request submission

  • Streaming responses

Simple REST API integration:

  • Endpoint reference

  • Request/response formats

  • Error handling

Blockchain payment flow:

  • Wallet setup

  • Payment submission

  • Confirmation handling

Complete code examples:

  • Python client

  • JavaScript client

  • Rust client


Quick Start

Simplest Integration (HTTP)

With gRPC (Higher Performance)


Integration Flow


Choosing an Interface

Use Case
Recommended
Reason

Web application

HTTP

Simple, CORS support

Backend service

gRPC

Performance, streaming

Real-time app

WebSocket

Live updates

Mobile app

HTTP

Wide library support

High-throughput

gRPC

Efficient binary protocol

Quick prototype

HTTP

No code generation needed


Input/Output Formats

Input Data

All input data is JSON-encoded:

Output Data

Output is also JSON-encoded:


Error Handling

HTTP Errors

Status
Meaning
Action

400

Bad request

Check input format

404

Not found

Check request_id

429

Rate limited

Retry with backoff

500

Server error

Retry or report

503

Unavailable

Service down, retry later

gRPC Errors

Code
Meaning
Action

INVALID_ARGUMENT

Bad input

Check request format

NOT_FOUND

Unknown request

Check request_id

RESOURCE_EXHAUSTED

Rate limited

Retry with backoff

UNAVAILABLE

Service down

Retry with backoff

INTERNAL

Server error

Report issue


SDKs and Libraries

Available

Language
Status
Usage

Rust

✅ Built-in

test_client crate

Planned

Language
Status

Python

🚧 In progress

JavaScript

🚧 Planned

Go

🚧 Planned

Generate Your Own


Testing Your Integration

Local Testing

  1. Start local NCN network (see Running Locally)

  2. Configure client to use localhost

  3. Submit test requests

  4. Verify responses

Testnet Testing

  1. Configure client for testnet endpoints

  2. Get testnet tokens from faucet

  3. Submit requests with payment

  4. Verify full payment flow


Next Steps

Last updated