mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
* Exchanges: Initial implementation after rebase of depth (WIP) * orderbook/buffer: convert and couple orderbook interaction functionality from buffer to orderbook linked list - Use single point reference for orderbook depth * buffer/orderbook: conversion continued (WIP) * exchange: buffer/linkedlist handover (WIP) * Added some tests for yesterday * linkedList: added more testing and trying to figure out broken things * Started tying everything in * continuous integration and testing * orderbook: expanded tests * go mod tidy * Add in different synchornisation levels for protocols Add in timer for the streaming system to reduce updates to datahandler Add in more test code as I integrate more exchanges * Depth: Add tests, add length check to call linked list updating, add in constructor. Linked List: Improve tests, add in checks for zero liquidity on books. Node: Added in cleaner POC, add in contructor. Buffer: Fixed tests, checked benchmarks. * orderbook: reinstate dispatch calls * Addr glorious & madcozbad nits * fix functionality and add tests * Address linterinos * remove label * expanded comment * fix races and and bitmex test * reinstate go routine for alerting changes * rm line :D * fix more tests * Addr glorious nits * rm glorious field * depth: defer unlock to stop deadlock * orderbook: remove unused vars * buffer: fix test to what it should be * nits: madcosbad addr * nits: glorious nits * linkedlist: remove unused params * orderbook: shift time call to outside of push to inline, add in case for update inster price for zero liquidity, nits * orderbook: nits addressed * engine: change stream -> websocket convention and remove unused function * nits: glorious nits * Websocket Buffer: Add verbosity switch * linked list: Add comment * linked list: fix spelling * nits: glorious nits * orderbook: Adds in test and explicit time type with constructor, fix nits * linter * spelling: removed the dere fence * depth: Update alerting mechanism to a more battle tested state * depth: spelling * nits: glorious nits * linked list: match cases * buffer: fix linter issue * golangci: increase timeout by 30 seconds * nodes: update atomic checks * spelling: fix * node: add in commentary * exchanges/syncer: add function to switch over to REST when websocket functionality is not available for a specific asset type * linter: exchange linter issues * syncer: Add in warning * nits: glorious nits * AssetWebsocketSupport: unexport map * Nits: Adrr * rm letter * exchanges: Orderbook verification change for naming, deprecate checksum bypass as it has the potential to obfuscate errors that are at the tail end of the book, add in verification for websocket stream updates * general: fix spelling remove breakpoint * nits: fix more glorious nits until more are found * orderbook: fix tests * orderbook: fix wait tests and add in more checks * nits: addr * orderbook: remove dispatch reference * linkedlist: consolidate bid/ask functions * linked lisdt: remove words * fix spelling
104 lines
2.8 KiB
Go
104 lines
2.8 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
|
|
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
|
|
EventManagerDelay time.Duration
|
|
Verbose bool
|
|
|
|
// Exchange syncer settings
|
|
EnableTickerSyncing bool
|
|
EnableOrderbookSyncing bool
|
|
EnableTradeSyncing bool
|
|
SyncWorkers int
|
|
SyncContinuously bool
|
|
SyncTimeoutREST time.Duration
|
|
SyncTimeoutWebsocket time.Duration
|
|
|
|
// Forex settings
|
|
EnableCurrencyConverter bool
|
|
EnableCurrencyLayer bool
|
|
EnableFixer bool
|
|
EnableOpenExchangeRates 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"
|
|
)
|
|
|
|
// newConfigMutex only locks and unlocks on engine creation functions
|
|
// as engine modifies global files, this protects the main bot creation
|
|
// functions from interfering with eachother
|
|
var newEngineMutex sync.Mutex
|