Skip to content

Commit

Permalink
Merge pull request #42 from sudoblockio/backend-v0.2.0
Browse files Browse the repository at this point in the history
Backend v0.2.0
  • Loading branch information
robcxyz authored Sep 23, 2022
2 parents 74756fd + feac8b8 commit fab16e3
Show file tree
Hide file tree
Showing 66 changed files with 2,489 additions and 3,025 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ jobs:
uses: actions/checkout@v2

- name: Bring up DBs
run: make up-dbs
run: |
make up-dbs
make ps
- name: Check DBs
run: make ps
- uses: actions/setup-go@v2
with:
go-version: '1.18'

- name: Run tests
run: cd src && go test ./... -v

- name: Bring up stack
run: make up

- name: Check stack
run: make ps

- name: Run tests
run: cd tests && go test ./... -v
13 changes: 1 addition & 12 deletions .github/workflows/push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,9 @@ jobs:
max-parallel: 1
matrix:
include:
# Push to all testnets
- cluster: prod-ams
network_name: sejong
network_version: v2
- cluster: prod-ams
network_name: lisbon
network_version: v2
- cluster: prod-ams
network_name: berlin
network_version: v2

# Push to mainnet
- cluster: prod-ams
network_name: mainnet
network_name: berlin
network_version: v2

steps:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
max-parallel: 1
matrix:
include:

- cluster: prod-sng
network_name: sejong
network_version: v2
Expand All @@ -81,11 +82,23 @@ jobs:
network_name: berlin
network_version: v2

- cluster: prod-ams
network_name: sejong
network_version: v2
- cluster: prod-ams
network_name: lisbon
network_version: v2

# Push to mainnet
- cluster: prod-sng
network_name: mainnet
network_version: v2

# Push to mainnet
- cluster: prod-ams
network_name: mainnet
network_version: v2

steps:

- name: Checkout charts repo
Expand Down
29 changes: 18 additions & 11 deletions src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,28 @@ type configType struct {
ConsumerPartitionStartOffset int `envconfig:"CONSUMER_PARTITION_START_OFFSET" required:"false" default:"1"`

// DB
DbDriver string `envconfig:"DB_DRIVER" required:"false" default:"postgres"`
DbHost string `envconfig:"DB_HOST" required:"false" default:"localhost"`
DbPort string `envconfig:"DB_PORT" required:"false" default:"5432"`
DbUser string `envconfig:"DB_USER" required:"false" default:"postgres"`
DbPassword string `envconfig:"DB_PASSWORD" required:"false" default:"changeme"`
DbName string `envconfig:"DB_DBNAME" required:"false" default:"postgres"`
DbSslmode string `envconfig:"DB_SSL_MODE" required:"false" default:"disable"`
DbTimezone string `envconfig:"DB_TIMEZONE" required:"false" default:"UTC"`
DbMaxIdleConnections int `envconfig:"DB_MAX_IDLE_CONNECTIONS" required:"false" default:"2"`
DbMaxOpenConnections int `envconfig:"DB_MAX_OPEN_CONNECTIONS" required:"false" default:"10"`
DbRetrySleep time.Duration `envconfig:"DB_RETRY_SLEEP" required:"false" default:"1s"`
DbDriver string `envconfig:"DB_DRIVER" required:"false" default:"postgres"`
DbHost string `envconfig:"DB_HOST" required:"false" default:"localhost"`
DbPort string `envconfig:"DB_PORT" required:"false" default:"5432"`
DbUser string `envconfig:"DB_USER" required:"false" default:"postgres"`
DbPassword string `envconfig:"DB_PASSWORD" required:"false" default:"changeme"`
DbName string `envconfig:"DB_DBNAME" required:"false" default:"postgres"`
DbSslmode string `envconfig:"DB_SSL_MODE" required:"false" default:"disable"`
DbTimezone string `envconfig:"DB_TIMEZONE" required:"false" default:"UTC"`
DbMaxIdleConnections int `envconfig:"DB_MAX_IDLE_CONNECTIONS" required:"false" default:"2"`
DbMaxOpenConnections int `envconfig:"DB_MAX_OPEN_CONNECTIONS" required:"false" default:"10"`
DbRetrySleep time.Duration `envconfig:"DB_RETRY_SLEEP" required:"false" default:"1s"`
DbLoaderChannelBuffer int `envconfig:"DB_LOADER_CHANNEL_BUFFER" required:"false" default:"1000"`
DbIdleChannelWait time.Duration `envconfig:"DB_IDLE_CHANNEL_WAIT" required:"false" default:"100ms"`
DbBufferWait time.Duration `envconfig:"DB_BUFFER_WAIT" required:"false" default:"100ms"`

// GORM
GormLoggingThresholdMilli int `envconfig:"GORM_LOGGING_THRESHOLD_MILLI" required:"false" default:"250"`

// Metrics
MetricsPrefix string `envconfig:"METRICS_PREFIX" required:"false" default:"/metrics"`
MetricsPort string `envconfig:"METRICS_PORT" required:"false" default:"9400"`

// Redis
RedisHost string `envconfig:"REDIS_HOST" required:"false" default:"localhost"`
RedisPort string `envconfig:"REDIS_PORT" required:"false" default:"6379"`
Expand Down
Loading

0 comments on commit fab16e3

Please sign in to comment.