ipld-eth-beacon-indexer/internal/boot/boot.go
Abdul Rabbani 827475f029 Add DB Connection and Logging
* Utilize LogRus
* Create a DB connection using PGX.
* Create an internal boot package for starting the application.
2022-04-20 15:44:15 -04:00

24 lines
632 B
Go

package boot
import (
log "github.com/sirupsen/logrus"
"github.com/vulcanize/ipld-ethcl-indexer/pkg/database/sql/postgres"
)
func setUpLightHouse() {
}
// This function will perform some boot operations.
// 1. Setup a logger
// 2. Connect to the database.
// 3. Connect to to the lighthouse client.
func BootApplication(dbHostname string, dbPort int, dbName string, dbUsername string, dbPassword string, driverName string) (*postgres.DB, error) {
log.Debug("Setting up DB connection")
DB, err := SetupDb(dbHostname, dbPort, dbName, dbUsername, dbPassword, driverName)
if err != nil {
return nil, err
}
return DB, nil
}