mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 15:09:51 +00:00
* currency: Add method to derive pair * currency: Add method to lower entire charset but used the slice copy and returned that. This will change the original, just gotta see if this is an issue, but the slice usually goes out of scope anyway. * currency/pairs: add filter method * currency: add function to derive select currencies from currency pairs * currency/engine: slight adjustments * currency: fix linter issue also shift burden of proof to caller instead of repair, more performant. * currency: more linter * pairs: optimize; reduce allocs/op and B/op * currency: Add in function 'NewPairsFromString' for testing purposes * currency: don't suppress error * currency: stop panic on empty currency code * currency: Add helper method to match currencies between exchanges * currency: fixed my bad spelling * currency: Implement stable coin checks, refactored base code methods, optimized upper and lower case strings for currency code/pairs * currency: add pairs method to derive stable coins from internal list. * Currency: Cleanup, fix tests. * engine/exchanges/currency: fix whoops * Currency: force govet no copy on Item datatype * Currency: fix naughty linter issues * exchange: revert change * currency/config: fix config upgrade mistake * currency: re-implement currency sub-systems * *RetrieveConfigCurrencyPairs removed *CheckCurrencyConfigValues to only provide warnings, add additional support when, disable when support is lost or not available and set default values. *Drop Cryptocurrencies from configuration as this is not needed. *Drop REST Poll delay field as this was unused. *Update default values for currencyFileUpdateDuration & foreignExchangeUpdateDuration. *Allow Role to be marshalled for file type. *Refactor RunUpdater to verify and check config values and set default running foreign exchange provider. * currency: cleanup * currency: change match -> equal for comparison which is more of a standard and little easier to find * currency: address nits * currency: fix whoops * currency: Add some more pairs methods * currency: linter issues * currency: RM unused field * currency: rm verbose * currency: fix word * currency: gocritic * currency: fix another whoopsie * example_config: default to show log system name * Currency: Force all support packages to use Equal method for comparison as there is a small comparison bug when checking upper and lower casing, this has a more of a pronounced impact between exchanges and client instances of currency generation * currency: fix log name * ordermanager: fix potential panic * currency: small optim. * engine: display correct bool and force shutdown * currency: add function and fix regression * Change ConvertCurrency -> ConvertFiat to be more precise * ADD GetForeignExchangeRate to get specific exchange rate for fiat pair * Fix currency display and formatting regression and tied in with config.Currency fields * engine: fix tests * currency: return the amount when no conversion needs to take place * currency: reduce method name * currency: Address nits glorious nits * currency: fix linter * currency: addr nits * currency: check underlying role in test * gct: change to EMPTYCODE and EMPTYPAIR across codebase * currency: fix nits * currency: this fixes test race but this issue has not been resolved. Please see: https://trello.com/c/54eizOIo/143-currency-package-upgrades * currency: Add temp dir for testing * Update engine/engine.go Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io> * documentation: update and regen * currency: Address niterinos * currency: Add test case for config upgrade when falling over to exchange rate host as default from exchangeRates provider * currency: addr nits * currency: fix whoops Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
110 lines
3.0 KiB
Go
110 lines
3.0 KiB
Go
package engine
|
|
|
|
import (
|
|
"sync"
|
|
"time"
|
|
)
|
|
|
|
// Settings stores engine params
|
|
type Settings struct {
|
|
ConfigFile string
|
|
DataDir string
|
|
MigrationDir string
|
|
LogFile string
|
|
GoMaxProcs int
|
|
CheckParamInteraction bool
|
|
|
|
// Core Settings
|
|
EnableDryRun bool
|
|
EnableAllExchanges bool
|
|
EnableAllPairs bool
|
|
EnableCoinmarketcapAnalysis bool
|
|
EnablePortfolioManager bool
|
|
EnableDataHistoryManager bool
|
|
PortfolioManagerDelay time.Duration
|
|
EnableGRPC bool
|
|
EnableGRPCProxy bool
|
|
EnableWebsocketRPC bool
|
|
EnableDeprecatedRPC bool
|
|
EnableCommsRelayer bool
|
|
EnableExchangeSyncManager bool
|
|
EnableDepositAddressManager bool
|
|
EnableEventManager bool
|
|
EnableOrderManager bool
|
|
EnableConnectivityMonitor bool
|
|
EnableDatabaseManager bool
|
|
EnableGCTScriptManager bool
|
|
EnableNTPClient bool
|
|
EnableWebsocketRoutine bool
|
|
EnableCurrencyStateManager bool
|
|
EventManagerDelay time.Duration
|
|
Verbose bool
|
|
|
|
// Exchange syncer settings
|
|
EnableTickerSyncing bool
|
|
EnableOrderbookSyncing bool
|
|
EnableTradeSyncing bool
|
|
SyncWorkersCount int
|
|
SyncContinuously bool
|
|
SyncTimeoutREST time.Duration
|
|
SyncTimeoutWebsocket time.Duration
|
|
|
|
// Forex settings
|
|
EnableCurrencyConverter bool
|
|
EnableCurrencyLayer bool
|
|
EnableExchangeRates bool
|
|
EnableFixer bool
|
|
EnableOpenExchangeRates bool
|
|
EnableExchangeRateHost bool
|
|
|
|
// Exchange tuning settings
|
|
EnableExchangeHTTPRateLimiter bool
|
|
EnableExchangeHTTPDebugging bool
|
|
EnableExchangeVerbose bool
|
|
ExchangePurgeCredentials bool
|
|
EnableExchangeAutoPairUpdates bool
|
|
DisableExchangeAutoPairUpdates bool
|
|
EnableExchangeRESTSupport bool
|
|
EnableExchangeWebsocketSupport bool
|
|
MaxHTTPRequestJobsLimit int
|
|
TradeBufferProcessingInterval time.Duration
|
|
RequestMaxRetryAttempts int
|
|
|
|
// Global HTTP related settings
|
|
GlobalHTTPTimeout time.Duration
|
|
GlobalHTTPUserAgent string
|
|
GlobalHTTPProxy string
|
|
|
|
// Exchange HTTP related settings
|
|
HTTPTimeout time.Duration
|
|
HTTPUserAgent string
|
|
HTTPProxy string
|
|
|
|
// Dispatch system settings
|
|
EnableDispatcher bool
|
|
DispatchMaxWorkerAmount int
|
|
DispatchJobsLimit int
|
|
|
|
// GCTscript settings
|
|
MaxVirtualMachines uint
|
|
|
|
// Withdraw settings
|
|
WithdrawCacheSize uint64
|
|
}
|
|
|
|
const (
|
|
// MsgStatusOK message to display when status is "OK"
|
|
MsgStatusOK string = "ok"
|
|
// MsgStatusSuccess message to display when status is successful
|
|
MsgStatusSuccess string = "success"
|
|
// MsgStatusError message to display when failure occurs
|
|
MsgStatusError string = "error"
|
|
grpcName string = "grpc"
|
|
grpcProxyName string = "grpc_proxy"
|
|
)
|
|
|
|
// newConfigMutex only locks and unlocks on engine creation functions
|
|
// as engine modifies global files, this protects the main bot creation
|
|
// functions from interfering with each other
|
|
var newEngineMutex sync.Mutex
|