diff --git a/client/package.json b/client/package.json index 40b5a1d21..af5922a49 100644 --- a/client/package.json +++ b/client/package.json @@ -1,6 +1,6 @@ { "name": "@superalgos/operations-client", - "version": "0.0.14", + "version": "0.0.15", "description": "Superalgos Operations client-side web app", "main": "src/index.js", "dependencies": { diff --git a/client/src/views/Clone/Add/index.js b/client/src/views/Clone/Add/index.js index 361f5ee43..1b7ae66d8 100644 --- a/client/src/views/Clone/Add/index.js +++ b/client/src/views/Clone/Add/index.js @@ -32,7 +32,7 @@ class AddClone extends Component { state: '', stateDatetime: 0, createDatetime: 0, - runAsTeam: false, + runAsTeam: true, teams: [], teamId: '', keyId: '', @@ -52,7 +52,7 @@ class AddClone extends Component { serverResponse: '', serverError: false, processNameError: false, - keyIdError: false + keyIdError: false, } } @@ -155,7 +155,16 @@ class AddClone extends Component { { this.state.selectedBot.kind === "TRADER" && - At the moment Live Trading Clones trade by default 0.001 BTC on Poloniex. + Available Running Modes are Backtest and Live. + - + + Because we are still in early alpha-testing phase, + Live Trading Clones are limited to an initial investment + of 0.001 BTC. If you choose to run this bot or any modified + version of the code, you are doing it at your own risk. + } @@ -294,22 +308,6 @@ class AddClone extends Component { className={classNames(classes.form, classes.textField)} /> - - The Resume Execution option let's you pick up the context of - the last execution and continue from there. - - this.setState({resumeExecution:e.target.checked })} - value="resumeExecution" - color="primary" - /> - } - label="Resume Execution" - className={classNames(classes.form, classes.textField)} - /> } @@ -417,9 +415,9 @@ class AddClone extends Component { } - - You will be able to query your clone information under Active Clones until it finishes the execution, then it will moved to the History. + You will be able to see the clone information under Active Clones. + Whenever you decide to stop the clone you can delete it. On History Clones will find all deleted clones.
@@ -552,7 +550,7 @@ class AddClone extends Component { state : '', stateDatetime: 0, createDatetime: 0, - runAsTeam: false, + runAsTeam: true, processName: '', teams: [], teamId: '', diff --git a/client/src/views/Clone/Add/styles.js b/client/src/views/Clone/Add/styles.js index 2d831d291..b5533fe95 100644 --- a/client/src/views/Clone/Add/styles.js +++ b/client/src/views/Clone/Add/styles.js @@ -24,7 +24,7 @@ const styles = theme => ({ typography: { width: '80%', marginLeft: '10%', - marginTop: 40 + marginTop: 20 }, form: { marginTop: 20 diff --git a/client/src/views/Home.js b/client/src/views/Home.js index 6b4d9aaec..02e13a7cf 100644 --- a/client/src/views/Home.js +++ b/client/src/views/Home.js @@ -9,21 +9,21 @@ class Home extends Component {
- Welcome to the Operations Module! + Welcome to the Clones Module! Responsible for manage bot clones.
- The Operations module allows you to create instances of your bots + The Clones module allows you to create instances of your bots that will be executed on a virtual machine.
diff --git a/server/src/schema/mutations/AddCloneMutation.js b/server/src/schema/mutations/AddCloneMutation.js index 76381ca74..092ffe6e7 100644 --- a/server/src/schema/mutations/AddCloneMutation.js +++ b/server/src/schema/mutations/AddCloneMutation.js @@ -15,7 +15,7 @@ import { import logger from '../../config/logger' import createKubernetesClone from '../../kubernetes/createClone' import { isDefined } from '../../config/utils' -import { LIVE } from '../../enums/CloneMode' +import { LIVE, COMPETITION } from '../../enums/CloneMode' const args = { clone: { type: CloneInputType } @@ -36,8 +36,8 @@ const resolve = async(parent, { clone }, context) => { throw new WrongArgumentsError('The bot type selected is not valid.') } - if (clone.mode === LIVE && !isDefined(clone.keyId)) { - throw new WrongArgumentsError('The key was not provided to run the clone in Live mode.') + if ( (clone.mode === LIVE || clone.mode === COMPETITION) && !isDefined(clone.keyId)) { + throw new WrongArgumentsError('The key was not provided to run the clone.') } try { @@ -53,7 +53,7 @@ const resolve = async(parent, { clone }, context) => { logger.debug('addClone -> Creating the clone on the Database.') let savedClone = await newClone.save() - if (clone.mode === LIVE) { + if (clone.mode === LIVE || clone.mode === COMPETITION) { logger.debug('addClone -> Authorizing clone to use the key.') let response = await authorizeClone(context.authorization, clone.keyId, clone.id, false) logger.debug('addClone -> Authorizing clone to use the key.') @@ -62,7 +62,10 @@ const resolve = async(parent, { clone }, context) => { } else { throw new AutorizationError() } + }else{ + await createKubernetesClone(clone) } + logger.debug('addClone -> Clone created sucessfully.') return savedClone } catch (err) {