Skip to content

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Artemis Banner

Artemis Agentic Commerce

πŸ€– Autonomous AI Agents β€’ πŸ’Έ Real-Time Settlements β€’ 🌍 ISO 20022 Integration

License: MIT Next.js Python SynapticChain

πŸš€ Live Demo β€’ πŸ“Š Explorer β€’ πŸ“– Docs β€’ πŸ’¬ Discord


Real-time dashboard for SynapticChain's Artemis agentic commerce framework

Demonstrating autonomous agent payments, ISO 20022 settlements, and cross-chain resource access in production.

🌟 Overview

Artemis is a decentralized agentic commerce framework built on SynapticChain that enables autonomous AI agents to:

  • Discover & transact with resources using machine-readable pricing (pacs.008 invoices)
  • Settle payments on-chain using the cTZS token (testnet stablecoin)
  • Access protected resources via payment-gated APIs
  • Register & earn as service providers in the agent marketplace

🎯 Why Artemis?

Feature Traditional APIs Artemis
Authentication API keys, OAuth πŸ” Cryptographic signatures
Payment Credit cards, subscriptions ⚑ Instant on-chain settlements
Pricing Human-readable docs πŸ“‹ Machine-readable ISO 20022
Trust Centralized platforms πŸ”— Decentralized blockchain
Agent Support Limited/manual πŸ€– Native autonomous operation

πŸ“¦ What's Inside

🎨 Frontend

  • Next.js 16 Dashboard - Real-time visualization
  • Artemis View - Network & settlement metrics
  • Ecosystem View - Agent registry & flows
  • Responsive Design - Mobile-ready UI

βš™οΈ Backend

  • Python Gateway - FastAPI + CORS
  • Resource Server - Payment-gated APIs
  • RPC Proxy - SynapticChain integration
  • Metrics Aggregation - Live data streams

πŸ”§ Tools

  • Python CLI - Agent operations
  • Demo Scripts - End-to-end flows
  • Contract ABIs - Smart contract interfaces

πŸ“Š Smart Contracts

  • cTZS Token - Stablecoin settlements
  • AgentRegistry - Identity management
  • AgenticEscrow - Payment framework

πŸ—οΈ Architecture

System Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   🌐 Next.js Dashboard                       β”‚
β”‚                   (synradix.xyz - Vercel)                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚  β”‚ Artemis Dashboardβ”‚  β”‚Ecosystem Dashboardβ”‚               β”‚
β”‚  β”‚  - Network stats β”‚  β”‚  - Agent registry β”‚               β”‚
β”‚  β”‚  - Settlements   β”‚  β”‚  - Industry flows β”‚               β”‚
β”‚  β”‚  - Contracts     β”‚  β”‚  - Live metrics   β”‚               β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ REST API + SSE
                     β–Ό
       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚   βš™οΈ Artemis Gateway (Python)   β”‚
       β”‚   - FastAPI + CORS              β”‚
       β”‚   - Metrics aggregation         β”‚
       β”‚   - Demo orchestration          β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                 β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β”‚                     β”‚
      β–Ό                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ⛓️ SynapticChainβ”‚    β”‚ πŸ”’ Resource Serverβ”‚
β”‚   RPC Node   β”‚    β”‚ (payment-gated)  β”‚
β”‚ - Settlementsβ”‚    β”‚ - pacs.008       β”‚
β”‚ - Contracts  β”‚    β”‚ - Weather API    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

Prerequisites

# Required
βœ“ Node.js 18+ and npm
βœ“ Python 3.11+
βœ“ Git

Installation

# 1. Clone the repository
git clone https://github.com/Synaptics-Lab/Artemis.git
cd Artemis

# 2. Install frontend dependencies
npm install

# 3. Setup Python environment
cd gateway
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cd ..

# 4. Configure environment
cp .env.example .env
# Edit .env with your API keys

Running Locally

Terminal 1: Gateway

cd gateway
python main.py

βœ… Gateway running on http://localhost:8080

Terminal 2: Dashboard

npm run dev

βœ… Dashboard running on http://localhost:3000

First Steps

  1. Open Dashboard: Navigate to http://localhost:3000
  2. Mint Agent Key: Click "Mint Sandbox Key" in the dashboard
  3. Run Demo: Click "RUN AGENT" to see an autonomous agent transaction
  4. Explore API: Try curl http://localhost:8080/api/config

🎨 Key Features

πŸ€– Autonomous Agent Commerce

  • Agents mint credentials via /api/sandbox/key
  • Discover resources through /api/invoice (pacs.008 pricing)
  • Submit signed payment proofs to unlock gated content
  • All settlements recorded on-chain

πŸ’° ISO 20022 Payment Messages

  • pacs.008 - Customer credit transfers (agent β†’ merchant invoices)
  • Machine-readable pricing with settlement token addresses
  • Merchant balance snapshots for proof-of-payment verification

πŸ“Š Real-Time Dashboards

  • Artemis Dashboard: Network status, contract monitoring, transaction ledger
  • Ecosystem Dashboard: Agent registry, industry-specific flows, settlement metrics

πŸ” Smart Contracts

Contract Address Purpose
cTZS Token syn1m89njq75czpm5vasxc0qsznyr69ylulne40fqt Testnet stablecoin
AgentRegistry syn1jzazxgra9lnku60ysj6qqgyjaph9a7r5uwcrcn Agent identity
AgenticEscrow syn1s6aag66yxdzpl5qtts06yexmddqn8cz40tgr9x Payment framework

πŸ“ Project Structure

artemis-agentic-commerce/
β”œβ”€β”€ 🎨 app/                       # Next.js 16 app router
β”‚   β”œβ”€β”€ api/                      # API route proxies to gateway
β”‚   β”œβ”€β”€ ecosystem/                # Ecosystem dashboard page
β”‚   └── page.tsx                  # Main Artemis dashboard
β”œβ”€β”€ 🧩 components/
β”‚   β”œβ”€β”€ artemis-dashboard.tsx     # Main dashboard component
β”‚   β”œβ”€β”€ ecosystem-dashboard.tsx   # Ecosystem metrics view
β”‚   └── ui/                       # Radix UI primitives
β”œβ”€β”€ βš™οΈ gateway/
β”‚   β”œβ”€β”€ main.py                   # FastAPI gateway server
β”‚   β”œβ”€β”€ runner.py                 # Demo orchestration
β”‚   └── vrf.py                    # VRF proof endpoints
β”œβ”€β”€ πŸ”’ resource-server/
β”‚   └── server.py                 # Mock payment-gated API
β”œβ”€β”€ πŸ› οΈ cli/
β”‚   β”œβ”€β”€ artemis_cli/              # Python CLI package
β”‚   └── pyproject.toml
β”œβ”€β”€ πŸ“š lib/
β”‚   β”œβ”€β”€ api.ts                    # Frontend API client
β”‚   └── gateway-config.ts         # Shared gateway config
└── 🌐 public/                    # Static assets

πŸ”Œ API Endpoints

