···1616 turn on developer mode for the more advance options.
1717- [various sdks](https://atproto.com/sdks) - atproto.com has a list of various sdks if you'd like to write the code to
1818 solve these challenges.
1919+- [http ref](https://docs.bsky.app/docs/category/http-reference) - You can also make calls directly to the PDS via HTTP
2020+ endpoints. You will find most SDks match the naming conventions of the endpoints listed in the http ref.
19212022We are going to start simple. Everyone knows they have a handle, but `did` you know you also have a unique id called a
2123[did](https://atproto.com/specs/did)? This is a unique identifier for your identity that never changes. This comes in
+11-1
shared/challenges_markdown/two/part_one.md
···1717}
1818```
19192020+This is what makes up the public data on the atmosphere. All of your account's Bluesky
2121+posts, [tangled](https://tangled.org/) repos,
2222+[standard.site](https://standard.site/) docs, everything like that is stored publicly on your repo as an atproto record.
2323+2024The records are stored in collections and have record keys. This is usually expressed by an at-uri like
2125`at://did:plc:rnpkyqnmsw4ipey6eotbdnnf/app.bsky.feed.like/3mhbs2cnrl22r`.
2226···2630- `app.bsky.feed.like` is the collection
2731- `3mhbs2cnrl22r` is the record key
28322929-Using what you learned from day 1 find the following record `{{at_uri}}` and enter the verification code
3333+You will also notice that the record has a `$type` field, `app.bsky.feed.like` for the above record. This is
3434+the [lexicon schema](https://atproto.com/specs/lexicon) for the record. There will be more on this later, but for now
3535+it's important to know it's a [NSID](https://atproto.com/guides/glossary#nsid-namespaced-id) of the atproto app and
3636+shows how the record should look.
3737+3838+Using what you learned from day 1 about finding the users PDS and their repo, find the following record `{{at_uri}}` and
3939+enter the verification code
3040found in the record
3141for it below
+10
shared/challenges_markdown/two/part_two.md
···11+Great! You now know where to find records, now it's time to learn how to write records. When writing atproto records you
22+can use 3 methods for this:
33+44+- [com.atproto.repo.createRecord](https://docs.bsky.app/docs/api/com-atproto-repo-create-record) Creates a new atproto
55+ record, errors if it has the same record key already in the collection
66+- [com.atproto.repo.putRecord](https://docs.bsky.app/docs/api/com-atproto-repo-put-record) Updates an existing
77+ atproto record if a record exists with the same record key, if not creates a new record
88+- [com.atproto.repo.applyWrites](https://docs.bsky.app/docs/api/com-atproto-repo-apply-writes) Batch endpoint for writes
99+ that allows you to create, update, or delete multiple records.
1010+111Great job beating Part 1! Now onto Part 2.
212313Keeping it simple proof of concept, blah, blah will have a real one here another time. Add a new field `partTwo` to the
+11-11
shared/src/advent/challenges/day_two.rs
···3333 true
3434 }
35353636+ fn requires_manual_verification_part_two(&self) -> bool {
3737+ true
3838+ }
3939+3640 /// Create a record via the challenge agent and return the at_uri as additional context
3741 async fn build_additional_context(
3842 &self,
···112116 ));
113117 };
114118115115- let expected_code =
116116- challenge
117117- .verification_code_one
118118- .ok_or(AdventError::ShouldNotHappen(
119119- "no verification code for day 2 challenge".to_string(),
120120- ))?;
119119+ let expected_code = challenge
120120+ .verification_code_one
121121+ .ok_or(AdventError::ShouldNotHappen(
122122+ "no verification code for day 2 challenge".to_string(),
123123+ ))?;
121124122125 Ok(if submitted_code == expected_code {
123126 ChallengeCheckResponse::Correct
124127 } else {
125125- ChallengeCheckResponse::Incorrect(format!(
126126- "The code {} is incorrect",
127127- submitted_code
128128- ))
128128+ ChallengeCheckResponse::Incorrect(format!("The code {} is incorrect", submitted_code))
129129 })
130130 }
131131···150150 cid: None,
151151 collection: advent::challenge::Day::NSID.parse().unwrap(),
152152 repo: did.parse().unwrap(),
153153- rkey: "1".parse().unwrap(),
153153+ rkey: "2".parse().unwrap(),
154154 }
155155 .into(),
156156 )