Dev Environment
Set up a local development environment to build and test Nexus merchant integrations.
Prerequisites
| Tool | Version | Purpose |
|---|---|---|
| Node.js | 24+ | Runtime for merchant agents |
| Foundry | Latest | Smart contract interaction |
| Docker | 24+ | Local service orchestration |
| Git | Latest | Source control |
Quick Start
1. Clone and Install
bash
git clone <your-merchant-agent-repo>
cd your-merchant-agent
npm install2. Configure Environment
Create a .env file with your development credentials:
bash
# PlatON Devnet
PLATON_RPC=https://devnet3openapi.platon.network/rpc
CHAIN_ID=20250407
# Contracts
USDC_ADDRESS=0xFF8dEe9983768D0399673014cf77826896F97e4d
ESCROW_ADDRESS=0xeB33a9C2b4c7D3F44Fd5514F90C355AF6bb79236
# Your merchant wallet
PRIVATE_KEY=your-dev-private-key
# Nexus Core (local or remote)
NEXUS_CORE_URL=https://api.nexus.platon.network
PORTAL_TOKEN=your-portal-token3. Get Test USDC
Use the Nexus Playground faucet at nexus.platon.network/#/playground to claim test USDC tokens.
4. Run Your Agent
bash
npm run devYour merchant agent should now be accessible for Nexus Core to discover via its skill.md manifest.
Testing Payments
Use the Playground's Quick Payment Test module to simulate end-to-end payment flows against your merchant agent.
Troubleshooting
| Issue | Solution |
|---|---|
| Transaction stuck pending | Use --legacy flag with Foundry. See PlatON Devnet Skills |
| "Invalid signature" error | Check EIP-712 domain — USDC version is "1" |
| Webhook not received | Verify your endpoint is publicly accessible |