Skip to content

Use AT protocol triggers#9

Merged
ismellike merged 13 commits intomainfrom
at-triggers
Dec 11, 2025
Merged

Use AT protocol triggers#9
ismellike merged 13 commits intomainfrom
at-triggers

Conversation

@ismellike
Copy link
Collaborator

@ismellike ismellike commented Dec 5, 2025

Working:

2025-12-08T18:06:23.779456Z  INFO process_message{msg=ChainMessage { service_id: 5e0cb9309b6f966d4119aba114ca4cf53c73040f22be6def6adfa0c9d42c08f3, workflow_id: WorkflowId("at_protocol_native"), envelope: Envelope { eventId: 0x735ad1cac76be5c16295e345c714075e7757d519, ordering: 0x000000000000000000000000, payload: 0x000000000000000000000000000000000000000000000000000000000000002053e0003d97333d9a41ae69c5235881aaedf1e627bd7628e5e82d13baba9c70b90000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000064574a7234f3400000000000000000000000000000000000000000000000000000000000000206469643a706c633a366577706971706d61637978626e686c6a6f6c61786c717900000000000000000000000000000000000000000000000000000000000000047465737400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004661743a2f2f6469643a706c633a366577706971706d61637978626e686c6a6f6c61786c71792f6170702e62736b792e666565642e706f73742f336d37696d6e6d35696532326e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004661743a2f2f6469643a706c633a366577706971706d61637978626e686c6a6f6c61786c71792f6170702e62736b792e666565642e706f73742f336d37696667366f61647332780000000000000000000000000000000000000000000000000000 }, trigger_data: AtProtoEvent { sequence: 0, timestamp: 1765217182895924, repo: "did:plc:6ewpiqpmacyxbnhljolaxlqy", collection: "app.bsky.feed.post", rkey: "3m7imnm5ie22n", action: Create, cid: Some("bafyreifoozfszzilgdlq7rf6albt2jssm7wrh5nodllns3tfq46aflluou"), record: Some(Object {"$type": String("app.bsky.feed.post"), "createdAt": String("2025-12-08T18:06:22.793Z"), "langs": Array [String("en")], "reply": Object {"parent": Object {"cid": String("bafyreihdyxgushhlhfmqhehku76ntxvqw3srskj2acto47iy3d6sga7f64"), "uri": String("at://did:plc:6ewpiqpmacyxbnhljolaxlqy/app.bsky.feed.post/3m7ifg6oads2x")}, "root": Object {"cid": String("bafyreihdyxgushhlhfmqhehku76ntxvqw3srskj2acto47iy3d6sga7f64"), "uri": String("at://did:plc:6ewpiqpmacyxbnhljolaxlqy/app.bsky.feed.post/3m7ifg6oads2x")}}, "text": String("test")}) }, submit: Aggregator { url: "http://localhost:8200/", component: Component { source: Download { uri: RiString("ipfs://QmQ1igbrewuNBpnATSwZsFDexDEnhgpHs2Zobe3uWXpHQi"), digest: fbc1b111c3dd6518f8c463ad46e5c7180740f91941e0e2741b5272b32a9c51fb }, permissions: Permissions { allowed_http_hosts: All, file_system: true, raw_sockets: false, dns_resolution: false }, fuel_limit: None, time_limit_seconds: None, config: {"evm:31337": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"}, env_keys: {} }, signature_kind: SignatureKind { algorithm: Secp256k1, prefix: Some(Eip191) } } } subsys="Submission"}:submit_to_aggregator{url="http://localhost:8200/" subsys="Submission" service_id=5e0cb9309b6f966d4119aba114ca4cf53c73040f22be6def6adfa0c9d42c08f3 workflow_id=at_protocol_native event_id=735ad1cac76be5c16295e345c714075e7757d519}: wavs::subsystems::submission: Successfully submitted to aggregator http://localhost:8200/:⁠ tx_hash=0x8e7d72115ce8ccb522e27be5b91d9c21898481c76069a160d390c63ead9b6a6b, payload_count=1, service_id=5e0cb9309b6f966d4119aba114ca4cf53c73040f22be6def6adfa0c9d42c08f3, workflow_id=at_protocol_native

TODO:

todo: test + wire up
@ismellike ismellike requested a review from ueco-jb December 8, 2025 20:52
@ismellike ismellike marked this pull request as ready for review December 8, 2025 20:52
Copy link
Member

@ueco-jb ueco-jb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation, found mostly few nitpicks. 👍

vars:
OPERATOR_CID:
sh: jq -r '.cid' {{.DEPLOYMENTS_ARTIFACTS_PATH}}/operator-cid.json
TARGET_HANDLE: "ismellike.bsky.social"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should come from .env.

Copy link
Collaborator Author

@ismellike ismellike Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its better to have it as a config var. All nodes will know which target to handle since it's included in service json. Typically env is reserved for secrets instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with the config, let's just not have it hardcoded in the taskfile. 😀

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still has to be set somewhere in a taskfile what about we set in config.yml then?

Comment on lines +248 to +249
// Construct the post URI from the event data (repo already includes full DID prefix)
let post_uri = format!("at://{}/app.bsky.feed.post/{}", repo, rkey);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repo here is used straight up from the event, without validation. Simple repo.starts_with("did:") should cover that.

Copy link
Collaborator Author

@ismellike ismellike Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repo == did no need to validate if we get to this point I think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is called just at the beginning of handle event, where that field is decoded into a string.
https://github.com/Lay3rLabs/wavs-wasi/blob/c02f62264fdd279adc71622f595e2a6cd7da3c92/wit-definitions/types/wit/events.wit#L41
If I'm not missing anything, no validation happens before.

Copy link
Member

@ueco-jb ueco-jb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just not merge that target handle in the bootstrap.yml and we're good to go!
Great work Gabe! Now it's a very solid example of WAVS use and a great demo. 🔥

@ismellike ismellike merged commit ab67093 into main Dec 11, 2025
@ueco-jb ueco-jb deleted the at-triggers branch December 11, 2025 20:15
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.

2 participants