Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dkeysil committed Mar 12, 2024
1 parent bcdc956 commit 62efc2b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const (

EnvJsonRpcHost = "JSON_RPC_HOST"
EnvJsonRpcPort = "JSON_RPC_PORT"
EnvCacheJsonRpcCachePort = "CACHE_JSON_RPC_PORT"
EnvCacheRequestTimeout = "CACHE_REQUEST_TIMEOUT"
EnvCacheRequestInterval = "CACHE_REQUEST_INTERVAL"
EnvCacheSupportedChains = "CACHE_SUPPORTED_CHAINS"
EnvCacheJsonRpcCachePort = "JSON_RPC_CACHE_PORT"
EnvCacheRequestTimeout = "JSON_RPC_CACHE_TIMEOUT"
EnvCacheRequestInterval = "JSON_RPC_CACHE_INTERVAL"
EnvCacheSupportedChains = "JSON_RPC_CACHE_SUPPORTED_CHAINS"
)
6 changes: 3 additions & 3 deletions services/components/containers/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func NewBotContainerConfig(
config.EnvFortaHealthCheckPort: config.DefaultBotHealthCheckPort,
config.EnvFortaTokenExchangeURL: tokenExchangeURL,
config.EnvCacheJsonRpcCachePort: config.DefaultBotJSONRPCCachePort,
config.EnvCacheRequestTimeout: jrpcache.SDKRequestTimeout,
config.EnvCacheRequestInterval: jrpcache.SDKRequestInterval,
config.EnvCacheSupportedChains: jrpcache.SDKSupportedChains,
config.EnvCacheRequestTimeout: jrpcache.BotCacheRequestTimeoutSeconds,
config.EnvCacheRequestInterval: jrpcache.BotCacheRequestIntervalSeconds,
config.EnvCacheSupportedChains: jrpcache.BotCacheSupportedChains,
}
if botConfig.ChainID > 0 {
env[config.EnvFortaChainID] = fmt.Sprintf("%d", botConfig.ChainID)
Expand Down
14 changes: 7 additions & 7 deletions services/json-rpc/cache/json_rpc_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ import (
const (
ChainIDHeader = "X-Forta-Chain-ID"

// These values will be injected into the agent container to configure SDK
// SDKRequestTimeout timeout until the SDK must fallback to the RPC Node
// These values will be injected into the agent container to configure bot cache
// BotCacheRequestTimeout timeout until the bot must fallback to the RPC Node
// Value in seconds and can be a float.
SDKRequestTimeout = "5"
// SDKRequestInterval interval between SDK requests
BotCacheRequestTimeoutSeconds = "20"
// BotCacheRequestInterval interval between bot requests
// Value in seconds and can be a float.
SDKRequestInterval = "1"
// SDKSupportedChains comma separated list of supported chains
BotCacheRequestIntervalSeconds = "1"
// BotCacheSupportedChains comma separated list of supported chains
// Chains' data not filtered on the cache side.
SDKSupportedChains = "1,137,56,43114,42161,10,250,8453"
BotCacheSupportedChains = "1,137,56,43114,42161,10,250,8453"
)

type JsonRpcCache struct {
Expand Down

0 comments on commit 62efc2b

Please sign in to comment.