Skip to content

CLI: nirium anchor, anchor a file or hash to the Audit Trail #133

Closed

Description

@Eras256

The CLI can check an audit record (nirium verify <cid>) but can't create one. To anchor something today you have to write code against the SDK (anchorAuditRecord) or curl POST /api/audit/log by hand.

Proposal: nirium anchor

nirium anchor --file evidence.json      # hashes the file locally, anchors only the sha-256
nirium anchor --hash <64-hex>
nirium anchor --record '{"order":"A-12"}'   # small JSON, max 8 KB, anchored as-is

Optional --tx <hash>, --tag, --json. No --network: the node picks the network from the box that anchors and ignores a network field in the body (see GET /api/audit/info), so the flag would only mislead. Point at testnet or mainnet with --url instead. Prints the CID, contentSha256 and the gateway URL, and suggests nirium verify <cid> as the next step.

--file should send the hash, not the file contents: IPFS can't delete anything, so raw data would outlive any erasure request (same warning as the SDK docstring).

Done when: tests with a mocked API cover hash, file and record modes plus the 8 KB limit, and the README has an "Anchor a record" section next to "Verify an audit record".

Owner: @M0nsxx

Disclosure: drafted with AI assistance under my direction and reviewed by hand.

Activity

  1. rupesh-kumar-sah commented on Oct 14, 2026

    @rupesh-kumar-sah

    Hi maintainers,

    I reviewed "CLI: nirium anchor, anchor a file or hash to the Audit Trail" and have a structured approach ready for implementation:

    Technical Implementation Outline:

    1. Review target data structures, error handling (Result/custom errors), and concurrency safety.
    2. Implement resilient, idiomatic Rust logic with zero panics and defensive boundary checks.
    3. Add comprehensive unit and regression tests covering expected behavior and edge cases.
    4. Ensure cargo check, cargo test, and cargo clippy -- -D warnings pass cleanly.

    Please assign this issue to me. I will submit a clean, well-tested, and production-ready PR promptly!

  2. grantfox-oss commented on Oct 15, 2026

    @grantfox-oss

    🦊 GrantFox — @M0nsxx has been assigned to this issue!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #133)
    2. Your PR will be reviewed by the nirium-protocol maintainers

    Good luck! Track your progress on GrantFox.

  3. grantfox-oss commented on Nov 7, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @M0nsxx's PR #263 was approved and merged by @Eras256.

    🏆 @M0nsxx: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (503 total points). Track your full progress on GrantFox.

    👏 Great work, @M0nsxx! Keep contributing to nirium-protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions