Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 3ec480c

Browse files
committed
Allow starting a minimum server
1 parent 2c3d9b4 commit 3ec480c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/github.com/stellar/gateway/app.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func NewApp(config config.Config, migrateFlag bool) (app *App, err error) {
8484

8585
log.Print("Initializing Authorizing account")
8686

87-
if config.Accounts.AuthorizingSeed == nil {
87+
if !(config.Accounts != nil && config.Accounts.AuthorizingSeed != nil) {
8888
log.Warning("No accounts.authorizing_seed param. Skipping...")
8989
} else {
9090
err = ts.InitAccount(*config.Accounts.AuthorizingSeed)
@@ -93,7 +93,7 @@ func NewApp(config config.Config, migrateFlag bool) (app *App, err error) {
9393
}
9494
}
9595

96-
if config.Accounts.IssuingSeed == nil {
96+
if !(config.Accounts != nil && config.Accounts.IssuingSeed != nil) {
9797
log.Warning("No accounts.issuing_seed param. Skipping...")
9898
} else {
9999
log.Print("Initializing Issuing account")
@@ -107,7 +107,7 @@ func NewApp(config config.Config, migrateFlag bool) (app *App, err error) {
107107

108108
log.Print("Creating and starting PaymentListener")
109109

110-
if config.Accounts.ReceivingAccountId == nil {
110+
if !(config.Accounts != nil && config.Accounts.ReceivingAccountId != nil) {
111111
log.Warning("No accounts.receiving_account_id param. Skipping...")
112112
} else if config.Hooks.Receive == nil {
113113
log.Warning("No hooks.receive param. Skipping...")
@@ -158,13 +158,13 @@ func (a *App) Serve() {
158158
goji.Use(handlers.ApiKeyMiddleware(a.config.ApiKey))
159159
}
160160

161-
if a.config.Accounts.AuthorizingSeed != nil {
161+
if a.config.Accounts != nil && a.config.Accounts.AuthorizingSeed != nil {
162162
goji.Post("/authorize", requestHandlers.Authorize)
163163
} else {
164164
log.Warning("accounts.authorizing_seed not provided. /authorize endpoint will not be available.")
165165
}
166166

167-
if a.config.Accounts.IssuingSeed != nil {
167+
if a.config.Accounts != nil && a.config.Accounts.IssuingSeed != nil {
168168
goji.Post("/send", requestHandlers.Send)
169169
} else {
170170
log.Warning("accounts.issuing_seed not provided. /send endpoint will not be available.")

src/github.com/stellar/gateway/config/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ func (c *Config) Validate() (err error) {
6969
dbUrl.RawQuery = query.Encode()
7070
c.Database.Url = dbUrl.String()
7171
case "postgres":
72-
case "sqlite3":
72+
break
73+
case "":
74+
// Allow to start gateway server with a single endpoint: /payment
7375
break
7476
default:
7577
err = errors.New("Invalid database.type param")

0 commit comments

Comments
 (0)