In this tutorial, we’ll show you how to write a simple script that can fetch a Farcaster user’s casts and verify their authenticity. All you need is a web browser to get started.
The final code is available on Replit and you can open it to see how it works if you’d like. If you prefer to learn by doing, we recommend following these steps which will walk you through creating the app from scratch.
Before writing code, you’ll need to set up a Node.js environment. You can use your local Node.js environment if you have one handy. If you don’t we recommend using replit, which is a browser based IDE for programming:
You’ll also need an Ethereum node to talk to the Facaster Registry contract. We recommend using Alchemy, which is free. The steps below may be slightly different if you’re signing up for the first time:
https://eth-rinkeby.alchemyapi.io/v2/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx..
part, which is your Alchemy Secret, which you will need later. Store it somewhere for now.Switch back to Replit and go to the Shell tab in the right pane and run this code:
npm install ethers [email protected]
This installs ethers, a library for working with Ethereum and got, a library for making HTTP requests. You may see some warnings about a missing package.json, which you can ignore.