Content Watcher Service

The Content Watcher Service monitors and retrieves the latest feed state, including content updates, reactions, and other user interactions on the Frequency network. It ensures that applications can stay up-to-date with the latest content and user activity.

API Reference

Configuration

ℹ️ Feel free to adjust your environment variables to taste. This application recognizes the following environment variables:

NameDescriptionRange/TypeRequired?Default
API_PORTHTTP port that the application listens on1025 - 655353000
BLOCKCHAIN_SCAN_INTERVAL_SECONDSHow many seconds to delay between successive scans of the chain for new content (after end of chain is reached)> 012
CACHE_KEY_PREFIXPrefix to use for Redis cache keysstringcontent-watcher:
FREQUENCY_API_WS_URLBlockchain API Websocket URLws(s): URLY
FREQUENCY_TIMEOUT_SECSFrequency chain connection timeout limit; app will terminate if disconnected longerinteger10
IPFS_BASIC_AUTH_SECRETIf required for read requests, put Infura auth token here, or leave blank for default Kubo RPCstringNblank
IPFS_BASIC_AUTH_USERIf required for read requests, put Infura Project ID here, or leave blank for default Kubo RPCstringNblank
IPFS_ENDPOINTURL to IPFS endpointURLY
IPFS_GATEWAY_URLIPFS gateway URL '[CID]' is a token that will be replaced with an actual content IDURL templateY
QUEUE_HIGH_WATERMax number of jobs allowed on the queue before blockchain scan will be paused to allow queue to drain>= 1001000
REDIS_URLConnection URL for RedisURLY
STARTING_BLOCKBlock number from which the service will start scanning the chain> 01
WEBHOOK_FAILURE_THRESHOLDNumber of failures allowed in the provider webhook before the service is marked down> 03
WEBHOOK_RETRY_INTERVAL_SECONDSNumber of seconds between provider webhook retry attempts when failing> 010
API_TIMEOUT_MSApi timeout limit in milliseconds> 05000
API_BODY_JSON_LIMITApi json body size limit in string (some examples: 100kb or 5mb or etc)string1mb

Best Practices

  • Efficient Polling: Implement efficient polling mechanisms to minimize load on the service.
  • Webhook Security: Secure webhooks by verifying the source of incoming requests.
  • Rate Limiting: Apply rate limiting to prevent abuse and ensure fair usage of the service.