Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

del unuse config item #48

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 20 additions & 38 deletions cmd/server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,30 @@ import (
)

type Config struct {
LogLevel slog.Level `env:"LOG_LEVEL,optional"`
ServiceEndpoint string `env:"HTTP_SERVICE_ENDPOINT"`
DatabaseDSN string `env:"DATABASE_DSN"`
ChainEndpoint string `env:"CHAIN_ENDPOINT,optional"`
BeginningBlockNumber uint64 `env:"BEGINNING_BLOCK_NUMBER,optional"`
OperatorPrvKey string `env:"OPERATOR_PRIVATE_KEY,optional"`
LocalDBPath string `env:"LOCAL_DB_PATH,optional"`
MqttBrokerEndpoint string `env:"MQTT_BROKER_ENDPOINT,optional"`
MqttBrokerQoS string `env:"MQTT_BROKER_QOS,optional"`
MqttBrokerCertCAPath string `env:"MQTT_BROKER_CERT_CA_PATH,optional"`
MqttBrokerCertCrtPath string `env:"MQTT_BROKER_CERT_CRT_PATH,optional"`
MqttBrokerCertKeyPath string `env:"MQTT_BROKER_CERT_KEY_PATH,optional"`
IoIDProjectID uint64 `env:"IOID_PROJECT_ID,optional"`
IoIDRegistryEndpoint string `env:"IOID_REGISTRY_ENDPOINT,optional"`
IoIDRegistryContractAddr string `env:"IOID_REGISTRY_CONTRACT_ADDRESS,optional"`
IoIDContractAddr string `env:"IOID_CONTRACT_ADDRESS,optional"`
ProjectDeviceContractAddr string `env:"PROJECT_DEVICE_CONTRACT_ADDRESS,optional"`
W3bstreamProjectContractAddr string `env:"W3BSTREAM_PROJECT_CONTRACT_ADDRESS,optional"`
ProjectContractAddr string `env:"PROJECT_CONTRACT_ADDRESS,optional"`
env string `env:"-"`
LogLevel slog.Level `env:"LOG_LEVEL,optional"`
ServiceEndpoint string `env:"HTTP_SERVICE_ENDPOINT"`
DatabaseDSN string `env:"DATABASE_DSN"`
ChainEndpoint string `env:"CHAIN_ENDPOINT,optional"`
BeginningBlockNumber uint64 `env:"BEGINNING_BLOCK_NUMBER,optional"`
IoIDProjectID uint64 `env:"IOID_PROJECT_ID,optional"`
IoIDRegistryContractAddr string `env:"IOID_REGISTRY_CONTRACT_ADDRESS,optional"`
IoIDContractAddr string `env:"IOID_CONTRACT_ADDRESS,optional"`
ProjectContractAddr string `env:"PROJECT_CONTRACT_ADDRESS,optional"`
env string `env:"-"`
}

var (
defaultTestnetConfig = &Config{
LogLevel: slog.LevelInfo,
ServiceEndpoint: ":9000",
DatabaseDSN: "postgres://postgres:mysecretpassword@postgres:5432/w3bstream?sslmode=disable",
ChainEndpoint: "https://babel-api.testnet.iotex.io",
BeginningBlockNumber: 28685000,
LocalDBPath: "./local_db",
MqttBrokerQoS: "ONCE",
MqttBrokerCertCAPath: "/etc/pebble/root.pem",
MqttBrokerCertCrtPath: "/etc/pebble/tls-cert.pem",
MqttBrokerCertKeyPath: "/etc/pebble/tls-key.pem",
IoIDProjectID: 915,
IoIDRegistryEndpoint: "did.iotex.me",
IoIDRegistryContractAddr: "0x0A7e595C7889dF3652A19aF52C18377bF17e027D",
IoIDContractAddr: "0x45Ce3E6f526e597628c73B731a3e9Af7Fc32f5b7",
ProjectDeviceContractAddr: "0xF4d6282C5dDD474663eF9e70c927c0d4926d1CEb",
W3bstreamProjectContractAddr: "0x6AfCB0EB71B7246A68Bb9c0bFbe5cD7c11c4839f",
ProjectContractAddr: "0xf07336E1c77319B4e740b666eb0C2B19D11fc14F",
env: "TESTNET",
LogLevel: slog.LevelInfo,
ServiceEndpoint: ":9000",
DatabaseDSN: "postgres://postgres:mysecretpassword@postgres:5432/w3bstream?sslmode=disable",
ChainEndpoint: "https://babel-api.testnet.iotex.io",
BeginningBlockNumber: 28685000,
IoIDProjectID: 915,
IoIDRegistryContractAddr: "0x0A7e595C7889dF3652A19aF52C18377bF17e027D",
IoIDContractAddr: "0x45Ce3E6f526e597628c73B731a3e9Af7Fc32f5b7",
ProjectContractAddr: "0xf07336E1c77319B4e740b666eb0C2B19D11fc14F",
env: "TESTNET",
}
)

Expand Down
Loading