Graph Service

The Graph Service manages the social graphs, including follow/unfollow actions, blocking users, and other social interactions. It allows applications to maintain and query the social connections between users on the Frequency network.

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 (after end of chain is reached)> 0180
CACHE_KEY_PREFIXPrefix to use for Redis cache keysstringcontent-watcher:
CAPACITY_LIMITMaximum amount of provider capacity this app is allowed to use (per epoch) type: 'percentage' 'amount' value: number (may be percentage, ie '80', or absolute amount of capacity)JSON (example)Y
DEBOUNCE_SECONDSNumber of seconds to retain pending graph updates in the Redis cache to avoid redundant fetches from the chain>= 0
FREQUENCY_API_WS_URLBlockchain API Websocket URLws(s): URLY
FREQUENCY_TIMEOUT_SECSFrequency chain connection timeout limit; app will terminate if disconnected longerinteger10
GRAPH_ENVIRONMENT_TYPEGraph environment type.Mainnet|TestnetPaseoY
WEBHOOK_FAILURE_THRESHOLDNumber of retry attempts to make when sending a webhook notification> 03
WEBHOOK_RETRY_INTERVAL_SECONDSNumber of seconds between provider webhook retry attempts when failing> 010
PROVIDER_ACCOUNT_SEED_PHRASESeed phrase for provider MSA control keystringY
PROVIDER_IDProvider MSA IdintegerY
QUEUE_HIGH_WATERMax number of jobs allowed on the 'graphUpdateQueue' before blockchain scan will be paused to allow queue to drain>= 1001000
REDIS_URLConnection URL for RedisURLY
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
AT_REST_ENCRYPTION_KEY_SEEDThis secret seed is used for generating an encryption/decryption key for encrypted sensitive data at reststringY

Best Practices

  • Data Integrity: Ensure the integrity of social graph data by implementing robust validation checks.
  • Efficient Queries: Optimize queries to handle large social graphs efficiently.
  • User Privacy: Protect user privacy by ensuring that graph data is only accessible to authorized entities.