From fd1096f6a3d63d8bec0fbd04fe1cf252ffd2862f Mon Sep 17 00:00:00 2001 From: jaycoolslm <86686746+jaycoolslm@users.noreply.github.com> Date: Sat, 1 Nov 2025 14:50:37 +0800 Subject: [PATCH 1/2] Add Hedera testnet defaults and document subgraph overrides --- API_REFERENCE.md | 2 ++ README.md | 16 +++++++++++++++- src/core/contracts.ts | 6 ++++++ tests/contracts.test.ts | 12 ++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/contracts.test.ts diff --git a/API_REFERENCE.md b/API_REFERENCE.md index 9625aa3..257313f 100644 --- a/API_REFERENCE.md +++ b/API_REFERENCE.md @@ -24,6 +24,8 @@ interface SDKConfig { } ``` +> **Hedera testnet:** The SDK ships registry defaults for chain ID `296`, but no built-in subgraph URL. Provide a `subgraphOverrides` entry (e.g., `{ 296: 'https://your-hedera-subgraph.example' }`) when instantiating the SDK to enable subgraph-backed features on Hedera. + ### Chain & Registry Methods ```typescript async chainId(): Promise diff --git a/README.md b/README.md index 22aeb5e..41b2450 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,20 @@ const sdk = new SDK({ ipfs: 'pinata', // Options: 'pinata', 'filecoinPin', 'node' pinataJwt: process.env.PINATA_JWT // For Pinata // Subgraph URL auto-defaults from DEFAULT_SUBGRAPH_URLS + // Hedera testnet (chainId 296) requires providing subgraphOverrides: { 296: 'https://your-hedera-subgraph.example' } +}); +``` + +> **Note:** Hedera testnet (chainId `296`) includes default registry addresses but does not have a bundled subgraph URL. When targeting Hedera, pass a `subgraphOverrides` entry during SDK initialization, for example: + +```typescript +const sdk = new SDK({ + chainId: 296, + rpcUrl: process.env.RPC_URL!, + subgraphOverrides: { + 296: 'https://your-hedera-subgraph.example', + }, + // ...other config options }); ``` @@ -197,7 +211,7 @@ await agent.registerHTTP('https://example.com/agent-registration.json'); ## 🚀 Coming Soon -- More chains (currently Ethereum Sepolia only) +- Additional chains (Hedera testnet supported today via manual subgraph override) - Support for validations - Multi-chain agents search - Enhanced x402 payments diff --git a/src/core/contracts.ts b/src/core/contracts.ts index 17c4cb8..3c64d67 100644 --- a/src/core/contracts.ts +++ b/src/core/contracts.ts @@ -334,6 +334,12 @@ export const DEFAULT_REGISTRIES: Record> = { REPUTATION: '0x8004B8FD1A363aa02fDC07635C0c5F94f6Af5B7E', VALIDATION: '0x8004CB39f29c09145F24Ad9dDe2A108C1A2cdfC5', }, + 296: { + // Hedera Testnet + IDENTITY: '0x4c74ebd72921d537159ed2053f46c12a7d8e5923', + REPUTATION: '0xc565edcba77e3abeade40bfd6cf6bf583b3293e0', + VALIDATION: '0x18df085d85c586e9241e0cd121ca422f571c2da6', + }, 84532: { // Base Sepolia IDENTITY: '0x8004AA63c570c570eBF15376c0dB199918BFe9Fb', diff --git a/tests/contracts.test.ts b/tests/contracts.test.ts new file mode 100644 index 0000000..755044d --- /dev/null +++ b/tests/contracts.test.ts @@ -0,0 +1,12 @@ +import { DEFAULT_REGISTRIES, DEFAULT_SUBGRAPH_URLS } from '../src/core/contracts'; + +describe('DEFAULT_REGISTRIES', () => { + it('includes Hedera testnet addresses and no default subgraph URL', () => { + expect(DEFAULT_REGISTRIES[296]).toEqual({ + IDENTITY: '0x4c74ebd72921d537159ed2053f46c12a7d8e5923', + REPUTATION: '0xc565edcba77e3abeade40bfd6cf6bf583b3293e0', + VALIDATION: '0x18df085d85c586e9241e0cd121ca422f571c2da6', + }); + expect(DEFAULT_SUBGRAPH_URLS[296]).toBeUndefined(); + }); +}); From 6b38f4bc34ea7ea28b6d9b63c838e8f4477bb31c Mon Sep 17 00:00:00 2001 From: jaycoolslm <86686746+jaycoolslm@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:02:49 +0800 Subject: [PATCH 2/2] docs: streamline hedera references --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 22aeb5e..2ab4e19 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,17 @@ npm run build ## Quick Start +### Supported Test Networks + +| Network | `chainId` | Notes | +| ------------------ | --------- | ----- | +| Ethereum Sepolia | 11155111 | Default registry + default subgraph URL bundled with the SDK. | +| Hedera Testnet | 296 | Provide a Hedera JSON-RPC endpoint (e.g., `https://testnet.hashio.io/api`). Supply a subgraph URL via `subgraphUrl`/`subgraphOverrides` for search features. | +| Base Sepolia | 84532 | Registry addresses included. Configure `subgraphOverrides` for query support. | +| Linea Sepolia | 59141 | Registry addresses included. Configure `subgraphOverrides` for query support. | + +> â„šī¸ When using Hedera Testnet, the SDK cannot auto-detect a subgraph yet. Pass a Hedera-compatible subgraph endpoint explicitly if you rely on search, feedback history, or reputation summary APIs. + ### 1. Initialize SDK ```typescript @@ -53,12 +64,13 @@ import { SDK } from 'agent0-sdk'; // Initialize SDK with IPFS and subgraph const sdk = new SDK({ - chainId: 11155111, // Ethereum Sepolia testnet + chainId: 11155111, // Default: Ethereum Sepolia (see Supported Test Networks for other chainIds) rpcUrl: process.env.RPC_URL!, signer: process.env.PRIVATE_KEY, // Optional: for write operations ipfs: 'pinata', // Options: 'pinata', 'filecoinPin', 'node' pinataJwt: process.env.PINATA_JWT // For Pinata // Subgraph URL auto-defaults from DEFAULT_SUBGRAPH_URLS + // Override subgraphUrl/subgraphOverrides when supplying your own endpoint }); ``` @@ -165,7 +177,7 @@ console.log(`Average score: ${summary.averageScore}`); ```typescript // Option 1: Filecoin Pin (free for ERC-8004 agents) const sdk = new SDK({ - chainId: 11155111, + chainId: 11155111, // Configure with the chainId for your target network rpcUrl: '...', signer: privateKey, ipfs: 'filecoinPin', @@ -197,7 +209,7 @@ await agent.registerHTTP('https://example.com/agent-registration.json'); ## 🚀 Coming Soon -- More chains (currently Ethereum Sepolia only) +- More chains (currently supports Ethereum Sepolia, Hedera Testnet, Base Sepolia, and Linea Sepolia; more networks coming soon) - Support for validations - Multi-chain agents search - Enhanced x402 payments