Platoform Running with node modules loaded at platform root

This commit is contained in:
Luis Fernando Molina committed 2021-09-16 09:54:36 +02:00
1 parent 61dbbf4e53
commit d2811cc422
9 files changed
+560 -3929

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ exports.newEnvironment = function () {
PATH_TO_PROJECTS: './Projects',
PATH_TO_LOG_FILES: './Log-Files',
PATH_TO_PROJECTS_REQUIRED: './Projects',
PATH_TO_PROJECT_SCHEMA: '../Projects/ProjectsSchema.json',
PATH_TO_PROJECT_SCHEMA: './Projects/ProjectsSchema.json',
PATH_TO_CLIENT: './Platform',
PATH_TO_DEFAULT_WORKSPACE: './Projects/Foundations/Plugins/Workspaces',
PATH_TO_MY_WORKSPACES: './My-Workspaces',
+10 -10
View File
@@ -625,8 +625,8 @@ exports.newHttpInterface = function newHttpInterface() {
contribute()
async function contribute() {
const { lookpath } = require('lookpath');
const gitpath = await lookpath('git');
const { lookpath } = SA.nodeModules.lookpath
const gitpath = await lookpath('git')
if (gitpath === undefined) {
console.log('[ERROR] `git` not installed.')
} else {
@@ -665,7 +665,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
async function doGit() {
const simpleGit = require('simple-git');
const simpleGit = SA.nodeModules.simpleGit
const options = {
baseDir: process.cwd(),
binary: 'git',
@@ -696,7 +696,7 @@ exports.newHttpInterface = function newHttpInterface() {
async function doGithub() {
const { Octokit } = require("@octokit/rest")
const { Octokit } = SA.nodeModules.octokit
const octokit = new Octokit({
auth: token,
@@ -760,7 +760,7 @@ exports.newHttpInterface = function newHttpInterface() {
update()
async function update() {
const { lookpath } = require('lookpath');
const { lookpath } = SA.nodeModules.lookpath
const gitpath = await lookpath('git');
if (gitpath === undefined) {
console.log('[ERROR] `git` not installed.')
@@ -790,7 +790,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
async function doGit() {
const simpleGit = require('simple-git');
const simpleGit = SA.nodeModules.simpleGit
const options = {
baseDir: process.cwd(),
binary: 'git',
@@ -831,7 +831,7 @@ exports.newHttpInterface = function newHttpInterface() {
checkout()
async function checkout() {
const { lookpath } = require('lookpath');
const { lookpath } = SA.nodeModules.lookpath
const gitpath = await lookpath('git');
if (gitpath === undefined) {
console.log('[ERROR] `git` not installed.')
@@ -855,7 +855,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
async function doGit() {
const simpleGit = require('simple-git');
const simpleGit = SA.nodeModules.simpleGit
const options = {
baseDir: process.cwd(),
binary: 'git',
@@ -890,7 +890,7 @@ exports.newHttpInterface = function newHttpInterface() {
branch()
async function branch() {
const { lookpath } = require('lookpath');
const { lookpath } = SA.nodeModules.lookpath
const gitpath = await lookpath('git');
if (gitpath === undefined) {
console.log('[ERROR] `git` not installed.')
@@ -918,7 +918,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
async function doGit() {
const simpleGit = require('simple-git');
const simpleGit = SA.nodeModules.simpleGit
const options = {
baseDir: process.cwd(),
binary: 'git',
+162 -190
View File
@@ -1,194 +1,166 @@
exports.newPlatformApp = function newPlatformApp() {
/* Load Environment Variables */
let ENVIRONMENT = require('../Environment.js');
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
global.env = ENVIRONMENT_MODULE
process.on('uncaughtException', function (err) {
if (err.message && err.message.indexOf("EADDRINUSE") > 0) {
console.log("The Superalgos Platform Client cannot be started. Reason: the port configured migth be being used by another application, or Superalgos Platform Client might be already running.")
return
}
console.log('[ERROR] Platform App -> uncaughtException -> err.message = ' + err.message)
console.log('[ERROR] Platform App -> uncaughtException -> err.stack = ' + err.stack)
console.log('[ERROR] Platform App -> uncaughtException -> err = ' + err)
process.exit(1)
})
process.on('unhandledRejection', (reason, p) => {
// Signal user that a necissary node module is missing
if (reason.code == 'MODULE_NOT_FOUND') {
console.log("[ERROR] Dependency library not found. Please try running the 'node setup' command and then restart the Superalgos Platform Client.")
console.log('[ERROR] Platform App -> reason = ' + JSON.stringify(reason))
process.exit(1)
}
console.log('[ERROR] Platform App -> unhandledRejection -> reason = ' + JSON.stringify(reason))
console.log('[ERROR] Platform App -> unhandledRejection -> p = ' + JSON.stringify(p))
process.exit(1)
})
try {
/* Callbacks default responses. */
global.DEFAULT_OK_RESPONSE = {
result: "Ok",
message: "Operation Succeeded"
};
global.DEFAULT_FAIL_RESPONSE = {
result: "Fail",
message: "Operation Failed"
};
global.DEFAULT_RETRY_RESPONSE = {
result: 'Retry',
message: 'Retry Later'
let thisObject = {
run: run
}
global.CUSTOM_OK_RESPONSE = {
result: 'Ok, but check Message',
message: 'Custom Message'
return thisObject
async function run() {
process.on('uncaughtException', function (err) {
if (err.message && err.message.indexOf("EADDRINUSE") > 0) {
console.log("The Superalgos Platform Client cannot be started. Reason: the port configured migth be being used by another application, or Superalgos Platform Client might be already running.")
return
}
console.log('[ERROR] Platform App -> uncaughtException -> err.message = ' + err.message)
console.log('[ERROR] Platform App -> uncaughtException -> err.stack = ' + err.stack)
console.log('[ERROR] Platform App -> uncaughtException -> err = ' + err)
process.exit(1)
})
process.on('unhandledRejection', (reason, p) => {
// Signal user that a necissary node module is missing
if (reason.code == 'MODULE_NOT_FOUND') {
console.log("[ERROR] Dependency library not found. Please try running the 'node setup' command and then restart the Superalgos Platform Client.")
console.log('[ERROR] Platform App -> reason = ' + JSON.stringify(reason))
process.exit(1)
}
console.log('[ERROR] Platform App -> unhandledRejection -> reason = ' + JSON.stringify(reason))
console.log('[ERROR] Platform App -> unhandledRejection -> p = ' + JSON.stringify(p))
process.exit(1)
})
try {
/* Callbacks default responses. */
global.DEFAULT_OK_RESPONSE = {
result: "Ok",
message: "Operation Succeeded"
};
global.DEFAULT_FAIL_RESPONSE = {
result: "Fail",
message: "Operation Failed"
};
global.DEFAULT_RETRY_RESPONSE = {
result: 'Retry',
message: 'Retry Later'
}
global.CUSTOM_OK_RESPONSE = {
result: 'Ok, but check Message',
message: 'Custom Message'
}
global.CUSTOM_FAIL_RESPONSE = {
result: 'Fail Because',
message: 'Custom Message'
}
/* Servers */
let WEB_SERVER = require('./Client/webServer.js')
let DATA_FILE_SERVER = require('./Client/dataFileServer.js')
let PROJECT_FILE_SERVER = require('./Client/projectFileServer.js')
let UI_FILE_SERVER = require('./Client/uiFileServer.js')
let PLUGIN_SERVER = require('./Client/pluginServer.js')
let EVENT_SERVER = require('./Client/eventServer.js')
let TASK_MANAGER_SERVER = require('./Client/taskManagerServer.js')
let CCXT_SERVER = require('./Client/ccxtServer.js')
let WEB3_SERVER = require('./Client/web3Server.js')
let GITHUB_SERVER = require('./Client/githubServer.js')
/* Network Interfaces */
let WEB_SOCKETS_INTERFACE = require('./Client/webSocketsInterface.js')
let HTTP_INTERFACE = require('./Client/httpInterface.js')
/*
Setting up servers running inside this Client.
*/
CL.servers = {}
console.log('SUPERALGOS PLATFORM CLIENT SERVERS:')
console.log('')
CL.servers.WEB_SERVER = WEB_SERVER.newWebServer()
CL.servers.WEB_SERVER.initialize()
CL.servers.WEB_SERVER.run()
console.log('Web Server .................................................. Started')
CL.servers.UI_FILE_SERVER = UI_FILE_SERVER.newUIFileServer()
CL.servers.UI_FILE_SERVER.initialize()
CL.servers.UI_FILE_SERVER.run()
console.log('UI File Server .............................................. Started')
CL.servers.PROJECT_FILE_SERVER = PROJECT_FILE_SERVER.newProjectFileServer()
CL.servers.PROJECT_FILE_SERVER.initialize()
CL.servers.PROJECT_FILE_SERVER.run()
console.log('Project File Server ......................................... Started')
CL.servers.PLUGIN_SERVER = PLUGIN_SERVER.newPluginServer()
CL.servers.PLUGIN_SERVER.initialize()
CL.servers.PLUGIN_SERVER.run()
console.log('Plugin Server ............................................... Started')
CL.servers.DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer()
CL.servers.DATA_FILE_SERVER.initialize()
CL.servers.DATA_FILE_SERVER.run()
console.log('Data File Server ............................................ Started')
CL.servers.EVENT_SERVER = EVENT_SERVER.newEventServer()
CL.servers.EVENT_SERVER.initialize()
CL.servers.EVENT_SERVER.run()
console.log('Events Server ............................................... Started')
TASK_MANAGER_SERVER = TASK_MANAGER_SERVER.newTaskManagerServer()
TASK_MANAGER_SERVER.initialize()
TASK_MANAGER_SERVER.run()
console.log('Task Manager Server ......................................... Started')
CL.servers.CCXT_SERVER = CCXT_SERVER.newCCXTServer()
CL.servers.CCXT_SERVER.initialize()
CL.servers.CCXT_SERVER.run()
console.log('CCXT Server ................................................. Started')
CL.servers.WEB3_SERVER = WEB3_SERVER.newWeb3Server()
CL.servers.WEB3_SERVER.initialize()
CL.servers.WEB3_SERVER.run()
console.log('WEB3 Server ................................................. Started')
CL.servers.GITHUB_SERVER = GITHUB_SERVER.newGithubServer()
CL.servers.GITHUB_SERVER.initialize()
CL.servers.GITHUB_SERVER.run()
console.log('Github Server ............................................... Started')
console.log('')
console.log('SUPERALGOS PLATFORM CLIENT INTERFACES:')
console.log('')
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface()
WEB_SOCKETS_INTERFACE.initialize()
console.log('Web Sockets Interface ....................................... Listening at port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface()
HTTP_INTERFACE.initialize()
console.log('Http Interface .............................................. Listening at port ' + global.env.CLIENT_HTTP_INTERFACE_PORT)
console.log('')
console.log("You are running Superalgos Beta 11")
console.log('')
console.log("What's new? These are the main new features in this version:")
console.log('')
console.log('Governance System ........................................... Automates the distribution of SA Tokens and allow users to vote on the direction of the project.')
console.log('TensorFlow Integration ...................................... Allows creating and training ML models and use them in trading strategies.')
console.log('')
console.log("What's next? This is the current development pipeline:")
console.log('')
console.log('Superalgos P2P Network ...................................... Will allow algo-traders to share trading signals with Superalgos users consuming these signals via a mobile app.')
console.log('Real-time Trading Signals ................................... Will allow users to emit trading signals and be rewarded with SA Tokens.')
console.log('Superalgos Mobile ........................................... Will allow users to consume trading signals for free and autonomously execute trades from their mobile phones.')
console.log('Ethereum Integration ........................................ Will allow mining data from an Ethereum network node, and bring it into the Superalgos workflow.')
console.log('')
} catch (err) {
console.log('[ERROR] Platform App -> Error = ' + err.stack)
}
}
global.CUSTOM_FAIL_RESPONSE = {
result: 'Fail Because',
message: 'Custom Message'
}
/* Servers */
let WEB_SERVER = require('./Client/webServer.js')
let DATA_FILE_SERVER = require('./Client/dataFileServer.js')
let PROJECT_FILE_SERVER = require('./Client/projectFileServer.js')
let UI_FILE_SERVER = require('./Client/uiFileServer.js')
let PLUGIN_SERVER = require('./Client/pluginServer.js')
let EVENT_SERVER = require('./Client/eventServer.js')
let TASK_MANAGER_SERVER = require('./Client/taskManagerServer.js')
let CCXT_SERVER = require('./Client/ccxtServer.js')
let WEB3_SERVER = require('./Client/web3Server.js')
let GITHUB_SERVER = require('./Client/githubServer.js')
/* Network Interfaces */
let WEB_SOCKETS_INTERFACE = require('./Client/webSocketsInterface.js')
let HTTP_INTERFACE = require('./Client/httpInterface.js')
/*
The CL object is accesible everywhere at the Superalgos Client.
It provides access to all modules built for this Client.
*/
global.CL = {}
/*
The SA object is accesible everywhere at the Superalgos Client.
It provides access to all modules built for Superalgos in general.
*/
global.SA = {}
/*
First thing is to load the project schema file.
*/
global.PROJECTS_SCHEMA = require(global.env.PATH_TO_PROJECT_SCHEMA)
/*
Setting up the modules that will be available for the Servers Running inside this Client
*/
let MULTI_PROJECT = require('../MultiProject.js');
let MULTI_PROJECT_MODULE = MULTI_PROJECT.newMultiProject()
MULTI_PROJECT_MODULE.initialize(CL, 'CL')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
nodeFetch: require('node-fetch'),
open: require('open'),
http: require('http'),
ccxt: require('ccxt')
}
/*
Setting up servers running inside this Client.
*/
CL.servers = {}
console.log('SUPERALGOS PLATFORM CLIENT SERVERS:')
console.log('')
CL.servers.WEB_SERVER = WEB_SERVER.newWebServer()
CL.servers.WEB_SERVER.initialize()
CL.servers.WEB_SERVER.run()
console.log('Web Server .................................................. Started')
CL.servers.UI_FILE_SERVER = UI_FILE_SERVER.newUIFileServer()
CL.servers.UI_FILE_SERVER.initialize()
CL.servers.UI_FILE_SERVER.run()
console.log('UI File Server .............................................. Started')
CL.servers.PROJECT_FILE_SERVER = PROJECT_FILE_SERVER.newProjectFileServer()
CL.servers.PROJECT_FILE_SERVER.initialize()
CL.servers.PROJECT_FILE_SERVER.run()
console.log('Project File Server ......................................... Started')
CL.servers.PLUGIN_SERVER = PLUGIN_SERVER.newPluginServer()
CL.servers.PLUGIN_SERVER.initialize()
CL.servers.PLUGIN_SERVER.run()
console.log('Plugin Server ............................................... Started')
CL.servers.DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer()
CL.servers.DATA_FILE_SERVER.initialize()
CL.servers.DATA_FILE_SERVER.run()
console.log('Data File Server ............................................ Started')
CL.servers.EVENT_SERVER = EVENT_SERVER.newEventServer()
CL.servers.EVENT_SERVER.initialize()
CL.servers.EVENT_SERVER.run()
console.log('Events Server ............................................... Started')
TASK_MANAGER_SERVER = TASK_MANAGER_SERVER.newTaskManagerServer()
TASK_MANAGER_SERVER.initialize()
TASK_MANAGER_SERVER.run()
console.log('Task Manager Server ......................................... Started')
CL.servers.CCXT_SERVER = CCXT_SERVER.newCCXTServer()
CL.servers.CCXT_SERVER.initialize()
CL.servers.CCXT_SERVER.run()
console.log('CCXT Server ................................................. Started')
CL.servers.WEB3_SERVER = WEB3_SERVER.newWeb3Server()
CL.servers.WEB3_SERVER.initialize()
CL.servers.WEB3_SERVER.run()
console.log('WEB3 Server ................................................. Started')
CL.servers.GITHUB_SERVER = GITHUB_SERVER.newGithubServer()
CL.servers.GITHUB_SERVER.initialize()
CL.servers.GITHUB_SERVER.run()
console.log('Github Server ............................................... Started')
console.log('')
console.log('SUPERALGOS PLATFORM CLIENT INTERFACES:')
console.log('')
WEB_SOCKETS_INTERFACE = WEB_SOCKETS_INTERFACE.newWebSocketsInterface()
WEB_SOCKETS_INTERFACE.initialize()
console.log('Web Sockets Interface ....................................... Listening at port ' + global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT)
HTTP_INTERFACE = HTTP_INTERFACE.newHttpInterface()
HTTP_INTERFACE.initialize()
console.log('Http Interface .............................................. Listening at port ' + global.env.CLIENT_HTTP_INTERFACE_PORT)
console.log('')
console.log("You are running Superalgos Beta 11")
console.log('')
console.log("What's new? These are the main new features in this version:")
console.log('')
console.log('Governance System ........................................... Automates the distribution of SA Tokens and allow users to vote on the direction of the project.')
console.log('TensorFlow Integration ...................................... Allows creating and training ML models and use them in trading strategies.')
console.log('')
console.log("What's next? This is the current development pipeline:")
console.log('')
console.log('Superalgos P2P Network ...................................... Will allow algo-traders to share trading signals with Superalgos users consuming these signals via a mobile app.')
console.log('Real-time Trading Signals ................................... Will allow users to emit trading signals and be rewarded with SA Tokens.')
console.log('Superalgos Mobile ........................................... Will allow users to consume trading signals for free and autonomously execute trades from their mobile phones.')
console.log('Ethereum Integration ........................................ Will allow mining data from an Ethereum network node, and bring it into the Superalgos workflow.')
console.log('')
} catch (err) {
console.log('[ERROR] Platform App -> Error = ' + err.stack)
}
}
-3700
View File
File diff suppressed because it is too large. Load diff
-24
View File
@@ -1,24 +0,0 @@
{
"name": "Superalgos-Plarform",
"version": "0.0.11",
"description": "Superalgos Plarform",
"main": "PlatformApp.js",
"author": {
"name": "Luis-Fernando-Molina"
},
"dependencies": {
"@octokit/rest": "^18.9.0",
"ccxt": "^1.56.40",
"child_process": "^1.0.2",
"ethereumjs-common": "^1.5.2",
"ethereumjs-tx": "^2.1.2",
"ethers": "^5.4.4",
"lookpath": "^1.2.2",
"node-fetch": "^2.6.1",
"open": "^8.2.1",
"rimraf": "^3.0.2",
"simple-git": "^2.42.0",
"web3": "^1.5.2",
"ws": "^8.2.1"
}
}
+53
View File
@@ -0,0 +1,53 @@
/*
This module represents the execution root of the Platform App.
We use this module that is outside the Platform folder to
load all node dependencies and get them ready to the actual App.
*/
/*
The CL object is accesible everywhere at the Superalgos Client.
It provides access to all modules built for this Client.
*/
global.CL = {}
/*
The SA object is accesible everywhere at the Superalgos Desktop App.
It provides access to all modules built for Superalgos in general.
*/
global.SA = {}
/* Load Environment Variables */
let ENVIRONMENT = require('./Environment.js');
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
global.env = ENVIRONMENT_MODULE
/*
First thing is to load the project schema file.
*/
global.PROJECTS_SCHEMA = require(global.env.PATH_TO_PROJECT_SCHEMA)
/*
Setting up the modules that will be available, defined at the Project Schema file.
*/
let MULTI_PROJECT = require('./MultiProject.js');
let MULTI_PROJECT_MODULE = MULTI_PROJECT.newMultiProject()
MULTI_PROJECT_MODULE.initialize(CL, 'CL')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
nodeFetch: require('node-fetch'),
open: require('open'),
http: require('http'),
ccxt: require('ccxt'),
octokit: require("@octokit/rest"),
simpleGit: require('simple-git'),
lookpath: require('lookpath')
}
run()
async function run() {
CL.app = require('./Platform/PlatformApp.js').newPlatformApp()
await CL.app.run()
console.log('Superalgos Platform App is Running!')
}
+313 -1
View File
@@ -1,6 +1,8 @@
{
"requires": true,
"name": "superalgos",
"version": "0.0.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@ethereumjs/common": {
"version": "2.4.0",
@@ -82,6 +84,15 @@
"@ethersproject/bytes": "^5.4.0"
}
},
"@ethersproject/basex": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.4.0.tgz",
"integrity": "sha512-J07+QCVJ7np2bcpxydFVf/CuYo9mZ7T73Pe7KQY4c1lRlrixMeblauMxHXD0MPwFmUHZIILDNViVkykFBZylbg==",
"requires": {
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/properties": "^5.4.0"
}
},
"@ethersproject/bignumber": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.1.tgz",
@@ -108,6 +119,41 @@
"@ethersproject/bignumber": "^5.4.0"
}
},
"@ethersproject/contracts": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.4.1.tgz",
"integrity": "sha512-m+z2ZgPy4pyR15Je//dUaymRUZq5MtDajF6GwFbGAVmKz/RF+DNIPwF0k5qEcL3wPGVqUjFg2/krlCRVTU4T5w==",
"requires": {
"@ethersproject/abi": "^5.4.0",
"@ethersproject/abstract-provider": "^5.4.0",
"@ethersproject/abstract-signer": "^5.4.0",
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/constants": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/transactions": "^5.4.0"
},
"dependencies": {
"@ethersproject/abi": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.1.tgz",
"integrity": "sha512-9mhbjUk76BiSluiiW4BaYyI58KSbDMMQpCLdsAR+RsT2GyATiNYxVv+pGWRrekmsIdY3I+hOqsYQSTkc8L/mcg==",
"requires": {
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/constants": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/keccak256": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/strings": "^5.4.0"
}
}
}
},
"@ethersproject/hash": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.4.0.tgz",
@@ -123,6 +169,45 @@
"@ethersproject/strings": "^5.4.0"
}
},
"@ethersproject/hdnode": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.4.0.tgz",
"integrity": "sha512-pKxdS0KAaeVGfZPp1KOiDLB0jba11tG6OP1u11QnYfb7pXn6IZx0xceqWRr6ygke8+Kw74IpOoSi7/DwANhy8Q==",
"requires": {
"@ethersproject/abstract-signer": "^5.4.0",
"@ethersproject/basex": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/pbkdf2": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/sha2": "^5.4.0",
"@ethersproject/signing-key": "^5.4.0",
"@ethersproject/strings": "^5.4.0",
"@ethersproject/transactions": "^5.4.0",
"@ethersproject/wordlists": "^5.4.0"
}
},
"@ethersproject/json-wallets": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.4.0.tgz",
"integrity": "sha512-igWcu3fx4aiczrzEHwG1xJZo9l1cFfQOWzTqwRw/xcvxTk58q4f9M7cjh51EKphMHvrJtcezJ1gf1q1AUOfEQQ==",
"requires": {
"@ethersproject/abstract-signer": "^5.4.0",
"@ethersproject/address": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/hdnode": "^5.4.0",
"@ethersproject/keccak256": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/pbkdf2": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/random": "^5.4.0",
"@ethersproject/strings": "^5.4.0",
"@ethersproject/transactions": "^5.4.0",
"aes-js": "3.0.0",
"scrypt-js": "3.0.1"
}
},
"@ethersproject/keccak256": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.4.0.tgz",
@@ -152,6 +237,15 @@
"@ethersproject/logger": "^5.4.0"
}
},
"@ethersproject/pbkdf2": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.4.0.tgz",
"integrity": "sha512-x94aIv6tiA04g6BnazZSLoRXqyusawRyZWlUhKip2jvoLpzJuLb//KtMM6PEovE47pMbW+Qe1uw+68ameJjB7g==",
"requires": {
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/sha2": "^5.4.0"
}
},
"@ethersproject/properties": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.1.tgz",
@@ -160,6 +254,48 @@
"@ethersproject/logger": "^5.4.0"
}
},
"@ethersproject/providers": {
"version": "5.4.5",
"resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.4.5.tgz",
"integrity": "sha512-1GkrvkiAw3Fj28cwi1Sqm8ED1RtERtpdXmRfwIBGmqBSN5MoeRUHuwHPppMtbPayPgpFcvD7/Gdc9doO5fGYgw==",
"requires": {
"@ethersproject/abstract-provider": "^5.4.0",
"@ethersproject/abstract-signer": "^5.4.0",
"@ethersproject/address": "^5.4.0",
"@ethersproject/basex": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/constants": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/networks": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/random": "^5.4.0",
"@ethersproject/rlp": "^5.4.0",
"@ethersproject/sha2": "^5.4.0",
"@ethersproject/strings": "^5.4.0",
"@ethersproject/transactions": "^5.4.0",
"@ethersproject/web": "^5.4.0",
"bech32": "1.1.4",
"ws": "7.4.6"
},
"dependencies": {
"ws": {
"version": "7.4.6",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A=="
}
}
},
"@ethersproject/random": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.4.0.tgz",
"integrity": "sha512-pnpWNQlf0VAZDEOVp1rsYQosmv2o0ITS/PecNw+mS2/btF8eYdspkN0vIXrCMtkX09EAh9bdk8GoXmFXM1eAKw==",
"requires": {
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/logger": "^5.4.0"
}
},
"@ethersproject/rlp": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.4.0.tgz",
@@ -169,6 +305,16 @@
"@ethersproject/logger": "^5.4.0"
}
},
"@ethersproject/sha2": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.4.0.tgz",
"integrity": "sha512-siheo36r1WD7Cy+bDdE1BJ8y0bDtqXCOxRMzPa4bV1TGt/eTUUt03BHoJNB6reWJD8A30E/pdJ8WFkq+/uz4Gg==",
"requires": {
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"hash.js": "1.1.7"
}
},
"@ethersproject/signing-key": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.4.0.tgz",
@@ -182,6 +328,18 @@
"hash.js": "1.1.7"
}
},
"@ethersproject/solidity": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.4.0.tgz",
"integrity": "sha512-XFQTZ7wFSHOhHcV1DpcWj7VXECEiSrBuv7JErJvB9Uo+KfCdc3QtUZV+Vjh/AAaYgezUEKbCtE6Khjm44seevQ==",
"requires": {
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/keccak256": "^5.4.0",
"@ethersproject/sha2": "^5.4.0",
"@ethersproject/strings": "^5.4.0"
}
},
"@ethersproject/strings": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.4.0.tgz",
@@ -208,6 +366,38 @@
"@ethersproject/signing-key": "^5.4.0"
}
},
"@ethersproject/units": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.4.0.tgz",
"integrity": "sha512-Z88krX40KCp+JqPCP5oPv5p750g+uU6gopDYRTBGcDvOASh6qhiEYCRatuM/suC4S2XW9Zz90QI35MfSrTIaFg==",
"requires": {
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/constants": "^5.4.0",
"@ethersproject/logger": "^5.4.0"
}
},
"@ethersproject/wallet": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.4.0.tgz",
"integrity": "sha512-wU29majLjM6AjCjpat21mPPviG+EpK7wY1+jzKD0fg3ui5fgedf2zEu1RDgpfIMsfn8fJHJuzM4zXZ2+hSHaSQ==",
"requires": {
"@ethersproject/abstract-provider": "^5.4.0",
"@ethersproject/abstract-signer": "^5.4.0",
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/hdnode": "^5.4.0",
"@ethersproject/json-wallets": "^5.4.0",
"@ethersproject/keccak256": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/random": "^5.4.0",
"@ethersproject/signing-key": "^5.4.0",
"@ethersproject/transactions": "^5.4.0",
"@ethersproject/wordlists": "^5.4.0"
}
},
"@ethersproject/web": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.4.0.tgz",
@@ -220,6 +410,18 @@
"@ethersproject/strings": "^5.4.0"
}
},
"@ethersproject/wordlists": {
"version": "5.4.0",
"resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.4.0.tgz",
"integrity": "sha512-FemEkf6a+EBKEPxlzeVgUaVSodU7G0Na89jqKjmWMlDB0tomoU8RlEMgUvXyqtrg8N4cwpLh8nyRnm1Nay1isA==",
"requires": {
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/strings": "^5.4.0"
}
},
"@kwsites/file-exists": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz",
@@ -410,6 +612,11 @@
"negotiator": "0.6.2"
}
},
"aes-js": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz",
"integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0="
},
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
@@ -496,6 +703,11 @@
"tweetnacl": "^0.14.3"
}
},
"bech32": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz",
"integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ=="
},
"before-after-hook": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
@@ -714,6 +926,16 @@
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
"ccxt": {
"version": "1.56.41",
"resolved": "https://registry.npmjs.org/ccxt/-/ccxt-1.56.41.tgz",
"integrity": "sha512-NWx0tucvlSZ01SUB+nmeCQy7tYsypf4qGGd8hMXX8KYBGhtYVOHurFYs3Bk3DVjpTq0d6rxSYfbLxr6FIMqwKg=="
},
"child_process": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/child_process/-/child_process-1.0.2.tgz",
"integrity": "sha1-sffn/HPSXn/R1FWtyU4UODAYK1o="
},
"chownr": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
@@ -1175,6 +1397,36 @@
"setimmediate": "^1.0.5"
}
},
"ethereumjs-common": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz",
"integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA=="
},
"ethereumjs-tx": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz",
"integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==",
"requires": {
"ethereumjs-common": "^1.5.0",
"ethereumjs-util": "^6.0.0"
},
"dependencies": {
"ethereumjs-util": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz",
"integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==",
"requires": {
"@types/bn.js": "^4.11.3",
"bn.js": "^4.11.0",
"create-hash": "^1.1.2",
"elliptic": "^6.5.2",
"ethereum-cryptography": "^0.1.3",
"ethjs-util": "0.1.6",
"rlp": "^2.2.3"
}
}
}
},
"ethereumjs-util": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.0.tgz",
@@ -1203,6 +1455,61 @@
}
}
},
"ethers": {
"version": "5.4.6",
"resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.6.tgz",
"integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==",
"requires": {
"@ethersproject/abi": "5.4.1",
"@ethersproject/abstract-provider": "5.4.1",
"@ethersproject/abstract-signer": "5.4.1",
"@ethersproject/address": "5.4.0",
"@ethersproject/base64": "5.4.0",
"@ethersproject/basex": "5.4.0",
"@ethersproject/bignumber": "5.4.1",
"@ethersproject/bytes": "5.4.0",
"@ethersproject/constants": "5.4.0",
"@ethersproject/contracts": "5.4.1",
"@ethersproject/hash": "5.4.0",
"@ethersproject/hdnode": "5.4.0",
"@ethersproject/json-wallets": "5.4.0",
"@ethersproject/keccak256": "5.4.0",
"@ethersproject/logger": "5.4.1",
"@ethersproject/networks": "5.4.2",
"@ethersproject/pbkdf2": "5.4.0",
"@ethersproject/properties": "5.4.1",
"@ethersproject/providers": "5.4.5",
"@ethersproject/random": "5.4.0",
"@ethersproject/rlp": "5.4.0",
"@ethersproject/sha2": "5.4.0",
"@ethersproject/signing-key": "5.4.0",
"@ethersproject/solidity": "5.4.0",
"@ethersproject/strings": "5.4.0",
"@ethersproject/transactions": "5.4.0",
"@ethersproject/units": "5.4.0",
"@ethersproject/wallet": "5.4.0",
"@ethersproject/web": "5.4.0",
"@ethersproject/wordlists": "5.4.0"
},
"dependencies": {
"@ethersproject/abi": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.4.1.tgz",
"integrity": "sha512-9mhbjUk76BiSluiiW4BaYyI58KSbDMMQpCLdsAR+RsT2GyATiNYxVv+pGWRrekmsIdY3I+hOqsYQSTkc8L/mcg==",
"requires": {
"@ethersproject/address": "^5.4.0",
"@ethersproject/bignumber": "^5.4.0",
"@ethersproject/bytes": "^5.4.0",
"@ethersproject/constants": "^5.4.0",
"@ethersproject/hash": "^5.4.0",
"@ethersproject/keccak256": "^5.4.0",
"@ethersproject/logger": "^5.4.0",
"@ethersproject/properties": "^5.4.0",
"@ethersproject/strings": "^5.4.0"
}
}
}
},
"ethjs-unit": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz",
@@ -1856,6 +2163,11 @@
"json-buffer": "3.0.0"
}
},
"lookpath": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/lookpath/-/lookpath-1.2.2.tgz",
"integrity": "sha512-k2Gmn8iV6qdME3ztZC2spubmQISimFOPLuQKiPaLcVdRz0IpdxrNClVepMlyTJlhodm/zG/VfbkWERm3kUIh+Q=="
},
"lowercase-keys": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
+12
View File
@@ -1,7 +1,19 @@
{
"name": "superalgos",
"version": "0.0.11",
"description": "Superalgos",
"author": {
"name": "Luis-Fernando-Molina"
},
"dependencies": {
"@octokit/rest": "^18.10.0",
"ccxt": "^1.56.41",
"child_process": "^1.0.2",
"ethereumjs-common": "^1.5.2",
"ethereumjs-tx": "^2.1.2",
"ethers": "^5.4.6",
"http": "0.0.1-security",
"lookpath": "^1.2.2",
"node-fetch": "^2.6.1",
"open": "^8.2.1",
"simple-git": "^2.45.1",
+9 -3
View File
@@ -1,3 +1,9 @@
/*
The Superalgos Platform is a software for algo-traders:
This module represents the Nodejs command that users have to start the Platform App..
*/
if (
process.argv.includes("help") ||
@@ -79,12 +85,12 @@ console.log('')
console.log('')
const fs = require('fs')
const path = './Platform/node_modules'
const path = './node_modules'
if ( fs.existsSync(path) ) {
try {
const { fork } = require('child_process')
fork('./Platform/PlatformApp.js', process.argv, options)
fork('./PlatformRoot.js', process.argv, options)
} catch (err) {
console.log('')
console.log('Fail to create Superalgos Platform Client Process.')
@@ -94,7 +100,7 @@ if ( fs.existsSync(path) ) {
}
} else {
console.log('')
console.log('ERROR: node_modules does not exist. Try running node setup to solve this issue. Then try again. You can finded detailed instructions for this in the ReadMe.')
console.log('ERROR: node_modules does not exist. Try running "node setup" to solve this issue. Then try again. You can finded detailed instructions for this in the ReadMe.')
console.log('')
}