2023-04-18 08:09:31 -07:00
|
|
|
// Package config implement a simple configuration package.
|
|
|
|
// It define a type [Configuration] that represent the aplication configuration
|
|
|
|
package config
|
|
|
|
|
|
|
|
// Configuration is the configuration for the job
|
|
|
|
type Configuration struct {
|
2023-10-20 14:30:34 -07:00
|
|
|
JobID string `env:"JOB_ID,required"`
|
|
|
|
LogLevel string `env:"LOG_LEVEL,default=INFO"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type NotionalConfiguration struct {
|
2024-03-27 10:42:04 -07:00
|
|
|
Environment string `env:"ENVIRONMENT,required"`
|
|
|
|
CoingeckoURL string `env:"COINGECKO_URL,required"`
|
|
|
|
CoingeckoHeaderKey string `env:"COINGECKO_HEADER_KEY"`
|
|
|
|
CoingeckoApiKey string `env:"COINGECKO_API_KEY"`
|
|
|
|
CacheURL string `env:"CACHE_URL,required"`
|
|
|
|
CachePrefix string `env:"CACHE_PREFIX,required"`
|
|
|
|
NotionalChannel string `env:"NOTIONAL_CHANNEL,required"`
|
|
|
|
P2pNetwork string `env:"P2P_NETWORK,required"`
|
|
|
|
AwsRegion string `env:"AWS_REGION"`
|
|
|
|
AwsBucket string `env:"AWS_BUCKET"`
|
2023-04-18 08:09:31 -07:00
|
|
|
}
|
|
|
|
|
2023-10-20 14:30:34 -07:00
|
|
|
type TransferReportConfiguration struct {
|
|
|
|
MongoURI string `env:"MONGODB_URI,required"`
|
|
|
|
MongoDatabase string `env:"MONGODB_DATABASE,required"`
|
|
|
|
PageSize int64 `env:"PAGE_SIZE,default=100"`
|
2024-01-02 05:38:03 -08:00
|
|
|
PricesType string `env:"PRICES_TYPE,required"`
|
|
|
|
PricesUri string `env:"PRICES_URI,required"`
|
2023-10-20 14:30:34 -07:00
|
|
|
OutputPath string `env:"OUTPUT_PATH,required"`
|
2023-11-28 05:16:40 -08:00
|
|
|
P2pNetwork string `env:"P2P_NETWORK,required"`
|
2023-10-20 14:30:34 -07:00
|
|
|
}
|
|
|
|
|
2024-01-02 05:38:03 -08:00
|
|
|
type HistoricalPricesConfiguration struct {
|
|
|
|
MongoURI string `env:"MONGODB_URI,required"`
|
|
|
|
MongoDatabase string `env:"MONGODB_DATABASE,required"`
|
|
|
|
P2pNetwork string `env:"P2P_NETWORK,required"`
|
|
|
|
CoingeckoURL string `env:"COINGECKO_URL,required"`
|
|
|
|
CoingeckoHeaderKey string `env:"COINGECKO_HEADER_KEY"`
|
|
|
|
CoingeckoApiKey string `env:"COINGECKO_API_KEY"`
|
|
|
|
RequestLimitTimeSeconds int `env:"REQUEST_LIMIT_TIME_SECONDS,default=5"`
|
|
|
|
PriceDays string `env:"PRICE_DAYS,default=max"`
|
|
|
|
}
|
|
|
|
|
2024-01-30 07:19:31 -08:00
|
|
|
type MigrateSourceTxConfiguration struct {
|
|
|
|
MongoURI string `env:"MONGODB_URI,required"`
|
|
|
|
MongoDatabase string `env:"MONGODB_DATABASE,required"`
|
|
|
|
PageSize int `env:"PAGE_SIZE,default=100"`
|
|
|
|
ChainID int64 `env:"CHAIN_ID,default=0"`
|
|
|
|
FromDate string `env:"FROM_DATE,required"`
|
|
|
|
ToDate string `env:"TO_DATE,required"`
|
|
|
|
TxTrackerURL string `env:"TX_TRACKER_URL,required"`
|
|
|
|
TxTrackerTimeout int64 `env:"TX_TRACKER_TIMEOUT,default=30"`
|
|
|
|
SleepTimeSeconds int64 `env:"SLEEP_TIME_SECONDS,default=5"`
|
|
|
|
}
|
|
|
|
|
2024-02-22 09:58:45 -08:00
|
|
|
type ProtocolsStatsConfiguration struct {
|
2024-03-18 06:21:42 -07:00
|
|
|
InfluxUrl string `env:"INFLUX_URL"`
|
|
|
|
InfluxToken string `env:"INFLUX_TOKEN"`
|
|
|
|
InfluxOrganization string `env:"INFLUX_ORGANIZATION"`
|
|
|
|
InfluxBucket30Days string `env:"INFLUX_BUCKET_30_DAYS"`
|
|
|
|
InfluxBucketInfinite string `env:"INFLUX_BUCKET_INFINITE"`
|
|
|
|
ProtocolsJson string `env:"PROTOCOLS_JSON"`
|
|
|
|
Protocols []Protocol `json:"PROTOCOLS"`
|
2024-02-22 09:58:45 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
type Protocol struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
Url string `json:"url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ProtocolsActivityConfiguration struct {
|
|
|
|
ProtocolsStatsConfiguration
|
|
|
|
}
|