mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-29 23:16:51 +00:00
Improvement: Subsystem separation (#664)
* Initial codes for a trade tracker * Moving everything in a broken fashion * Removes tradetracker. Removes some errors for subsystems * Cleans up some subsystems, renames stuttering types. Removes some global Bot usage * More basic subsystem renaming and file moving * Removes engine dependency from events,ntpserver,ordermanager,comms manager * Exports eventManager, fixes rpcserver. puts rpcserver back for now * Removes redundant error message, further removes engine dependencies * experimental end of day interface usage * adds ability to build the application * Withdraw and event manager handling * cleans up apiserver and communications manager * Cleans up some start/setup processes. Though should separate * More consistency with Setup Start Stop IsRunning funcs * Final consistency pass before testing phase * Fixes engine tests. Fixes stop nil issue * api server tests * Communications manager testing * Connection manager tests and nilsubsystem error * End of day currencypairsyncer tests * Adds databaseconnection/databaseconnection_test.go * Adds withdrawal manager tests * Deposit address testing. Moved orderbook sync first as its more important * Adds test for event manager * More full eventmanager testing * Adds testfile. Enables skipped test. * ntp manager tests * Adds ordermanager tests, Extracts a whole new subsystem from engine and fanangles import cycles * Adds websocket routine manager tests * Basic portfolio manager testing * Fixes issue with currency pair sync startup * Fixes issue with event manager startup * Starts the order manager before backtester starts * Fixes fee tests. Expands testing. Doesnt fix races * Fixes most test races * Resolves data races * Fixes subsystem test issues * currency pair syncer coverage tests * Refactors portfolio. Fixes tests. Withdraw validation Portfolio didn't need to exist with a portfolio manager. Now the porfolio manager is in charge how the portfolio is handled and all portfolio functions are attached to the base instead of just exported at the package level Withdrawal validation occurred at the exchange level when it can just be run at the withdrawal manager level. All withdrawal requests go through that endpoint * lint -fix * golang lint fixes * lints and comments everything * Updates GCT logo, adds documentation for some subsystems * More documentation and more logo updates * Fixes backtesting and apiserver errors encountered * Fixes errors and typos from reviewing * More minor fixes * Changes %h verb to %w * reverbs to %s * Humbly begins reverting to more flat engine package The main reasoning for this is that the subsystem split doesn't make sense in a golang environment. The subsystems are only meant to be used with engine and so by placing them in a non-engine area, it does not work and is inconsistent with the rest of the application's package layout. This will begin salvaging the changes made by reverting to a flat engine package, but maintaining the consistent designs introduced. Further, I will look to remove any TestMains and decrease the scope of testing to be more local and decrease the issues that have been caused from our style of testing. * Manages to re-flatten things. Everything is within its own file * mini fixes * Fixes tests and data races and lints * Updates docs tool for engine to create filename readmes * os -> ioutil * remove err * Appveyor version increase test * Removes tCleanup as its unsupported on appveyor * Adds stuff that I thought was in previous merge master commit * Removes cancel from test * Fixes really fun test-exclusive data race * minor nit fixes * niterinos * docs gen * rm;rf test * Remove typoline. expands startstop helper. Splits apiserver * Removes accidental folder * Uses update instead of replace for order upsert * addresses nits. Renames files. Regenerates documentation. * lint and removal of comments * Add new test for default scenario * Fixes typo * regen docs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# GoCryptoTrader package Documentation
|
||||
|
||||
<img src="https://github.com/thrasher-corp/gocryptotrader/blob/master/web/src/assets/page-logo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
|
||||
|
||||
@@ -63,7 +63,8 @@ var (
|
||||
repoDir string
|
||||
// is a broken down version of the documentation tool dir for cross platform
|
||||
// checking
|
||||
ref = []string{"gocryptotrader", "cmd", "documentation"}
|
||||
ref = []string{"gocryptotrader", "cmd", "documentation"}
|
||||
engineFolder = "engine"
|
||||
)
|
||||
|
||||
// Contributor defines an account associated with this code base by doing
|
||||
@@ -121,8 +122,8 @@ func main() {
|
||||
}
|
||||
|
||||
if strings.Contains(wd, filepath.Join(ref...)) {
|
||||
rootdir := filepath.Dir(filepath.Dir(wd))
|
||||
repoDir = rootdir
|
||||
rootDir := filepath.Dir(filepath.Dir(wd))
|
||||
repoDir = rootDir
|
||||
toolDir = wd
|
||||
} else {
|
||||
if toolDir == "" {
|
||||
@@ -132,7 +133,7 @@ func main() {
|
||||
repoDir = wd
|
||||
}
|
||||
|
||||
fmt.Println(core.Banner)
|
||||
fmt.Print(core.Banner)
|
||||
fmt.Println("This will update and regenerate documentation for the different packages in your repo.")
|
||||
fmt.Println()
|
||||
|
||||
@@ -272,15 +273,11 @@ func main() {
|
||||
fmt.Println("All core systems fetched, updating documentation...")
|
||||
}
|
||||
|
||||
err = UpdateDocumentation(DocumentationDetails{
|
||||
UpdateDocumentation(DocumentationDetails{
|
||||
dirList,
|
||||
tmpl,
|
||||
contributors,
|
||||
&config})
|
||||
if err != nil {
|
||||
log.Fatalf("Documentation Generation Tool - UpdateDocumentation error %s",
|
||||
err)
|
||||
}
|
||||
|
||||
fmt.Println("\nDocumentation Generation Tool - Finished")
|
||||
}
|
||||
@@ -355,7 +352,7 @@ func GetProjectDirectoryTree(c *Config) ([]string, error) {
|
||||
directoryData = append(directoryData, filepath.Join(repoDir, ContributorFile))
|
||||
}
|
||||
|
||||
walkfn := func(path string, info os.FileInfo, err error) error {
|
||||
walkFn := func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -376,7 +373,7 @@ func GetProjectDirectoryTree(c *Config) ([]string, error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return directoryData, filepath.Walk(repoDir, walkfn)
|
||||
return directoryData, filepath.Walk(repoDir, walkFn)
|
||||
}
|
||||
|
||||
// GetTemplateFiles parses and returns all template files in the documentation
|
||||
@@ -384,7 +381,7 @@ func GetProjectDirectoryTree(c *Config) ([]string, error) {
|
||||
func GetTemplateFiles() (*template.Template, error) {
|
||||
tmpl := template.New("")
|
||||
|
||||
walkfn := func(path string, info os.FileInfo, err error) error {
|
||||
walkFn := func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -406,7 +403,7 @@ func GetTemplateFiles() (*template.Template, error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return tmpl, filepath.Walk(toolDir, walkfn)
|
||||
return tmpl, filepath.Walk(toolDir, walkFn)
|
||||
}
|
||||
|
||||
// GetContributorList fetches a list of contributors from the github api
|
||||
@@ -458,14 +455,14 @@ func GetGoDocURL(name string) string {
|
||||
|
||||
// UpdateDocumentation generates or updates readme/documentation files across
|
||||
// the codebase
|
||||
func UpdateDocumentation(details DocumentationDetails) error {
|
||||
func UpdateDocumentation(details DocumentationDetails) {
|
||||
for i := range details.Directories {
|
||||
cutset := details.Directories[i][len(repoDir):]
|
||||
if cutset != "" && cutset[0] == os.PathSeparator {
|
||||
cutset = cutset[1:]
|
||||
cutSet := details.Directories[i][len(repoDir):]
|
||||
if cutSet != "" && cutSet[0] == os.PathSeparator {
|
||||
cutSet = cutSet[1:]
|
||||
}
|
||||
|
||||
data := strings.Split(cutset, string(os.PathSeparator))
|
||||
data := strings.Split(cutSet, string(os.PathSeparator))
|
||||
|
||||
var temp []string
|
||||
for x := range data {
|
||||
@@ -491,40 +488,66 @@ func UpdateDocumentation(details DocumentationDetails) error {
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if name == engineFolder {
|
||||
d, err := ioutil.ReadDir(details.Directories[i])
|
||||
if err != nil {
|
||||
fmt.Println("Excluding file:", err)
|
||||
}
|
||||
for x := range d {
|
||||
nameSplit := strings.Split(d[x].Name(), ".go")
|
||||
engineTemplateName := engineFolder + " " + nameSplit[0]
|
||||
if details.Tmpl.Lookup(engineTemplateName) == nil {
|
||||
fmt.Printf("Template not found for path %s create new template with {{define \"%s\" -}} TEMPLATE HERE {{end}}\n",
|
||||
details.Directories[i],
|
||||
name)
|
||||
continue
|
||||
}
|
||||
err = runTemplate(details, filepath.Join(details.Directories[i], nameSplit[0]+".md"), engineTemplateName)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
if details.Tmpl.Lookup(name) == nil {
|
||||
fmt.Printf("Template not found for path %s create new template with {{define \"%s\" -}} TEMPLATE HERE {{end}}\n",
|
||||
details.Directories[i],
|
||||
name)
|
||||
continue
|
||||
}
|
||||
|
||||
var mainPath string
|
||||
if name == LicenseFile || name == ContributorFile {
|
||||
switch {
|
||||
case name == LicenseFile || name == ContributorFile:
|
||||
mainPath = details.Directories[i]
|
||||
} else {
|
||||
default:
|
||||
mainPath = filepath.Join(details.Directories[i], "README.md")
|
||||
}
|
||||
|
||||
err := os.Remove(mainPath)
|
||||
if err != nil && !(strings.Contains(err.Error(), "no such file or directory") ||
|
||||
strings.Contains(err.Error(), "The system cannot find the file specified.")) {
|
||||
return err
|
||||
if err := runTemplate(details, mainPath, name); err != nil {
|
||||
log.Println(err)
|
||||
continue
|
||||
}
|
||||
|
||||
file, err := os.Create(mainPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
attr := GetDocumentationAttributes(name, details.Contributors)
|
||||
|
||||
err = details.Tmpl.ExecuteTemplate(file, name, attr)
|
||||
if err != nil {
|
||||
file.Close()
|
||||
return err
|
||||
}
|
||||
file.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func runTemplate(details DocumentationDetails, mainPath, name string) error {
|
||||
err := os.Remove(mainPath)
|
||||
if err != nil && !(strings.Contains(err.Error(), "no such file or directory") ||
|
||||
strings.Contains(err.Error(), "The system cannot find the file specified.")) {
|
||||
return err
|
||||
}
|
||||
|
||||
f, err := os.Create(mainPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func(f *os.File) {
|
||||
err := f.Close()
|
||||
if err != nil {
|
||||
log.Printf("could not close file %s: %v", mainPath, err)
|
||||
}
|
||||
}(f)
|
||||
|
||||
attr := GetDocumentationAttributes(name, details.Contributors)
|
||||
return details.Tmpl.ExecuteTemplate(f, name, attr)
|
||||
}
|
||||
|
||||
28
cmd/documentation/engine_templates/apiserver.tmpl
Normal file
28
cmd/documentation/engine_templates/apiserver.tmpl
Normal file
@@ -0,0 +1,28 @@
|
||||
{{define "engine apiserver" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The API server subsystem is a deprecated service used to host a REST or websocket server to interact with some functions of GoCryptoTrader
|
||||
+ This subsystem is no longer maintained and it is highly encouraged to interact with GRPC endpoints directly where possible
|
||||
+ In order to modify the behaviour of the API server subsystem, you can edit the following inside your config file:
|
||||
|
||||
### deprecatedRPC
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| enabled | If enabled will create a REST server which will listen to commands on the listen address | `true` |
|
||||
| listenAddress | If enabled will listen for REST requests on this address and return a JSON response | `localhost:9050` |
|
||||
|
||||
### websocketRPC
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| enabled | If enabled will create a REST server which will listen to commands on the listen address | `true` |
|
||||
| listenAddress | If enabled will listen for requests on this address and return a JSON response | `localhost:9051` |
|
||||
| connectionLimit | Defines how many connections the websocket RPC server can handle simultanesoly | `1` |
|
||||
| maxAuthFailures | For authenticated endpoints, the amount of failed attempts allowed before disconnection | `3` |
|
||||
| allowInsecureOrigin | Allows use of insecure connections | `true` |
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,56 @@
|
||||
{{define "engine communication_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The communication manager subsystem is used to push events raised in GoCryptoTrader to any enabled communication system such as a Slack server
|
||||
+ In order to modify the behaviour of the communication manager subsystem, you can edit the following inside your config file under `communications`:
|
||||
|
||||
### slack
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| enabled | Determines whether the push communications to a Slack server | `true` |
|
||||
| verbose | If enabled will log more details to your logger output | `false` |
|
||||
| targetChannel | The channel to send communications to | `announcements` |
|
||||
| verificationToken | The token generated by Slack to allow interactions with the server and channel | `iamafaketoken` |
|
||||
|
||||
### smsGlobal
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| name | The name of the SMS sender | `SMSGlobal` |
|
||||
| from | Who the text name is from | `Skynet` |
|
||||
| enabled | Determines whether the push communications to the SMS service | `true` |
|
||||
| verbose | If enabled will log more details to your logger output | `false` |
|
||||
| username | The username to use with the SMS provider | `username` |
|
||||
| password | The username to use with the SMS provider | `password` |
|
||||
| contacts | The `name` `number` of the user people you wish to send SMS to and whether it is `enabled` | `"name": "StyleGherkin", "number": "1231424", "enabled": true` |
|
||||
|
||||
### smtp
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| name | The name of the service | `SMTP` |
|
||||
| enabled | Determines whether the push communications to a email server | `true` |
|
||||
| verbose | If enabled will log more details to your logger output | `false` |
|
||||
| host | The SMTP host | `smtp.google.com` |
|
||||
| port | The port to use | `537` |
|
||||
| accountName | Your username | `username` |
|
||||
| accountPassword | Your password | `password` |
|
||||
| from | The display name of the sender | `Jeff Bezos` |
|
||||
| recipientList | A comma delimited list of addresses to send alerts to | `bill@gates.com` |
|
||||
|
||||
### telegram
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| name | The name to be displayed | `Telegram` |
|
||||
| enabled | Determines whether the push communications to a Telegram server | `true` |
|
||||
| verbose | If enabled will log more details to your logger output | `false` |
|
||||
| verificationToken | The token generated by Telegram to allow you to send messages | `iamafaketoken` |
|
||||
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
19
cmd/documentation/engine_templates/connection_manager.tmpl
Normal file
19
cmd/documentation/engine_templates/connection_manager.tmpl
Normal file
@@ -0,0 +1,19 @@
|
||||
{{define "engine connection_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The connection manager subsystem is used to periodically check whether the application is connected to the internet and will provide alerts of any changes
|
||||
+ In order to modify the behaviour of the connection manager subsystem, you can edit the following inside your config file under `connectionMonitor`:
|
||||
|
||||
### connectionMonitor
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| perferredDNSList | Is a string array of DNS servers to periodically verify whether GoCryptoTrader is connected to the internet | `["8.8.8.8","8.8.4.4","1.1.1.1","1.0.0.1"]` |
|
||||
| preferredDomainList | Is a string array of domains to periodically verify whether GoCryptoTrader is connected to the internet | `["www.google.com","www.cloudflare.com","www.facebook.com"]` |
|
||||
| checkInterval | A time period in golang `time.Duration` format to check whether GoCryptoTrader is connected to the internet | `1000000000` |
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
30
cmd/documentation/engine_templates/database_connection.tmpl
Normal file
30
cmd/documentation/engine_templates/database_connection.tmpl
Normal file
@@ -0,0 +1,30 @@
|
||||
{{define "engine database_connection" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The database connection manager subsystem is used to periodically check whether the application is connected to the database and will provide alerts of any changes
|
||||
+ In order to modify the behaviour of the database connection manager subsystem, you can edit the following inside your config file under `database`:
|
||||
|
||||
### database
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| enabled | Enabled or disables the database connection subsystem | `true` |
|
||||
| verbose | Displays more information to the logger which can be helpful for debugging | `false` |
|
||||
| driver | The SQL driver to use. Can be `postgres` or `sqlite`. | `sqlite` |
|
||||
| connectionDetails | See below | |
|
||||
|
||||
### connectionDetails
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| host | The host address of the database | `localhost` |
|
||||
| port | The port used to connect to the database | `5432` |
|
||||
| username | An optional username to connect to the database | `username` |
|
||||
| password | An optional password to connect to the database | `password` |
|
||||
| database | The name of the database | `database.db` |
|
||||
| sslmode | The connection type of the database for Postgres databases only | `disable` |
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
11
cmd/documentation/engine_templates/depositaddress.tmpl
Normal file
11
cmd/documentation/engine_templates/depositaddress.tmpl
Normal file
@@ -0,0 +1,11 @@
|
||||
{{define "engine depositaddress" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The deposit address manager subsystem stores Exchange deposit addresses.
|
||||
+ On start of the application the engine Bot will retrieve deposit addresses from exchanges if you have API keys set
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
18
cmd/documentation/engine_templates/event_manager.tmpl
Normal file
18
cmd/documentation/engine_templates/event_manager.tmpl
Normal file
@@ -0,0 +1,18 @@
|
||||
{{define "engine event_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The event manager subsystem is used to push events to communication systems such as Slack
|
||||
+ The only configurable aspects of the event manager are the delays between receiving an event and pushing it and enabling verbose:
|
||||
|
||||
### connectionMonitor
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| eventmanagerdelay | Sets the event managers sleep delay between event checking by a Golang `time.Duration` | `0` |
|
||||
| verbose | Outputs debug messaging allowing for greater transparency for what the event manager is doing | `false` |
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
11
cmd/documentation/engine_templates/exchange_manager.tmpl
Normal file
11
cmd/documentation/engine_templates/exchange_manager.tmpl
Normal file
@@ -0,0 +1,11 @@
|
||||
{{define "engine exchange_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The exchange manager subsystem is used load and store exchanges so that the engine Bot can use them to track orderbooks, submit orders etc etc
|
||||
+ The exchange manager itself is not customisable, it is always enabled.
|
||||
+ The exchange manager by default will load all exchanges that are enabled in your config, however, it will also load exchanges by request via GRPC commands
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
22
cmd/documentation/engine_templates/ntp_manager.tmpl
Normal file
22
cmd/documentation/engine_templates/ntp_manager.tmpl
Normal file
@@ -0,0 +1,22 @@
|
||||
{{define "engine ntp_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The NTP manager subsystem is used highlight discrepancies between your system time and specified NTP server times
|
||||
+ It is useful for debugging and understanding why a request to an exchange may be rejected
|
||||
+ The NTP manager cannot update your system clock, so when it does alert you of issues, you must take it upon yourself to change your system time in the event your requests are being rejected for being too far out of sync
|
||||
+ In order to modify the behaviour of the NTP manager subsystem, you can edit the following inside your config file under `ntpclient`:
|
||||
|
||||
### ntpclient
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| enabled | An integer value representing whether the NTP manager is enabled. It will warn you of time sync discrepancies on startup with a value of 0 and will alert you periodically with a value of 1. A value of -1 will disable the manager | `1` |
|
||||
| pool | A string array of the NTP servers to check for time discrepancies | `["0.pool.ntp.org:123","pool.ntp.org:123"]` |
|
||||
| allowedDifference | A Golang time.Duration representation of the allowable time discrepancy between NTP server and your system time. Any discrepancy greater than this allowance will display an alert to your logging output | `50000000` |
|
||||
| allowedNegativeDifference | A Golang time.Duration representation of the allowable negative time discrepancy between NTP server and your system time. Any discrepancy greater than this allowance will display an alert to your logging output | `50000000` |
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
11
cmd/documentation/engine_templates/order_manager.tmpl
Normal file
11
cmd/documentation/engine_templates/order_manager.tmpl
Normal file
@@ -0,0 +1,11 @@
|
||||
{{define "engine order_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The order manager subsystem stores and monitors all orders from enabled exchanges with API keys and `authenticatedSupport` enabled
|
||||
+ It can be enabled or disabled via runtime command `-ordermanager=false` and defaults to true
|
||||
+ All orders placed via GoCryptoTrader will be added to the order manager store
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
32
cmd/documentation/engine_templates/portfolio_manager.tmpl
Normal file
32
cmd/documentation/engine_templates/portfolio_manager.tmpl
Normal file
@@ -0,0 +1,32 @@
|
||||
{{define "engine portfolio_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The portfolio manager subsystem is used to synchronise and monitor wallet addresses
|
||||
+ It can read addresses specified in your config file
|
||||
+ If you have set API keys for an enabled exchange and enabled `authenticatedSupport`, it will store your exchange addresses
|
||||
+ In order to modify the behaviour of the portfolio manager subsystem, you can edit the following inside your config file under `portfolioAddresses`:
|
||||
|
||||
### portfolioAddresses
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| Verbose | Enabling this will output more detailed logs to your logging output | `false` |
|
||||
| addresses | An array of portfolio wallet addresses to monitor, see below table | |
|
||||
|
||||
### addresses
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| Address | The wallet address | `{{.DonationAddress}}` |
|
||||
| CoinType | The coin for the wallet address | `BTC` |
|
||||
| Balance | The balance of the wallet | |
|
||||
| Description | A customisable description | `My secret billion stash` |
|
||||
| WhiteListed | Determines whether GoCryptoTrader withdraw manager subsystem can make withdrawals from this address | `true` |
|
||||
| ColdStorage | Describes whether the wallet address is a cold storage wallet eg Ledger | `false` |
|
||||
| SupportedExchanges | A comma delimited string of which exchanges are allowed to interact with this wallet | `"Binance"` |
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
13
cmd/documentation/engine_templates/subsystem_types.tmpl
Normal file
13
cmd/documentation/engine_templates/subsystem_types.tmpl
Normal file
@@ -0,0 +1,13 @@
|
||||
{{define "engine subsystem_types" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ Subsystem contains subsystems that are used at run time by an `engine.Engine`, however they can be setup and run individually.
|
||||
+ Subsystems are designed to be self contained
|
||||
+ All subsystems have a public `Setup(...) (..., error)` function to return a valid subsystem ready for use
|
||||
+ Subsystems which are designed to be switched off also have `Start(...) error`, `IsRunning() bool` and `Stop(...) error` functions to allow the main `engine.Engine` instance to manage them
|
||||
+ Common subsystem types such as errors can be found within the `subsystem.go` file
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
22
cmd/documentation/engine_templates/sync_manager.tmpl
Normal file
22
cmd/documentation/engine_templates/sync_manager.tmpl
Normal file
@@ -0,0 +1,22 @@
|
||||
{{define "engine sync_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The currency pair syncer subsystem is used to keep all trades, tickers and orderbooks up to date for all enabled exchange asset currency pairs
|
||||
+ It can sync data via a websocket connection or REST and will switch between them if there has been no updates
|
||||
+ In order to modify the behaviour of the currency pair syncer subsystem, you can change runtime parameters as detailed below:
|
||||
|
||||
| Config | Description | Example |
|
||||
| ------ | ----------- | ------- |
|
||||
| syncmanager | Determines whether the subsystem is enabled | `true` |
|
||||
| tickersync | Enables ticker syncing for all enabled exchanges | `true`|
|
||||
| orderbooksync | Enables orderbook syncing for all enabled exchanges | `true` |
|
||||
| tradesync | Enables trade syncing for all enabled exchanges | `true` |
|
||||
| syncworkers | The amount of workers (goroutines) to use for syncing exchange data | `15` |
|
||||
| synccontinuously | Whether to sync exchange data continuously (ticker, orderbook and trades) | `true` |
|
||||
| synctimeout | The amount of time in golang `time.Duration` format before the syncer will switch from one protocol to the other (e.g. from REST to websocket) | `15000000000` |
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{define "engine websocketroutine_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The websocket routine manager subsystem is used process websocket data in a unified manner across enabled exchanges with websocket support
|
||||
+ It can help process orders to the order manager subsystem when it receives new data
|
||||
+ Logs output of ticker and orderbook updates
|
||||
+ The websocket routine manager subsystem can be enabled or disabled via runtime command `-websocketroutine=false` defaulting to true
|
||||
+ Logs can be customised to display values the config value `fiatDisplayCurrency` under `currencyConfig`
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
15
cmd/documentation/engine_templates/withdraw_manager.tmpl
Normal file
15
cmd/documentation/engine_templates/withdraw_manager.tmpl
Normal file
@@ -0,0 +1,15 @@
|
||||
{{define "engine withdraw_manager" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.CapitalName}}
|
||||
+ The withdraw manager subsystem is responsible for the processing of withdrawal requests and submitting them to exchanges
|
||||
+ The withdraw manager can be interacted with via GRPC commands such as `WithdrawFiatRequest` and `WithdrawCryptoRequest`
|
||||
+ Supports caching of responses to allow for quick viewing of withdrawal events via GRPC
|
||||
+ If the database is enabled, withdrawal events are stored to the database for later viewing
|
||||
+ Will not process withdrawal events if `dryrun` is true
|
||||
+ The withdraw manager subsystem is always enabled
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
@@ -1,5 +1,5 @@
|
||||
{{define "root" -}}
|
||||
<img src="https://github.com/thrasher-corp/gocryptotrader/blob/master/web/src/assets/page-logo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{define "header" -}}
|
||||
# GoCryptoTrader package {{.CapitalName}}
|
||||
|
||||
<img src="https://github.com/thrasher-corp/gocryptotrader/blob/master/web/src/assets/page-logo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
{{template "status" .NameURL}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user