Skip to content

fix: publish scheduler location to Arweave with AO-protocol CamelCase tags#676

Open
atticusofsparta wants to merge 1 commit intopermaweb:edgefrom
atticusofsparta:fix/location-arweave-tags
Open

fix: publish scheduler location to Arweave with AO-protocol CamelCase tags#676
atticusofsparta wants to merge 1 commit intopermaweb:edgefrom
atticusofsparta:fix/location-arweave-tags

Conversation

@atticusofsparta
Copy link

Summary

  • generate_new_location/5 was uploading the signed TABM directly via hb_client:upload, which serialises Erlang map keys using HyperBEAM's lowercase convention — producing Arweave tags like type: location and url: ...
  • The AO ecosystem GQL query in hb_gateway_client:location searches for name: "Type", values: ["Location", "Scheduler-Location"] (CamelCase), so published records were never discoverable
  • Adds upload_to_arweave/4 which builds a #tx{} data item directly with the correct AO-protocol CamelCase tags (Type: Scheduler-Location, Data-Protocol: ao, Variant: ao.N.1, Url: ...), signs it with ar_bundles:sign_item, and posts via dev_arweave:post_binary_ans104
  • The internal TABM representation (local cache, HTTP responses) is unchanged — lowercase keys are preserved per HyperBEAM convention
  • Respects whichever bundler is configured: bundler_httpsig takes precedence over bundler_ans104; logs an event and skips if neither is set

Test plan

  • Compile cleanly: rebar3 compile
  • Restart node with bundler_httpsig or bundler_ans104 configured and location_codec: ans104@1.0
  • Confirm upload returns 200 from bundler
  • Query Arweave GQL for Type: "Scheduler-Location" owned by the node wallet — record should appear within 1–2 blocks
  • Confirm hb_gateway_client:location/2 resolves the node's own address

🤖 Generated with Claude Code

… tags

The AO ecosystem GQL query (`hb_gateway_client:location`) searches for
`Type: "Scheduler-Location"` but `generate_new_location/5` was uploading
the signed TABM directly via `hb_client:upload`, which serialises keys
using HyperBEAM's lowercase-key convention, producing tags such as
`type: location`.

Replace the upload call with `upload_to_arweave/4`, which builds a
`#tx{}` data item directly with the CamelCase tag names required by the
AO protocol (`Type`, `Data-Protocol`, `Variant`, `Url`), signs it with
`ar_bundles:sign_item`, and posts the serialised bytes via
`dev_arweave:post_binary_ans104`. The internal TABM representation
(stored in the local cache and returned to callers) is unchanged.

`upload_to_arweave/4` respects whichever bundler is configured:
`bundler_httpsig` takes precedence over `bundler_ans104`; if neither is
set the upload is skipped and an event is logged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant