UNPKG

@stalkchain/grpc-pool

Version:

High-availability gRPC connection pooling module with active-active configuration, deduplication, and stale connection detection

62 lines 2.26 kB
/** * constants.ts - Constants and enums for stalkchain-grpc-pool * * Defines all constant values used throughout the package. * These values never change between environments. * * @module constants * @author StalkChain Team * @version 0.1.0 */ /** * Solana commitment levels for transaction confirmation * * @enum CommitmentLevel */ export declare enum CommitmentLevel { PROCESSED = "processed", CONFIRMED = "confirmed", FINALIZED = "finalized" } /** * Default configuration values */ export declare const DEFAULT_CONFIG: { /** Maximum number of signatures to keep in deduplication cache */ readonly MAX_DEDUP_SIGNATURES: 10000; /** Time to live for deduplication cache entries (1 minute in milliseconds) */ readonly DEDUP_TTL_MS: number; /** Default connection timeout in milliseconds */ readonly CONNECTION_TIMEOUT_MS: 5000; /** Default ping interval in milliseconds */ readonly PING_INTERVAL_MS: 30000; /** Stale connection detection timeout in milliseconds (2 minutes) */ readonly STALE_CONNECTION_TIMEOUT_MS: number; /** Fraction of stale timeout to use for check interval (1/10th) */ readonly STALE_CHECK_FRACTION: 0.1; /** Minimum stale check interval in milliseconds (1 second) */ readonly MIN_STALE_CHECK_INTERVAL_MS: number; /** Maximum stale check interval in milliseconds (60 seconds) */ readonly MAX_STALE_CHECK_INTERVAL_MS: number; /** Initial retry delay in milliseconds (500ms) */ readonly INITIAL_RETRY_DELAY_MS: 500; /** Maximum retry delay in milliseconds (30 seconds) */ readonly MAX_RETRY_DELAY_MS: number; /** Retry backoff multiplier (factor of 2) */ readonly RETRY_BACKOFF_FACTOR: 2; /** Default commitment level for subscriptions */ readonly DEFAULT_COMMITMENT: CommitmentLevel.CONFIRMED; }; /** * Known Solana gRPC endpoints for different providers */ export declare const KNOWN_ENDPOINTS: { readonly SOLANA_TRACKER: { readonly PRIMARY: "https://grpc.solanatracker.io"; readonly SECONDARY: "https://grpc-us.solanatracker.io"; }; readonly PUBLIC_NODE: { readonly PRIMARY: "https://solana-yellowstone-grpc.publicnode.com"; }; }; //# sourceMappingURL=constants.d.ts.map