The @elizaos/plugin-farcaster plugin enables elizaOS agents to interact with the Farcaster protocol through the Neynar API. This plugin provides comprehensive functionality for casting, replying, and engaging with the Farcaster ecosystem.
# RequiredFARCASTER_NEYNAR_API_KEY=your-neynar-api-keyFARCASTER_SIGNER_UUID=your-signer-uuidFARCASTER_FID=12345# Feature TogglesENABLE_CAST=trueENABLE_ACTION_PROCESSING=falseFARCASTER_DRY_RUN=false# Timing Configuration (in minutes)CAST_INTERVAL_MIN=90CAST_INTERVAL_MAX=180FARCASTER_POLL_INTERVAL=2ACTION_INTERVAL=5# Other OptionsCAST_IMMEDIATELY=falseACTION_TIMELINE_TYPE=ForYouMAX_ACTIONS_PROCESSING=1MAX_CAST_LENGTH=320
{ name: "SEND_CAST", description: "Posts a cast (message) on Farcaster", examples: [ "Can you post about the new ElizaOS features on Farcaster?", "Share on Farcaster that we just launched version 2.0!" ]}
{ name: "REPLY_TO_CAST", description: "Replies to a cast on Farcaster", examples: [ "Someone asked about ElizaOS on Farcaster, can you reply?", "Reply to that cast and thank them for the feedback" ]}
class FarcasterInteractionManager { // Polls for mentions at FARCASTER_POLL_INTERVAL // Processes up to MAX_ACTIONS_PROCESSING per cycle // Uses AI to determine appropriate responses async start() // Start monitoring async stop() // Stop monitoring async processInteractions() // Process pending interactions}
// Configurable polling intervals to balance responsivenessFARCASTER_POLL_INTERVAL=2 // Minutes between pollsACTION_INTERVAL=5 // Minutes between action processingMAX_ACTIONS_PROCESSING=1 // Actions per cycle