Merge Complete

This commit is contained in:
Luis Fernando Molina committed 2020-11-20 20:28:04 +01:00
1 parent 482ef7a81a
commit dabe23d505
6483 files changed

No files matched your search

@@ -0,0 +1,374 @@
exports.activeCloneList = function (exchangeName) {
var activeCloneList = []
if(exchangeName === "Coss" && false){
// Charly Live-Trades
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumqkwdd005d0737j715vdd7',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Sensor',
'exchangeName': 'Coss',
'processName': 'Live-Trades',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Charly Hole-Fixing
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumqkwdd005d0737j715vdd7',
'mode': 'allMonths',
'resumeExecution': true,
'botType': 'Sensor',
'exchangeName': 'Coss',
'processName': 'Hole-Fixing',
'startYear': 2019,
'endYear': 2021,
'month': 1,
'beginDatetime': 1553641200
})
// Bruce Single-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumqma3n005l0737us5ss1t8',
'mode': 'allMonths',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Single-Period-Daily',
'startYear': 2019,
'endYear': 2021,
'month': 1,
'beginDatetime': 1553641200
})
// Olivia Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr98f3005q07376vx9dbmv',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Olivia Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr98f3005q07376vx9dbmv',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AATom Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr9mpd005v0737bcsixkv0',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AATom Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr9mpd005v0737bcsixkv0',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Chris Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumra2fb00600737ycmz1anm',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Chris Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumra2fb00600737ycmz1anm',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AAPaula Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumrafn2006507377yaz7jri',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AAPaula Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumrafn2006507377yaz7jri',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Gauss Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumt5x3s00840737knglq0vu',
'botId': 'cjumt5x41008a0737rad8n2eh',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Gauss Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumt5x3s00840737knglq0vu',
'botId': 'cjumt5x41008a0737rad8n2eh',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Coss',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
} else if(exchangeName === "Poloniex"){
// Charly Live-Trades
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumqkwdd005d0737j715vdd7',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Sensor',
'exchangeName': 'Poloniex',
'processName': 'Live-Trades',
'startYear': 2019,
'endYear': 2021,
'month': 1,
'beginDatetime': 1553641200
})
// Charly Hole-Fixing
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumqkwdd005d0737j715vdd7',
'mode': 'allMonths',
'resumeExecution': true,
'botType': 'Sensor',
'exchangeName': 'Poloniex',
'processName': 'Hole-Fixing',
'startYear': 2019,
'endYear': 2021,
'month': 1,
'beginDatetime': 1553641200
})
// Bruce Single-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumqma3n005l0737us5ss1t8',
'mode': 'allMonths',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Single-Period-Daily',
'startYear': 2019,
'endYear': 2021,
'month': 1,
'beginDatetime': 1553641200
})
// Olivia Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr98f3005q07376vx9dbmv',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Olivia Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr98f3005q07376vx9dbmv',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AATom Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr9mpd005v0737bcsixkv0',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AATom Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumr9mpd005v0737bcsixkv0',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Chris Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumra2fb00600737ycmz1anm',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Chris Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumra2fb00600737ycmz1anm',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AAPaula Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumrafn2006507377yaz7jri',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// AAPaula Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumqkwd400570737f2poka9i',
'botId': 'cjumrafn2006507377yaz7jri',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Gauss Multi-Period-Daily
activeCloneList.push({
'teamId': 'cjumt5x3s00840737knglq0vu',
'botId': 'cjumt5x41008a0737rad8n2eh',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Daily',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
// Gauss Multi-Period-Market
activeCloneList.push({
'teamId': 'cjumt5x3s00840737knglq0vu',
'botId': 'cjumt5x41008a0737rad8n2eh',
'mode': 'noTime',
'resumeExecution': true,
'botType': 'Indicator',
'exchangeName': 'Poloniex',
'processName': 'Multi-Period-Market',
'startYear': 2019,
'endYear': 2019,
'month': 1,
'beginDatetime': 1553641200
})
}
return activeCloneList
}
@@ -0,0 +1,180 @@
var assert = require('chai').assert
const axios = require('axios')
const { activeCloneList } = require('./activeCloneList')
require('dotenv').config()
var cloneList = activeCloneList("Poloniex")
describe('Admin clones Clones', function () {
it('Remove clones', async function () {
this.timeout(300000)
var clones = await getClones()
for (let clone of clones) {
await removeClone(clone.id, clone.botName)
}
assert.isOk('everything', 'everything is ok')
})
// it('Add COSS Live Indicator Clones', async function () {
// this.timeout(1000000)
// var error
// var clones = activeCloneList("Coss")
// try {
// for (let clone of clones) {
// await createClone(clone)
// }
// } catch (err) {
// console.log('Error: ' + err)
// error = err
// }
// assert.equal(error, undefined)
// })
// it('Add POLONIEX Live Indicator Clones', async function () {
// this.timeout(1000000)
// var error
// var clones = activeCloneList("Poloniex")
// try {
// for (let clone of clones) {
// await createClone(clone)
// }
// } catch (err) {
// console.log('Error: ' + err)
// error = err
// }
// assert.equal(error, undefined)
// })
describe('Poloniex clones', function () {
it('Add Charly', async function () {
this.timeout(10000)
await createClone(cloneList[0])
await createClone(cloneList[1])
assert.isOk('everything', 'everything is ok')
})
it('Add Bruce', async function () {
this.timeout(10000)
await createClone(cloneList[2])
assert.isOk('everything', 'everything is ok')
})
it('Add Olivia', async function () {
this.timeout(10000)
await createClone(cloneList[3])
await createClone(cloneList[4])
assert.isOk('everything', 'everything is ok')
})
it('Add Tom', async function () {
this.timeout(10000)
await createClone(cloneList[5])
await createClone(cloneList[6])
assert.isOk('everything', 'everything is ok')
})
it('Add Chris', async function () {
this.timeout(10000)
await createClone(cloneList[7])
await createClone(cloneList[8])
assert.isOk('everything', 'everything is ok')
})
it('Add Paula', async function () {
this.timeout(10000)
await createClone(cloneList[9])
await createClone(cloneList[10])
assert.isOk('everything', 'everything is ok')
})
it('Add Gauss', async function () {
this.timeout(6000)
await createClone(cloneList[11])
await createClone(cloneList[12])
assert.isOk('everything', 'everything is ok')
})
})
})
async function getClones() {
try {
const clones = await axios({
url: process.env.GATEWAY_ENDPOINT,
method: 'post',
data: {
query: `
query {
operations_Clones(queryLogs: false) {
id
botName
}
}
`,
},
headers: {
authorization: 'Bearer ' + process.env.ACCESS_TOKEN
}
})
console.log('getClones ok ')
return clones.data.data.operations_Clones
} catch (error) {
console.log('getClones error: ' + error.response.data.errors[0])
throw error
}
}
async function removeClone(cloneId, botName) {
try {
await axios({
url: process.env.GATEWAY_ENDPOINT,
method: 'post',
data: {
query: `
mutation ($id: ID!){
operations_RemoveClone(
id: $id
)
}
`,
variables: {
id: cloneId
},
},
headers: {
authorization: 'Bearer ' + process.env.ACCESS_TOKEN
}
})
console.log('removeClone ok: ' + botName)
return true
} catch (error) {
console.log('removeClone error: ' + error.response.data.errors[0])
throw error
}
}
async function createClone(clone) {
try {
const clones = await axios({
url: process.env.GATEWAY_ENDPOINT,
method: 'post',
data: {
query: `
mutation ($clone: operations_CloneInput){
operations_AddClone(
clone: $clone
) {
id
teamName
botName
processName
}
}
`,
variables: {
clone: clone
},
},
headers: {
authorization: 'Bearer ' + process.env.ACCESS_TOKEN
}
})
console.log('createClone id: ' + clones.data.data.operations_AddClone.id + ', botId: ' + clone.botId)
return clones.data.data.operations_AddClone
} catch (error) {
console.log('createClone error: ' + error.response.data.errors[0])
throw error
}
}