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:
Name | Description | Range/Type | Required? | Default |
---|---|---|---|---|
API_PORT | HTTP port that the application listens on | 1025 - 65535 | 3000 | |
BLOCKCHAIN_SCAN_INTERVAL_SECONDS | How many seconds to delay between successive scans of the chain (after end of chain is reached) | > 0 | 180 | |
CACHE_KEY_PREFIX | Prefix to use for Redis cache keys | string | content-watcher: | |
CAPACITY_LIMIT | Maximum 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_SECONDS | Number of seconds to retain pending graph updates in the Redis cache to avoid redundant fetches from the chain | >= 0 | ||
FREQUENCY_API_WS_URL | Blockchain API Websocket URL | ws(s): URL | Y | |
FREQUENCY_TIMEOUT_SECS | Frequency chain connection timeout limit; app will terminate if disconnected longer | integer | 10 | |
GRAPH_ENVIRONMENT_TYPE | Graph environment type. | Mainnet|TestnetPaseo | Y | |
WEBHOOK_FAILURE_THRESHOLD | Number of retry attempts to make when sending a webhook notification | > 0 | 3 | |
WEBHOOK_RETRY_INTERVAL_SECONDS | Number of seconds between provider webhook retry attempts when failing | > 0 | 10 | |
PROVIDER_ACCOUNT_SEED_PHRASE | Seed phrase for provider MSA control key | string | Y | |
PROVIDER_ID | Provider MSA Id | integer | Y | |
QUEUE_HIGH_WATER | Max number of jobs allowed on the 'graphUpdateQueue' before blockchain scan will be paused to allow queue to drain | >= 100 | 1000 | |
REDIS_URL | Connection URL for Redis | URL | Y | |
API_TIMEOUT_MS | Api timeout limit in milliseconds | > 0 | 5000 | |
API_BODY_JSON_LIMIT | Api json body size limit in string (some examples: 100kb or 5mb or etc) | string | 1mb | |
AT_REST_ENCRYPTION_KEY_SEED | This secret seed is used for generating an encryption/decryption key for encrypted sensitive data at rest | string | Y |
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.