Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Flags that can also be load in .env file Port = flag.String("port", "8080", "RPC gateway port, e.g. 8080") Metrics = flag.Bool("metrics", false, "Enable prometheus metrics") MetricsPort = flag.String("metricsPort", "", "Metrics server port") EnableRateLimit = flag.Bool("enableRateLimit", false, "Enable rate limit") RateLimitWithoutAuth = flag.Int("rateLimitWithoutAuth", 100, "Rate limit per second without auth") RateLimitWithAuth = flag.Int("rateLimitWithAuth", 0, "Rate limit per second with auth (0: no limit)") // Flags that do not exist in .env.example file Pprof = flag.Bool("pprof", false, "Enable pprof") Replica = flag.Int("replica", 1, "replica rpcs to send request") CacheTTL = flag.Uint("cache_ttl", 10, "Cache TTL in minutes") LogLevel = flag.Int("logLevel", 1, "Log level, -1: trace, 0: debug, 1: info, 2: warn, 3: error, 4: fatal, 5: panic") LogCaller = flag.Bool("logCaller", false, "Log caller") RPCTimeout = flag.Int("rpcTimeout", 20, "RPC timeout in seconds") RPCHealthCheckInterval = flag.Int("rpcHealthCheckInterval", 1, "RPC health check interval in minutes") // Transformed flags for easier use AdditionalRPCs = make(map[int64][]string) FallbackRPCs = make(map[int64][]string) CacheableMethods = make(map[string]bool) )
Functions ¶
Types ¶
type RPCGroup ¶
type RPCGroup []*RPC // e.g. `[{"chainID":1,"rpc":["https://eth.llamarpc.com","https://rpc.builder0x69.io"]}]`
Click to show internal directories.
Click to hide internal directories.