To install dependencies:
bun install
To run:
bun start
Sonatabot adds a comment to all the casts that are indexed.
It uses an ED25519
signer from the bot farcaster account to sign messages.
To set up the bot, you need to generate a SIGNER_PRIVATE_KEY
. Follow these steps:
-
Add the following environment variables to your
.env
file:APP_FID
APP_MNEMONIC
-
Run the following command to generate the signer:
bun generate-signer
-
This command will return:
- A private key (to be used as
SIGNER_PRIVATE_KEY
) - A deeplink URL
- A private key (to be used as
-
Open the deeplink URL in Warpcast to authorize the private key.
-
Add the
SIGNER_PRIVATE_KEY
to your.env
file:SIGNER_PRIVATE_KEY=your_generated_private_key
-
Run the following command to generate the signer:
bun test-signer
-
The bot should create a new cast saying 'Hello World!'
- Create a new Ubuntu droplet on Digital Ocean
- Access your droplet via SSH:
ssh root@your_droplet_ip
-
Install Node Version Manager (nvm):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash source ~/.bashrc
-
Install Node.js 20:
nvm install 20 nvm use 20
-
Install Bun:
# Install unzip (required for Bun installation) apt-get update && apt-get install unzip -y # Install Bun curl -fsSL https://bun.sh/install | bash source ~/.bashrc
-
Install PM2 globally:
npm install -g pm2
- Add the following secrets to your GitHub repository:
DROPLET_IP
: Your Digital Ocean droplet's IP addressDROPLET_USER
: Your droplet's username (usually 'root')DROPLET_PASSWORD
: Your droplet's password
Run these commands to verify everything is installed correctly:
nvm --version
bun --version
pm2 --version
Now your Droplet is ready for the CI/CD pipeline to deploy the application.