Repository navigation
feat(cli): nirium anchor - anchor a hash or small record to IPFS - #263
Merged
Merged
Conversation
Adds `nirium anchor --file|--hash|--record` against the Audit Trail node's POST /api/audit/log. --file computes sha-256 locally and sends only the hash, never the file content. --record mirrors the server's 8KB limit client-side. No --network flag: the agent box decides its own network, and the server already rejects a client-supplied one. 17 new tests against a local HTTP server standing in for the agent (no real network, no real IPFS pin), full suite 76/76. Closes #133 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Nov 7, 2026
Eras256
approved these changes
Nov 7, 2026
Eras256
left a comment
Collaborator
There was a problem hiding this comment.
Approving — clean thin client for POST /api/audit/log, matches the issue spec exactly (hash/file/record modes, 8 KB limit, no --network flag). CI green (4/4), tests cover all three input modes.
This was referenced Nov 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
nirium anchor, a thin client for the Audit Trail node'sPOST /api/audit/log:--filecomputes the sha-256 locally and sends only the hash - the file content is never uploaded (IPFS can't delete anything once pinned).--hashsends a sha-256 you already have.--recordanchors a small JSON object verbatim; capped at 8KB client-side, mirroring the server's ownMAX_RECORD_BYTES.--tx <hash>and--tag <label>are optional passthroughs.--networkflag: the agent box decides its own network (STELLAR_NETWORK), and the server already ignores/rejects a client-supplied one.On success prints the CID, content hash, gateway URL, and a
nirium verify <cid>suggestion.Test plan
test/anchor.test.js(17 cases) against a local HTTP server standing in for the agent - no real network, no real IPFS pin: each input mode, the mutual-exclusivity check, the 8KB limit, file-not-found, invalid hash/JSON, server 400/503, network-unreachable, and that--networkis rejected as an unknown option.npm test- 76/76.node --check bin/nirium.jsclean (this package ships a single flat file, no build step).Closes #133