Feat: Adding Arweave storage via AR.IO Network#12
Feat: Adding Arweave storage via AR.IO Network#12kempsterrrr wants to merge 24 commits intoagent0lab:mainfrom
Conversation
Phase 1 of Arweave integration - DRY principle implementation. - Create src/utils/registration-format.ts with formatRegistrationFileForStorage() - Refactor IPFSClient.addRegistrationFile() to use shared utility - Reduces code duplication, preparing for ArweaveClient implementation - No functional changes, pure refactoring The shared utility will be used by both IPFSClient and ArweaveClient to ensure consistent ERC-8004 formatting across storage backends.
…rieval Phase 2 of Arweave integration - core client implementation. - Add ArweaveClient class with Turbo SDK for uploads and parallel gateway fallback for retrieval - Implement upload methods: add(), addJson(), addRegistrationFile() - Implement retrieval methods: get(), getJson(), getRegistrationFile() - Use EthereumSigner for EVM-based authentication - Match IPFSClient pattern with Promise.allSettled for gateway fallback - Add ARWEAVE_GATEWAYS constant with 4 gateway URLs - Add ARWEAVE_GATEWAY and ARWEAVE_UPLOAD timeout constants - Install @ardrive/turbo-sdk dependency (268 packages) - Export registration-format utility Files created: src/core/arweave-client.ts (177 lines) Files modified: src/utils/constants.ts, src/utils/index.ts, package.json
Add Arweave storage support to SDK class with configuration, initialization, and ar:// URI handling in registration file loading. Changes: - Add Arweave config fields to SDKConfig (arweave, arweavePrivateKey, arweaveToken, arweaveTestnet) - Add _arweaveClient property and initialization in constructor - Add _initializeArweaveClient() method (reuses signer or separate key) - Update _loadRegistrationFile() to handle ar:// URIs with parallel gateway fallback - Add arweaveClient getter for public access - Import ArweaveClient and ARWEAVE_GATEWAYS constants Implementation follows same pattern as IPFS integration for architectural consistency. Uses ArweaveClient for parallel gateway fallback when configured, falls back to direct arweave.net fetch otherwise.
- Add registerArweave() method to Agent class (lines 367-458) - Export ArweaveClient and ArweaveClientConfig in src/index.ts - Update ARWEAVE_INTEGRATION_PLAN.md with completion status Follows identical pattern to registerIPFS() for consistency. Handles both first-time registration and updates to existing agents.
Add test suite for Arweave storage functionality: - Unit tests for shared ERC-8004 formatting utility (10 tests) - Integration tests for Arweave registration (3 tests, mirrors IPFS pattern) - Update test configuration with Arweave settings - Update implementation plan with Phase 7 completion status Test files achieve parity with existing IPFS test coverage.
- Add generateArweaveTags() utility for ERC-8004 metadata tagging - Support 12 tag types: Essential, Capability Flags, Metadata - All tags cryptographically signed via EthereumSigner (Turbo SDK) - Update ArweaveClient to accept and apply tags on upload - Add SDK_VERSION constant for versioned App-Name tags - Add comprehensive unit tests (12/12 passing) TEMPORARY: GraphQL type fixes in sdk.ts and subgraph-client.ts for local testing - MUST BE REVERTED before final release See Pre-Merge Checklist in ARWEAVE_INTEGRATION_PLAN.md
|
Worked great for me! https://arweave.net/-2SgZvrwECOTPv3cNpbBSLJQuG0LrEiAOvbHFmGs3xk But on the subgraph side would need to make sure everything is working correctly as well, currently I see this with null on the registrationFile: But as far as the changes relating to the ts library I didn't run into any problems at all 👍 |
|
will try the subgraph PR as well and report back |
|
Left an update on the subgraph PR, unfortunately not working for me, but would love to figure out the issue together |
- Convert ArweaveClient to use dynamic imports matching IPFSClient pattern - Add error state checking for Turbo SDK initialization - Move from eager to lazy initialization in constructor - Reduces bundle size by ~500KB for read-only use cases
|
Shipped a few updates to this PR after chatting with @MarcoMetaMask
Not fixed is the if/else flow for selecting storage providers for feedback, still favours Arweave if it's available will raise this separately and change if preferred. Jerry confirmed separately in TG the subgraph is working |

Adds permanent storage option for agent registrations and feedback using Arweave via AR.IO Network's Turbo SDK.
What's new:
Agent.registerArweave()- Register agents with permanent Arweave storageArweaveClient- Upload and retrieve data from Arweave with parallel gateway fallbackformatRegistrationFileForStorage()ensures consistent ERC-8004 formatting across both IPFS and ArweaveUsage
Key features
Files changed
21 files: 5,807 additions, 288 deletions
Dependencies
Added: @ardrive/turbo-sdk (^1.23.0)