Cover photo

Aligned zkQuiz NFT

วันนี้มาสอนรัน zkQuiz ของโปรเจค Aligned บน Github codespace โปรเจคของ Aligned Layer ระดมทุนไป 22M

https://cryptorank.io/ico/aligned-layer#funding-rounds

มาเริ่มรันกันเลย

1.เปิด Github Codespace เลือก Use this template รอจน Terminal ทำงานเสร็จ

2.Download Rust โดยใช้คำสั่ง

source <(wget -O - https://raw.githubusercontent.com/zunxbt/installation/main/rust.sh)

3.Download Foundry โดยใช้คำสั่ง

source <(wget -O - https://raw.githubusercontent.com/zunxbt/installation/main/foundry.sh)

4.Clone the repository โดยใช้คำสั่ง

git clone https://github.com/yetanotherco/aligned_layer.git && cd aligned_layer

5.สร้าง Wallet ใหม่หรือใครจะใช้ Wallet ของ Metamask ก็ข้ามข้อนี้ไป ใช้คำสั่ง

cast wallet new-mnemonic

6.เราจะได้เลข seed, เลข wallet และ private key มาตามภาพ

post image

7.ให้เราเอาsave เก็บข้อมูลไว้ แล้วโอนเหรียญ ETH จาก Holesky มาที่ address ที่เราสร้าง ใครไม่มีเหรียญ ETH ขอได้ที่

6.import wallet โดยใช้คำสั่ง

[ -d ~/.aligned_keystore ] && rm -rf ~/.aligned_keystore && echo "Deleted existing directory ~/.aligned_keystore." ; mkdir -p ~/.aligned_keystore && cast wallet import ~/.aligned_keystore/keystore0 --interactive

กรอก Private key แล้วตั้ง password อะไรก็ได้ที่เราต้องการ

7.Clone Aligned Layer repo โดยใช้คำสั่ง

[ -d aligned_layer ] && rm -rf aligned_layer && echo "Deleted existing aligned_layer directory." ; git clone https://github.com/yetanotherco/aligned_layer.git && cd aligned_layer/examples/zkquiz

8.รันคำสั่ง(ใช้เวลาประมาณ 15 นาที)

make answer_quiz KEYSTORE_PATH=~/.aligned_keystore/keystore0

9.รอจนขึ้น Enter keystore password: ให้เรากรอก password ที่เราตั้งไว้

10.ตอบคำถาม ตอบที่ละข้อนะ มันจะช้าหน่อย (Ans y , c , c , a , y)

11.รอจนขึ้น Transection hash ตามภาพ

post image

12.Capture หน้าจอประมาณนี้ไปโพสใน Twitter

post image

13. ให้โพสตาม twitter ของผม

https://x.com/iccc36006/status/1843644397826781218

14.เอาลิงคํ Twitter ไปโพสใน Discord ห้อง testnet

post image

เป็นอันเสร็จ ต้นฉบับมาจาก

https://github.com/zunxbt/Aligned-zkQuiz-NFT

และ

https://docs.alignedlayer.com/guides/2_build_your_first_aligned_application

เช่นเคยถ้าเห็นว่ามีประโยชน์อยากสนับสนุนสามารถ mint nft เพื่อเป็นกำลังใจได้