Get Started

Prerequisites

  • Node.js 18 or higher

  • npm or yarn

  • (Optional) Solana CLI for local dev and key management

Installation

Option A: Global install (recommended for CLI use)

npm install -g @eternallabs/netauth

Then run the CLI from anywhere:

netauth --help
netauth agent register my-agent

Option B: Local / project install

git clone https://github.com/eternal-labs/net-auth.git
cd net-auth
npm install

Use the CLI via npm script:

npm run netauth -- --help

Configuration

  1. Copy the example environment file:

  2. Edit .env with your values:

    Variable
    Description
    Required

    SOLANA_RPC_URL

    Solana RPC endpoint (e.g. https://api.mainnet-beta.solana.com)

    Yes (for live)

    NETWORK

    mainnet-beta, devnet, or testnet

    No (default: mainnet-beta)

    ENCRYPTION_KEY

    Secret used to encrypt wallet private keys

    Yes (for wallet creation)

    PORT

    HTTP port for the API server

    No (default: 3000)

    X402_ENDPOINT

    x402 protocol endpoint

    No (optional; fallback used if unset)

    X402_API_KEY

    API key for x402 service

    No (if using x402 endpoint)

  3. Important: Without ENCRYPTION_KEY, the server will not start (wallet creation requires it). The CLI can still show help without it.

Running the Server

Development (with watch):

Production:

The API is available at http://localhost:3000 (or your configured PORT). Health check:

Quick Start Flow

  1. Start the server (with ENCRYPTION_KEY set).

  2. Register two agents:

  3. Check balance:

  4. Send a payment:

  5. View history:


Last updated