Gateway (/api/*)

Endpoint Method Description
/api/config GET Network configuration & contract addresses
/api/status GET Network status (checkpoint height, TPS, nodes)
/api/contracts/status GET Contract operational status
/api/ledger GET Recent transactions (paginated)
/api/sandbox/key POST Mint sandbox agent credentials
/api/sandbox/agents GET List registered agents
/api/run-demo GET Run agent demo with SSE stream
/api/ecosystem/metrics GET Live ecosystem metrics (JSONL stream)
/api/invoice GET Fetch pacs.008 invoice from resource server

Resource Server (/api/weather)

  • POST /api/weather - Payment-gated weather data
    • Requires X-Payment-Signature, X-Agent-Signature, X-Agent-Pubkey headers
    • Validates payment proof against merchant balance
    • Returns JSON weather data or 402 Payment Required

🚒 Deployment

Vercel

vercel --prod

Required env vars:

  • GATEWAY_URL
  • SYNAPTIC_API_KEY

Docker

docker build -t artemis .
docker run -p 3000:3000 artemis

Exposed ports:

  • 3000 - Dashboard
  • 8080 - Gateway

Systemd

sudo cp *.service /etc/systemd/system/
sudo systemctl enable artemis-gateway
sudo systemctl start artemis-gateway

Services:

  • artemis-gateway
  • artemis-resource-server

πŸ§ͺ Development

Running Tests

# Frontend
npm test

# Gateway
cd gateway
pytest

# CLI
cd cli
pytest

Building for Production

# Frontend
npm run build

# CLI
cd cli
pip install build
python -m build

βš™οΈ Configuration

Gateway Environment Variables

Variable Default Description
SYNAPTIC_RPC http://100.73.33.37:8545 SynapticChain RPC endpoint
RESOURCE_SERVER_URL http://127.0.0.1:8765 Resource server URL
EXPLORER_BASE https://explorer.synapticchain.xyz Block explorer URL
PORT 8080 Gateway listening port
HOST 0.0.0.0 Gateway bind address

Frontend Environment Variables

Variable Default Description
GATEWAY_URL https://api.synapticchain.xyz Gateway API URL
SYNAPTIC_API_KEY - API key for gateway access
NEXT_PUBLIC_API_BASE_URL - Public API base URL override

πŸ” Monitoring

Health Checks

# Gateway health
curl https://api.synapticchain.xyz/health

# Network status
curl https://api.synapticchain.xyz/api/status

Metrics

The gateway exposes real-time metrics at:

  • /api/ecosystem/metrics - JSONL stream of agent activity
  • /api/ecosystem/state - Current agent registry state

πŸ›‘οΈ Security

⚠️ Testnet Only - This is a demonstration framework for testnet use only.

Best Practices

  • βœ… Never commit .env files or API keys to git
  • βœ… Use environment variables for all secrets
  • βœ… Rotate API keys regularly
  • βœ… Use HTTPS in production
  • βœ… Enable rate limiting on public endpoints

πŸ› Troubleshooting

Gateway 520 Errors (SSE Streaming)

Issue: Cloudflare tunnels may have issues with Server-Sent Events (SSE).

Solutions:

  1. Expose gateway on a public IP with nginx
  2. Use polling instead of SSE for /api/run-demo
  3. Use a different tunnel provider (ngrok, localtunnel)
Contract Address Mismatch

Issue: Contract addresses don't match between gateway and RPC.

Solution: Update contracts/production/addresses.json and restart gateway.

Agent Settlement Failures

Issue: Payment proofs not validating.

Checklist:

  • βœ“ Agent has sufficient cTZS balance
  • βœ“ Invoice hasn't expired (expires_at)
  • βœ“ Merchant balance snapshot matches current state
  • βœ“ Signature correctly signs merchant:amount:invoice_id

🀝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License - see LICENSE for details.

πŸ”— Links

Resource Link
🌐 Live Dashboard synradix.xyz
πŸ” Explorer explorer.synapticchain.xyz
πŸ“– Documentation docs.synapticchain.xyz
πŸ’¬ Discord discord.gg/synapticchain
πŸ™ GitHub github.com/Synaptics-Lab

πŸ’¬ Support

For questions or support:


Built with ⚑ on SynapticChain

The blockchain for autonomous agents

SynapticChain

About

Artemis, a pioneering Machine-to-Machine (M2M) settlement engine on the SynapticChain blockchain. Development logs describe the resolution of critical consensus and nonce synchronization issues, alongside the implementation of the Trusted Agent Protocol (TAP) to manage autonomous AI identities and spending limits

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages