Skip to content

Commit

Permalink
Minor QA changes
Browse files Browse the repository at this point in the history
1) Add ability to enable all pairs using the new pair manager
2) Add abiity to enable/disable database subsystem via gRPC
3) Fix spelling mistakes
  • Loading branch information
thrasher- committed Oct 4, 2019
1 parent 62a528a commit 2a13551
Show file tree
Hide file tree
Showing 12 changed files with 1,883 additions and 362 deletions.
8 changes: 7 additions & 1 deletion engine/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ func LoadExchange(name string, useWG bool, wg *sync.WaitGroup) error {
}

This comment has been minimized.

Copy link
@nitsuaaisblink

nitsuaaisblink May 4, 2021

engine/exchange.go

if Bot.Settings.EnableAllPairs {

This comment has been minimized.

Copy link
@nitsuaaisblink

nitsuaaisblink May 4, 2021

if exchCfg.CurrencyPairs != nil {
assets := exchCfg.CurrencyPairs.GetAssetTypes()
for x := range assets {
pairs := exchCfg.CurrencyPairs.GetPairs(assets[x], false)
exchCfg.CurrencyPairs.StorePairs(assets[x], pairs, true)
}
}
}

if Bot.Settings.EnableExchangeVerbose {
exchCfg.EnabledPairs = exchCfg.AvailablePairs
if exchCfg.CurrencyPairs != nil {
assets := exchCfg.CurrencyPairs.GetAssetTypes()
for x := range assets {
pairs := exchCfg.CurrencyPairs.GetPairs(assets[x], false)
exchCfg.CurrencyPairs.StorePairs(assets[x], pairs, true)
}
}
}

if Bot.Settings.EnableExchangeVerbose {
Expand Down
6 changes: 6 additions & 0 deletions engine/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func GetSubsystemsStatus() map[string]bool {
systems["orders"] = Bot.OrderManager.Started()
systems["portfolio"] = Bot.PortfolioManager.Started()
systems["ntp_timekeeper"] = Bot.NTPManager.Started()

This comment has been minimized.

Copy link
@nitsuaaisblink

nitsuaaisblink May 4, 2021

systems["database"] = Bot.DatabaseManager.Started()

systems["database"] = Bot.DatabaseManager.Started()

This comment has been minimized.

Copy link
@nitsuaaisblink

nitsuaaisblink May 4, 2021

systems["database"] = Bot.DatabaseManager.Started()

systems["exchange_syncer"] = Bot.Settings.EnableExchangeSyncManager
systems["grpc"] = Bot.Settings.EnableGRPC
systems["grpc_proxy"] = Bot.Settings.EnableGRPCProxy
Expand Down Expand Up @@ -103,6 +104,11 @@ func SetSubsystem(subsys string, enable bool) error {
return Bot.NTPManager.Start()
}
return Bot.NTPManager.Stop()

This comment has been minimized.

Copy link
@nitsuaaisblink

nitsuaaisblink May 4, 2021

case "database":
if enable {
return Bot.DatabaseManager.Start()
}
return Bot.DatabaseManager.Stop()

case "database":
if enable {
return Bot.DatabaseManager.Start()
}
return Bot.DatabaseManager.Stop()
case "exchange_syncer":
if enable {
Bot.ExchangeCurrencyPairManager.Start()
Expand Down
9 changes: 4 additions & 5 deletions engine/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ func StartRPCServer() {
// StartRPCRESTProxy starts a gRPC proxy
func StartRPCRESTProxy() {
log.Debugf(log.GRPCSys, "gRPC proxy server support enabled. Starting gRPC proxy server on http://%v.\n", Bot.Config.RemoteControl.GRPC.GRPCProxyListenAddress)
ctx := context.Background()

This comment has been minimized.

Copy link
@nitsuaaisblink

nitsuaaisblink May 4, 2021

engine/rpcserver.go

ctx, cancel := context.WithCancel(ctx)
defer cancel()

targetDir := utils.GetTLSDir(Bot.Settings.DataDir)
creds, err := credentials.NewClientTLSFromFile(filepath.Join(targetDir, "cert.pem"), "")
Expand All @@ -134,9 +131,11 @@ func StartRPCRESTProxy() {
Password: Bot.Config.RemoteControl.Password,
}),
}
err = gctrpc.RegisterGoCryptoTraderHandlerFromEndpoint(ctx, mux, Bot.Config.RemoteControl.GRPC.ListenAddress, opts)
err = gctrpc.RegisterGoCryptoTraderHandlerFromEndpoint(context.Background(),

This comment has been minimized.

Copy link
@nitsuaaisblink

nitsuaaisblink May 4, 2021

err = gctrpc.RegisterGoCryptoTraderHandlerFromEndpoint(context.Background(),

mux, Bot.Config.RemoteControl.GRPC.ListenAddress, opts)
if err != nil {
log.Errorf(log.GRPCSys, "Failed to register gRPC proxy. Err: %s\n", err)
return
}

go func() {
Expand Down Expand Up @@ -568,7 +567,7 @@ func (s *RPCServer) GetForexProviders(ctx context.Context, r *gctrpc.GetForexPro
Name: providers[x].Name,
Enabled: providers[x].Enabled,
Verbose: providers[x].Verbose,
RestRollingDelay: providers[x].RESTPollingDelay.String(),
RestPollingDelay: providers[x].RESTPollingDelay.String(),
ApiKey: providers[x].APIKey,
ApiKeyLevel: int64(providers[x].APIKeyLvl),
PrimaryProvider: providers[x].PrimaryProvider,
Expand Down
2 changes: 1 addition & 1 deletion exchanges/zb/zb_websocket_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type WsAddSubUserRequest struct {
Memo string `json:"memo"`
Password string `json:"password"`
SubUserName string `json:"subUserName"`
No int64 `json:"no,string,omtempty"`
No int64 `json:"no,string,omitempty"`
Sign string `json:"sign,omitempty"`
}

Expand Down
340 changes: 170 additions & 170 deletions gctrpc/rpc.pb.go

Large diffs are not rendered by default.

Loading

0 comments on commit 2a13551

Please sign in to comment.