API for commission management.
- Pull "mt-commission-service" docker image with a corresponding tag.
- Configure environment variables according to "Environment variables" section.
- Put secrets.json with endpoint data including the certificate:
"Kestrel": {
"EndPoints": {
"HttpsInlineCertFile": {
"Url": "https://*:5150",
"Certificate": {
"Path": "<path to .pfx file>",
"Password": "<certificate password>"
}
}
}
- Initialize all dependencies.
- Run.
- Clone repo to some directory.
- In MarginTrading.CommissionService root create a appsettings.dev.json with settings.
- Add environment variable "SettingsUrl": "appsettings.dev.json".
- VPN to a corresponding env must be connected and all dependencies must be initialized.
- Run.
TBD
Kestrel configuration may be passed through appsettings.json, secrets or environment. All variables and value constraints are default. For instance, to set host URL the following env variable may be set:
{
"Kestrel__EndPoints__Http__Url": "http://*:5050"
}
- RESTART_ATTEMPTS_NUMBER - number of restart attempts. If not set int.MaxValue is used.
- RESTART_ATTEMPTS_INTERVAL_MS - interval between restarts in milliseconds. If not set 10000 is used.
- SettingsUrl - defines URL of remote settings or path for local settings.
- "InstanceId" - Unique id to identify service instance.
Settings schema is:
{
"CommissionService": {
"Db": {
"StorageMode": "SqlServer",
"StateConnString": "state connection string",
"LogsConnString": "logs connection string"
},
"RabbitMq": {
"Publishers": {
"RateSettingsChanged": {
"ConnectionString": "amqp://login:pwd@rabbit-mt.mt.svc.cluster.local:5672",
"ExchangeName": "CommissionRateSettingsChanged"
}
},
"Consumers": {
"FxRateRabbitMqSettings": {
"ConnectionString": "amqp://login:pwd@rabbit-mt.mt.svc.cluster.local:5672",
"ExchangeName": "lykke.stpexchangeconnector.fxRates"
},
"OrderExecutedSettings": {
"ConnectionString": "amqp://login:pwd@rabbit-mt.mt.svc.cluster.local:5672",
"ExchangeName": "lykke.mt.orderhistory"
},
"SettingsChanged": {
"ConnectionString": "amqp://login:pwd@rabbit-mt.mt.svc.cluster.local:5672",
"ExchangeName": "MtCoreSettingsChanged"
}
}
},
"Services": {
"Backend": {
"Url": "http://mt-trading-core.mt.svc.cluster.local",
"ApiKey": "api key"
},
"TradingHistory": {
"Url": "http://mt-tradinghistory.mt.svc.cluster.local",
"ApiKey": "api key"
},
"AccountManagement": {
"Url": "http://mt-account-management.mt.svc.cluster.local",
"ApiKey": "api key"
},
"SettingsService": {
"Url": "http://mt-settings-service.mt.svc.cluster.local",
"ApiKey": "api key"
}
},
"Cqrs": {
"ConnectionString": "amqp://login:pwd@rabbit-mt.mt.svc.cluster.local:5672",
"RetryDelay": "00:01:00",
"EnvironmentName": "env name"
},
"DefaultRateSettings": {
"DefaultOrderExecutionSettings": {
"CommissionCap": 100,
"CommissionFloor": 10,
"CommissionRate": 0.001,
"CommissionAsset": "EUR",
"LegalEntity": "Default"
},
"DefaultOvernightSwapSettings": {
"RepoSurchargePercent": 0,
"FixRate": 0.05,
"VariableRateBase": "",
"VariableRateQuote": ""
},
"DefaultOnBehalfSettings": {
"Commission": 10,
"CommissionAsset": "EUR",
"LegalEntity": "Default"
}
},
"RedisSettings": {
"Configuration": "redis connection string"
},
"ChaosKitty": {
"StateOfChaos": 0
},
"OvernightSwapsChargingTimeoutSec": 600,
"DailyPnlsChargingTimeoutSec": 600,
"UseSerilog": false
}
}