Merge pull request #1777 from Luis-Fernando-Molina/develop

Contribution: All node_modules moved to the root Superalgos directory
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-09-16 12:36:50 -04:00
commit 45a57d9f27
67 files changed
+1498 -4582

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
{
"folders": [
{
"path": "C:\\Superalgos\\Platform"
},
{
"path": "C:\\Superalgos\\Projects"
}
],
"settings": {}
}
+13
View File
@@ -0,0 +1,13 @@
{
"folders": [
{
"path": "C:\\Superalgos\\TaskServer"
},
{
"path": "C:\\Superalgos\\Projects"
}
],
"settings": {
"search.maintainFileSearchCache": true
}
}
+75
View File
@@ -0,0 +1,75 @@
exports.newDesktopRoot = function newDesktopRoot() {
/*
This module represents the execution root of the Desktop App.
We use this module that is outside the Desktop folder to
load all node dependencies and get them ready to the actual App.
*/
let thisObject = {
run: run
}
return thisObject
async function run() {
/*
The DK object is accesible everywhere at the Superalgos Desktop App.
It provides access to all modules built for this App.
*/
global.DK = {}
/*
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('./EnvironmentForDebug.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(DK, 'DK')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
util: require('util'),
path: require('path'),
web3: require('web3'),
ws: require('ws'),
open: require('open'),
http: require('http'),
octokit: require("@octokit/rest"),
simpleGit: require('simple-git')
}
/*
We will use this User Profile for Testing Purposes.
{
"githubUsername": "Test-Network-Client-Profile",
"address": "0xA0dCDA81b42C5EBDc45EC2875C72274B67560246",
"privateKey": "0x5fed4817a87431c8a328d0936561e63f45b6db289adac6125b9306ded644dfe9"
}
*/
DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID = "baa2f02c-2920-4edb-a103-d452fc61d82f"
DK.TEST_NETWORK_CLIENT_USER_PROFILE_HANDLE = "Test-Network-Client-Profile"
DK.TEST_NETWORK_CLIENT_USER_PROFILE_PRIVATE_KEY = "0x5fed4817a87431c8a328d0936561e63f45b6db289adac6125b9306ded644dfe9"
run()
async function run() {
DK.app = require('./Desktop/DesktopApp.js').newDesktopApp()
await DK.app.run()
console.log('Superalgos Desktop App is Running!')
}
}
}
+1 -2
View File
@@ -4,12 +4,11 @@ exports.newEnvironment = function () {
WEB_SERVER_URL: 'localhost',
CLIENT_WEB_SOCKETS_INTERFACE_PORT: 18041,
CLIENT_HTTP_INTERFACE_PORT: 34248,
PATH_TO_TASK_SERVER: './TaskServer',
PATH_TO_DATA_STORAGE: './Data-Storage',
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',
-1
View File
@@ -8,7 +8,6 @@ exports.newEnvironment = function () {
DESKTOP_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
CLIENT_HTTP_INTERFACE_PORT: 34248,
DESKTOP_HTTP_INTERFACE_PORT: 34249,
PATH_TO_TASK_SERVER: './TaskServer',
PATH_TO_DATA_STORAGE: './Data-Storage',
PATH_TO_PROJECTS: './Projects',
PATH_TO_LOG_FILES: './Log-Files',
+65
View File
@@ -0,0 +1,65 @@
exports.newNetworkRoot = function newNetworkRoot() {
/*
This module represents the execution root of the Network Node.
We use this module that is outside the Network folder to
load all node dependencies and get them ready to the actual node.
*/
let thisObject = {
run: run
}
return thisObject
async function run() {
/*
The NT object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for this Network.
*/
global.NT = {}
/*
The SA object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for Superalgos in general.
*/
global.SA = {}
/* Load Environment Variables */
let ENVIRONMENT = require('./EnvironmentForDebug.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(NT, 'NT')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
nodeFetch: require('node-fetch'),
web3: require('web3'),
ws: require('ws')
}
/*
We will use this User Profile for testing purposes.
{
"githubUsername": "Test-Network-Node-Profile",
"address": "0xa153469c57A91F5a59Fc6c45A37aD8dbad85e417",
"privateKey": "0xac498ae59407e6b68429a814f64da2339550f93a767578e28c161ff119159271"
}
*/
NT.NETWORK_NODE_USER_PROFILE_HANDLE = "Test-Network-Node-Profile"
NT.NETWORK_NODE_USER_PROFILE_PRIVATE_KEY = "0xac498ae59407e6b68429a814f64da2339550f93a767578e28c161ff119159271"
NT.app = require('./Network/NetwokNode.js').newNetworkNode()
NT.app.run()
console.log('Superalgos Network is Running.')
}
}
+26 -26
View File
@@ -75,7 +75,7 @@ exports.newGithubServer = function newGithubServer() {
async function doGithub() {
const { Octokit } = require("@octokit/rest")
const { Octokit } = SA.nodeModules.octokit
const octokit = new Octokit({
auth: token,
@@ -93,7 +93,7 @@ exports.newGithubServer = function newGithubServer() {
while (lastPage === false) {
try {
page++
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
let listResponse = await octokit[endpoint][method]({
owner,
repo,
@@ -204,7 +204,7 @@ exports.newGithubServer = function newGithubServer() {
try {
const repo = repository
const owner = 'Superalgos'
const { Octokit } = require("@octokit/rest")
const { Octokit } = SA.nodeModules.octokit
const octokit = new Octokit({
auth: token,
userAgent: 'Superalgos Beta 11'
@@ -223,7 +223,7 @@ exports.newGithubServer = function newGithubServer() {
try {
page++
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
let listResponse = await octokit.rest.pulls.list({
owner: owner,
@@ -284,7 +284,7 @@ exports.newGithubServer = function newGithubServer() {
/*
Lets get the files changed at this Pull Request.
*/
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
let listResponse = await octokit.rest.pulls.listFiles({
owner: owner,
repo: repo,
@@ -309,7 +309,7 @@ exports.newGithubServer = function newGithubServer() {
console.log('[WARN] Github Server -> mergeGithubPullRequests -> Merge Failed -> Pull Request "' + pullRequest.title + '" not merged because Github could not merge it. -> mergeResponse.message = ' + mergeResponse.data.message)
} else {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.data.message)
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -333,7 +333,7 @@ exports.newGithubServer = function newGithubServer() {
let pullRequestFile = filesChanged[j]
let fileContentUrl = pullRequestFile.raw_url
if (fileContentUrl.indexOf('Governance/Plugins/User-Profiles') >= 0) {
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -341,7 +341,7 @@ exports.newGithubServer = function newGithubServer() {
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (filesChanged.length - 1) + ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged.'
});
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
@@ -379,7 +379,7 @@ exports.newGithubServer = function newGithubServer() {
if (githubUsername !== fileName) {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the File Name. -> Github Username = ' + githubUsername + '-> fileName = ' + fileName)
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -387,7 +387,7 @@ exports.newGithubServer = function newGithubServer() {
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the name of the User Profile Plugin File.\n\n File Name = "' + fileName + '"'
});
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
@@ -402,8 +402,8 @@ exports.newGithubServer = function newGithubServer() {
/*
Validation #3: The file changed at the PR is a User Profile.
*/
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
fileContent = await CL.projects.foundations.utilities.webAccess.fetchAPIDataFile(fileContentUrl)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
fileContent = await PL.projects.foundations.utilities.webAccess.fetchAPIDataFile(fileContentUrl)
userProfile = JSON.parse(fileContent)
if (userProfile.type !== 'User Profile') {
@@ -421,7 +421,7 @@ exports.newGithubServer = function newGithubServer() {
if (messageSigned !== githubUsername) {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #4 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the Message Signed at the User Profile. -> Github Username = ' + githubUsername + '-> messageSigned = ' + messageSigned)
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -429,7 +429,7 @@ exports.newGithubServer = function newGithubServer() {
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the Message Signed at the User Profile.\n\n Message Signed = "' + messageSigned + '"'
});
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
@@ -447,7 +447,7 @@ exports.newGithubServer = function newGithubServer() {
if (userProfile.name !== githubUsername) {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #5 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the User Profile node\'s name. -> Github Username = ' + githubUsername + '-> userProfile.name = ' + userProfile.name)
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -455,7 +455,7 @@ exports.newGithubServer = function newGithubServer() {
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the User Profile node\'s name.\n\n User Profile Name = "' + userProfile.name + '"'
});
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
@@ -495,7 +495,7 @@ exports.newGithubServer = function newGithubServer() {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #6 Failed -> Pull Request "' + pullRequest.title + '" not merged because the User Profile Id already exists and belongs to another User Profile on record. -> Profile Id = ' + userProfile.id + '-> User Profile with the same Id = ' + testUserProfile)
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -503,7 +503,7 @@ exports.newGithubServer = function newGithubServer() {
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the User Profile Id already exists and belongs to another User Profile on record. \n\nUser Profile Id = "' + userProfile.id + '" \n\n User Profile with the same Id = "' + testUserProfile + '"'
});
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
@@ -538,7 +538,7 @@ exports.newGithubServer = function newGithubServer() {
let config = JSON.parse(otherUserProfile.config)
let messageSigned = JSON.stringify(config.signature)
let serverResponse = await CL.servers.WEB3_SERVER.recoverAddress(
let serverResponse = await PL.servers.WEB3_SERVER.recoverAddress(
messageSigned
)
userProfileIdMap.set(serverResponse.address, otherUserProfile.name)
@@ -546,7 +546,7 @@ exports.newGithubServer = function newGithubServer() {
let config = JSON.parse(userProfile.config)
let messageSigned = JSON.stringify(config.signature)
let serverResponse = await CL.servers.WEB3_SERVER.recoverAddress(
let serverResponse = await PL.servers.WEB3_SERVER.recoverAddress(
messageSigned
)
@@ -556,7 +556,7 @@ exports.newGithubServer = function newGithubServer() {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #7 Failed -> Pull Request "' + pullRequest.title + '" not merged because the User Profile Blockchain Account already exists and belongs to another User Profile on record. -> Profile Blockchain Account = ' + serverResponse.address + '-> User Profile with the same Blockchain Account = ' + testUserProfile)
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -564,7 +564,7 @@ exports.newGithubServer = function newGithubServer() {
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the User Profile Blockchain Account already exists and belongs to another User Profile on record. \n\nUser Profile Blockchain Account = "' + serverResponse.address + '" \n\n User Profile with the same Blockchain Account = "' + testUserProfile + '"'
});
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
@@ -582,7 +582,7 @@ exports.newGithubServer = function newGithubServer() {
/*
All validations passed, we will proceed an merge this Pull Request.
*/
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
mergeResponse = await octokit.rest.pulls.merge({
owner: owner,
repo: repo,
@@ -603,7 +603,7 @@ exports.newGithubServer = function newGithubServer() {
try {
page++
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
let listResponse = await octokit.rest.pulls.list({
owner: owner,
@@ -631,7 +631,7 @@ exports.newGithubServer = function newGithubServer() {
for (let i = 0; i < githubPrListMaster.length; i++) {
let pullRequest = githubPrListMaster[i]
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
@@ -639,7 +639,7 @@ exports.newGithubServer = function newGithubServer() {
body: 'Hi, this is the Superalgos Governance System taking notice that you have submitted a pull request directly to the master branch.\n\nThanks for submitting a PR to the Superalgos Project. We value every contribution and everyone is welcome to send PRs. Unfortunatelly we are not merging pull requests directly into the master branch. Consider resubmitting to the develop branch intstead. For your convinienve, you can swithch branches from within the app, at the footer of the Docs tab. \n\n I will close this pull request now and look forward for your next contribution either to the develop branch or any other branch available for this purpose.'
});
await CL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
+34 -29
View File
@@ -24,13 +24,13 @@ exports.newHttpInterface = function newHttpInterface() {
/*
We will create an HTTP Server and leave it running forever.
*/
SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.CLIENT_HTTP_INTERFACE_PORT)
/* Starting the browser now is optional */
if (process.argv.includes("noBrowser")) {
//Running Client only with no UI.
} else {
SA.nodeModules.open('http://localhost:' + global.env.CLIENT_HTTP_INTERFACE_PORT)
}
SA.nodeModules.http.createServer(onHttpRequest).listen(global.env.CLIENT_HTTP_INTERFACE_PORT)
/* Starting the browser now is optional */
if (process.argv.includes("noBrowser")) {
//Running Client only with no UI.
} else {
SA.nodeModules.open('http://localhost:' + global.env.CLIENT_HTTP_INTERFACE_PORT)
}
}
function onHttpRequest(httpRequest, httpResponse) {
@@ -52,7 +52,7 @@ exports.newHttpInterface = function newHttpInterface() {
switch (params.method) {
case 'getNetworkClientStatus': {
let serverResponse = await CL.servers.WEB3_SERVER.getNetworkClientStatus(
let serverResponse = await PL.servers.WEB3_SERVER.getNetworkClientStatus(
params.host,
params.port,
params.interface
@@ -63,7 +63,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'createWalletAccount': {
let serverResponse = await CL.servers.WEB3_SERVER.createWalletAccount(
let serverResponse = await PL.servers.WEB3_SERVER.createWalletAccount(
params.entropy
)
@@ -72,7 +72,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'getWalletBalances': {
let serverResponse = await CL.servers.WEB3_SERVER.getWalletBalances(
let serverResponse = await PL.servers.WEB3_SERVER.getWalletBalances(
params.host,
params.port,
params.interface,
@@ -84,7 +84,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'signData': {
let serverResponse = await CL.servers.WEB3_SERVER.signData(
let serverResponse = await PL.servers.WEB3_SERVER.signData(
params.privateKey,
params.data
)
@@ -94,7 +94,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'recoverAddress': {
let serverResponse = await CL.servers.WEB3_SERVER.recoverAddress(
let serverResponse = await PL.servers.WEB3_SERVER.recoverAddress(
params.signature
)
@@ -103,7 +103,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'mnemonicToPrivateKey': {
let serverResponse = await CL.servers.WEB3_SERVER.mnemonicToPrivateKey(
let serverResponse = await PL.servers.WEB3_SERVER.mnemonicToPrivateKey(
params.mnemonic
)
@@ -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',
@@ -1000,7 +1000,7 @@ exports.newHttpInterface = function newHttpInterface() {
switch (params.method) {
case 'getGithubStars': {
let serverResponse = await CL.servers.GITHUB_SERVER.getGithubStars(
let serverResponse = await PL.servers.GITHUB_SERVER.getGithubStars(
params.repository,
params.username,
params.token
@@ -1011,7 +1011,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'getGithubWatchers': {
let serverResponse = await CL.servers.GITHUB_SERVER.getGithubWatchers(
let serverResponse = await PL.servers.GITHUB_SERVER.getGithubWatchers(
params.repository,
params.username,
params.token
@@ -1022,7 +1022,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'getGithubForks': {
let serverResponse = await CL.servers.GITHUB_SERVER.getGithubForks(
let serverResponse = await PL.servers.GITHUB_SERVER.getGithubForks(
params.repository,
params.username,
params.token
@@ -1033,7 +1033,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'mergePullRequests': {
let serverResponse = await CL.servers.GITHUB_SERVER.mergePullRequests(
let serverResponse = await PL.servers.GITHUB_SERVER.mergePullRequests(
params.commitMessage,
params.username,
params.token
@@ -1044,7 +1044,7 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'payContributors': {
let serverResponse = await CL.servers.WEB3_SERVER.payContributors(
let serverResponse = await PL.servers.WEB3_SERVER.payContributors(
params.contractAddress,
params.contractAbi,
params.paymentsArray,
@@ -1375,6 +1375,11 @@ exports.newHttpInterface = function newHttpInterface() {
let folder = unescape(requestPath[3])
let fileName = unescape(requestPath[4])
/*Beta 12 Refactoring Code: Remove this before realeasing beta 12.*/
if (fileName === 'Superalgos-CL.json') {
fileName = 'Superalgos-PL.json'
}
let response = await SA.projects.foundations.utilities.plugins.getPluginFileContent(
project,
folder,
@@ -1693,7 +1698,7 @@ exports.newHttpInterface = function newHttpInterface() {
break
default:
{
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_CLIENT)
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_CLIENT)
}
}
} catch (err) {
+2 -2
View File
@@ -63,7 +63,7 @@
//console.log('[INFO] Client -> Task Manager Server -> runTask -> Task Name = ' + message.event.taskName)
//console.log('[INFO] Client -> Task Manager Server -> runTask -> Task Id = ' + message.event.taskId)
let path = global.env.PATH_TO_TASK_SERVER + '/Task.js'
let path = './TaskServerRoot.js'
/* Workarround to avoid having the same debug port at the forked process which makes it crash. */
for (let i = 0; i < process.execArgv.length; i++) {
@@ -263,7 +263,7 @@
responseWaiters.set(command.callerId, responseCallBack)
}
CL.servers.EVENT_SERVER.onMessage(JSON.stringify(command), thisObject.onMessage)
PL.servers.EVENT_SERVER.onMessage(JSON.stringify(command), thisObject.onMessage)
} catch (err) {
console.log('[ERROR] Client -> Task Manager Server -> sendCommand -> Error Sending Command to Events Server -> command = ' + JSON.stringify(command))
console.log('[ERROR] Client -> Task Manager Server -> sendCommand -> Error Sending Command to Events Server -> error = ' + err.stack)
+5 -5
View File
@@ -15,7 +15,7 @@ exports.newWeb3Server = function newWeb3Server() {
run: run
}
const Web3 = require('web3');
const Web3 = SA.nodeModules.web3
let web3Map = new Map()
return thisObject
@@ -241,7 +241,7 @@ exports.newWeb3Server = function newWeb3Server() {
async function mnemonicToPrivateKey(mnemonic) {
try {
const ethers = require('ethers')
const ethers = SA.nodeModules.ethers
let wallet = ethers.Wallet.fromMnemonic(mnemonic)
if (wallet.privateKey !== undefined) {
@@ -269,7 +269,7 @@ exports.newWeb3Server = function newWeb3Server() {
let privateKey = response.privateKey
for (let i = 0; i < paymentsArray.length; i++) {
await CL.projects.foundations.utilities.asyncFunctions.sleep(10000)
await PL.projects.foundations.utilities.asyncFunctions.sleep(10000)
let payment = paymentsArray[i]
sendTokens(
i + 1,
@@ -288,14 +288,14 @@ exports.newWeb3Server = function newWeb3Server() {
console.log('---------------------------------------------------------------------------------------------------------------------------------------------------')
console.log('')
const Tx = require('ethereumjs-tx').Transaction;
const Tx = SA.nodeModules.ethereumjsTx.Transaction;
const web3 = new Web3(new Web3.providers.HttpProvider('https://bsc-dataseed.binance.org/'))
const amount = web3.utils.toHex(tokenAmount)
privateKey = privateKey.replace('0x', '')
const privateKeyBuffer = Buffer.from(privateKey, 'hex')
const contractAbiObject = JSON.parse(contractAbi)
const contract = new web3.eth.Contract(contractAbiObject, contractAddress, { from: fromAddress })
const Common = require('ethereumjs-common').default
const Common = SA.nodeModules.ethereumjsCommon.default
const BSC_FORK = Common.forCustomChain(
'mainnet',
{
+4 -3
View File
@@ -7,7 +7,7 @@
finalize: finalize
}
const WEB_SOCKET = require('ws')
const WEB_SOCKET = SA.nodeModules.ws
let socketServer
let port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
@@ -86,7 +86,7 @@
}
CL.servers.EVENT_SERVER.onMessage(messageToEventServer, onResponse)
PL.servers.EVENT_SERVER.onMessage(messageToEventServer, onResponse)
function onResponse(message) {
socket.send(message)
@@ -97,7 +97,8 @@
}
}
} catch (err) {
console.log('[ERROR] Client -> Web Sockets Interface -> run -> setUpWebSocketServer -> err.message = ' + err.message.substring(0, 1000))
console.log('[ERROR] Client -> Web Sockets Interface -> run -> setUpWebSocketServer -> err.message = ' + err.message)
console.log('[ERROR] Client -> Web Sockets Interface -> run -> setUpWebSocketServer -> err.message = ' + err.stack)
}
}
}
+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.
*/
PL.servers = {}
console.log('SUPERALGOS PLATFORM CLIENT SERVERS:')
console.log('')
PL.servers.WEB_SERVER = WEB_SERVER.newWebServer()
PL.servers.WEB_SERVER.initialize()
PL.servers.WEB_SERVER.run()
console.log('Web Server .................................................. Started')
PL.servers.UI_FILE_SERVER = UI_FILE_SERVER.newUIFileServer()
PL.servers.UI_FILE_SERVER.initialize()
PL.servers.UI_FILE_SERVER.run()
console.log('UI File Server .............................................. Started')
PL.servers.PROJECT_FILE_SERVER = PROJECT_FILE_SERVER.newProjectFileServer()
PL.servers.PROJECT_FILE_SERVER.initialize()
PL.servers.PROJECT_FILE_SERVER.run()
console.log('Project File Server ......................................... Started')
PL.servers.PLUGIN_SERVER = PLUGIN_SERVER.newPluginServer()
PL.servers.PLUGIN_SERVER.initialize()
PL.servers.PLUGIN_SERVER.run()
console.log('Plugin Server ............................................... Started')
PL.servers.DATA_FILE_SERVER = DATA_FILE_SERVER.newDataFileServer()
PL.servers.DATA_FILE_SERVER.initialize()
PL.servers.DATA_FILE_SERVER.run()
console.log('Data File Server ............................................ Started')
PL.servers.EVENT_SERVER = EVENT_SERVER.newEventServer()
PL.servers.EVENT_SERVER.initialize()
PL.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')
PL.servers.CCXT_SERVER = CCXT_SERVER.newCCXTServer()
PL.servers.CCXT_SERVER.initialize()
PL.servers.CCXT_SERVER.run()
console.log('CCXT Server ................................................. Started')
PL.servers.WEB3_SERVER = WEB3_SERVER.newWeb3Server()
PL.servers.WEB3_SERVER.initialize()
PL.servers.WEB3_SERVER.run()
console.log('WEB3 Server ................................................. Started')
PL.servers.GITHUB_SERVER = GITHUB_SERVER.newGithubServer()
PL.servers.GITHUB_SERVER.initialize()
PL.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. [Looking for an Ethereum dev that would like to continue this line of development.]')
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)
}
}
+2 -2
View File
@@ -195,7 +195,7 @@ function newEventsServerClient(networkNode) {
if (networkNode !== undefined) {
if (networkNode.payload !== undefined) {
if (networkNode.payload.uiObject !== undefined) {
networkNode.payload.uiObject.setErrorMessage('Failed to Connect to Superalgos Client via WebSockets. Retrying in 1 minute. Check at this node config if the host property has the IP address of the computer running Superalgos Client.')
networkNode.payload.uiObject.setErrorMessage('Failed to Connect to Superalgos Platform Client via WebSockets. Retrying in 1 minute. Check at this node config if the host property has the IP address of the computer running Superalgos Platform Client.')
}
}
}
@@ -204,7 +204,7 @@ function newEventsServerClient(networkNode) {
if (networkNode !== undefined) {
if (networkNode.payload !== undefined) {
if (networkNode.payload.uiObject !== undefined) {
networkNode.payload.uiObject.setStatus('Connected to Superalgos Client via WebSockets.')
networkNode.payload.uiObject.setStatus('Connected to Superalgos Platform Client via WebSockets.')
retryCommandsPhysics()
}
}
-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.51.98",
"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"
}
}
+60
View File
@@ -0,0 +1,60 @@
/*
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 PL object is accesible everywhere at the Superalgos Platform Client.
It provides access to all modules built for this Client.
*/
global.PL = {}
/*
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(PL, 'PL')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
util: require('util'),
path: require('path'),
ws: require('ws'),
web3: require('web3'),
ethers: require('ethers'),
ethereumjsTx: require('ethereumjs-tx'),
ethereumjsCommon: require('ethereumjs-common'),
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() {
PL.app = require('./Platform/PlatformApp.js').newPlatformApp()
await PL.app.run()
console.log('Superalgos Platform App is Running!')
}
@@ -21,8 +21,8 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () {
}
function getAllFilesInDirectoryAndSubdirectories(dir, callback) {
const { promisify } = require('util');
const { resolve } = require('path');
const { promisify } = SA.nodeModules.util
const { resolve } = SA.nodeModules.path;
const fs = SA.nodeModules.fs;
const readdir = promisify(fs.readdir);
const stat = promisify(fs.stat);
@@ -66,7 +66,7 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () {
/* Function to create folders of missing folders at any path. */
function mkDirByPathSync(targetDir, { isRelativeToScript = false } = {}) {
const path = require('path')
const path = SA.nodeModules.path
targetDir = targetDir.substring(0, targetDir.lastIndexOf('/') + 1);
@@ -77,7 +77,7 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () {
return targetDir.split(sep).reduce((parentDir, childDir) => {
const curDir = path.resolve(baseDir, parentDir, childDir);
try {
const fs = require('fs')
const fs = SA.nodeModules.fs
fs.mkdirSync(curDir);
} catch (err) {
if (err.code === 'EEXIST') { // curDir already exists!
@@ -1,7 +1,7 @@
{
"type": "Project Schema File",
"definition": {
"text": "It is the most basic and low level system-wide configuration file. You will find it at the Projects folder. It contains a list of all integrated projects and for each one the list of javascript modules organized in different categories, like Function Libraries, Utilities, Spaces, Globals, etc; in turn organized into the broather categories UI, TS and CL.",
"text": "It is the most basic and low level system-wide configuration file. You will find it at the Projects folder. It contains a list of all integrated projects and for each one the list of javascript modules organized in different categories, like Function Libraries, Utilities, Spaces, Globals, etc; in turn organized into the broather categories UI, TS and PL.",
"updated": 1614939492529
},
"paragraphs": [
@@ -582,7 +582,7 @@ exports.newFoundationsBotModulesFetchingProcess = function (processIndex) {
Now that we have the endpointNode, the parameters and all the information
needed to place the call to the API.
*/
const fetch = require('node-fetch')
const fetch = SA.nodeModules.nodeFetch
let url = protocol + '://' +
hostName +
portNumber +
@@ -1,11 +0,0 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
}
}
}
@@ -1,10 +0,0 @@
{
"name": "api-data-fetcher-bot",
"version": "1.0.0",
"description": "Api Fetcher Bot",
"main": "FetchingProcess.js",
"author": "Luis Molina, Harrellbm",
"dependencies": {
"node-fetch": "2.6.1"
}
}
@@ -15,12 +15,12 @@
const MAX_OHLCVs_PER_EXECUTION = 10000000
const symbol = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + '/' + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
const ccxt = require('ccxt')
const ccxt = SA.nodeModules.ccxt
/*
This next is required when using an exchange that uses fetchTrades in place of fetchOHLCVs
in order to be able to access the method that builds the OHLCVs, and this method is inside the CCTX library.
*/
const ccxtMisc = require('./node_modules/ccxt/js/base/functions/misc')
const ccxtMisc = SA.nodeModules.ccxtMisc
let fetchType = "by Time"
let lastId
@@ -1,13 +0,0 @@
{
"name": "exchange-raw-data",
"version": "0.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ccxt": {
"version": "1.51.98",
"resolved": "https://registry.npmjs.org/ccxt/-/ccxt-1.51.98.tgz",
"integrity": "sha512-3sgRDrOnD6IE06yGr+F0YcQh22eNyKiZ3nQP+QdZt8W/zUUsl4CaHT5I7Zqqz7ObKdv4YcdMCv8j9khTpBNz4w=="
}
}
}
@@ -1,12 +0,0 @@
{
"name": "exchange-raw-data",
"version": "0.0.6",
"description": "Sensor Bot",
"main": "HistoricOHLCVs.js",
"author": {
"name": "Luis-Fernando-Molina"
},
"dependencies": {
"ccxt": "^1.51.98"
}
}
@@ -88,7 +88,7 @@ exports.newFoundationsBotModulesCheckWebhook = function (processIndex) {
function saveMessages() {
try {
let http = require('http');
let http = SA.nodeModules.http
let url = 'http://' + global.env.WEB_SERVER_URL +
':' + global.env.CLIENT_HTTP_INTERFACE_PORT +
'/Webhook/Fetch-Messages/' +
@@ -38,7 +38,7 @@ exports.newFoundationsBotModulesDiscordBot = function (processIndex) {
function finalize() {}
function sendMessage(message) {
const https = require('https')
const https = SA.nodeModules.https
try {
message = formatMessage(message)
@@ -38,7 +38,7 @@ exports.newFoundationsBotModulesSlackBot = function (processIndex) {
function finalize() {}
function sendMessage(message) {
const https = require('https')
const https = SA.nodeModules.https
try {
message = formatMessage(message)
@@ -22,7 +22,7 @@ exports.newFoundationsBotModulesTelegramBot = function (processIndex) {
thisObject.chatId = chatId
const Telegraf = require('telegraf')
const Telegraf = SA.nodeModules.telegraf
thisObject.telegramBot = new Telegraf(botToken)
thisObject.telegramBot.start((ctx) => ctx.reply('Hi! I am the Telegram Bot that will tell you what happens with your trading session.'))
@@ -41,7 +41,7 @@ exports.newFoundationsBotModulesTelegramBot = function (processIndex) {
thisObject.telegramBot.launch()
const Telegram = require('telegraf/telegram')
const Telegram = SA.nodeModules.telegram
thisObject.telegramAPI = new Telegram(botToken)
@@ -1,57 +0,0 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"debug": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
"integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
"requires": {
"ms": "2.1.2"
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
},
"module-alias": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.2.tgz",
"integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q=="
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
},
"sandwich-stream": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-2.0.2.tgz",
"integrity": "sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ=="
},
"telegraf": {
"version": "3.38.0",
"resolved": "https://registry.npmjs.org/telegraf/-/telegraf-3.38.0.tgz",
"integrity": "sha512-va4VlrKWp64JrowFoZX/NPzzA6q38kvaIukVXOWFO1V+jR1G8+hCfgJy4TX8Z3rwLJzwaBEet1QhikHDRZWl3A==",
"requires": {
"debug": "^4.0.1",
"minimist": "^1.2.0",
"module-alias": "^2.2.2",
"node-fetch": "^2.2.0",
"sandwich-stream": "^2.0.1",
"telegram-typings": "^3.6.0"
}
},
"telegram-typings": {
"version": "3.6.1",
"resolved": "https://registry.npmjs.org/telegram-typings/-/telegram-typings-3.6.1.tgz",
"integrity": "sha512-njVv1EAhIZnmQVLocZEADYUyqA1WIXuVcDYlsp+mXua/XB0pxx+PKtMSPeZ/EE4wPWTw9h/hA9ASTT6yQelkiw=="
}
}
}
@@ -1,19 +0,0 @@
{
"name": "announcements",
"version": "0.0.6",
"description": "Social Bots",
"main": "SocialBots.js",
"author": {
"name": "Luis-Fernando-Molina"
},
"dependencies": {
"debug": "^4.3.1",
"minimist": "^1.2.5",
"module-alias": "^2.2.2",
"ms": "^2.1.2",
"node-fetch": "^2.6.1",
"sandwich-stream": "^2.0.2",
"telegraf": "^3.38.0",
"telegram-typings": "^3.6.1"
}
}
@@ -16,7 +16,7 @@
let options = {}
let exchange
const ccxt = require('ccxt')
const ccxt = SA.nodeModules.ccxt
return thisObject;
@@ -1,13 +0,0 @@
{
"name": "apis",
"version": "0.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ccxt": {
"version": "1.51.98",
"resolved": "https://registry.npmjs.org/ccxt/-/ccxt-1.51.98.tgz",
"integrity": "sha512-3sgRDrOnD6IE06yGr+F0YcQh22eNyKiZ3nQP+QdZt8W/zUUsl4CaHT5I7Zqqz7ObKdv4YcdMCv8j9khTpBNz4w=="
}
}
}
@@ -1,12 +0,0 @@
{
"name": "apis",
"version": "0.0.6",
"description": "Exchange APIs",
"main": "ExchangeAPI.js",
"author": {
"name": "Luis-Fernando-Molina"
},
"dependencies": {
"ccxt": "^1.51.98"
}
}
@@ -18,7 +18,7 @@
let responseWaiters = new Map()
let WEB_SOCKETS_CLIENT
const WEB_SOCKET = require('ws')
const WEB_SOCKET = SA.nodeModules.ws
if (host === undefined) {
host = 'localhost'
@@ -49,7 +49,7 @@
WEB_SOCKETS_CLIENT.onerror = err => {
console.log('[ERROR] Task Server -> Event Server Client -> setuptWebSockets -> On connection error -> error = ' + err.stack)
console.log('[ERROR] This could mean that the port '+ port +' is taken by some other app running at your system. To resolve this issue, please pick another port number and change it at the .ENV file inside the Superalgos folder AND at the .Environment.js file inside the TaskServer folder. After that run the app again. ')
console.log('[ERROR] If you are debugging, it can also mean that the Superalgos Client is not running. ')
console.log('[ERROR] If you are debugging, it can also mean that the Superalgos Platform Client is not running. ')
}
WEB_SOCKETS_CLIENT.onopen = () => {
try {
@@ -1,6 +1,6 @@
exports.newFileStorage = function newFileStorage(processIndex, host, port) {
const ip = require("ip");
const ip = SA.nodeModules.ip
const MODULE_NAME = 'FileStorage'
const MAX_RETRY = 10
const FAST_RETRY_TIME_IN_MILISECONDS = 500
@@ -97,7 +97,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
/* Here we actually reaad the file. */
if (host === undefined || host === 'localhost' || host === ip.address() || host === '127.0.0.1') {
/* We read the file from the local file system. */
const fs = require('fs')
const fs = SA.nodeModules.fs
fs.readFile(fileLocation, onFileRead)
} else {
/* We read the file via a web server over http */
@@ -169,7 +169,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
if (host === undefined || host === 'localhost' || host === ip.address() || host === '127.0.0.1') {
/* We read the file from the local file system. */
const fs = require('fs')
const fs = SA.nodeModules.fs
fs.readFile(fileLocation + '.Previous.json', onPreviousFileRead)
} else {
/* We read the file via a web server over http */
@@ -258,7 +258,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
Here we write the file with a temporary name so as to avoid dirty read from other processes.
Then we delete the original file, if exists, and finally we rename the temporary into the original name.
*/
const fs = require('fs')
const fs = SA.nodeModules.fs
if (noTemp === true) {
fs.writeFile(fileLocation, fileContent, onFileWriten)
} else {
@@ -408,7 +408,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
logger.write(MODULE_NAME, '[INFO] FileStorage -> deleteTextFile -> fileLocation: ' + fileLocation)
const fs = require('fs')
const fs = SA.nodeModules.fs
fs.unlink(fileLocation, onUnlinked)
function onUnlinked(err) {
@@ -455,7 +455,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
/* The filePath received is the one that is needed to fetch data from with fs. To do it via http we need to remove the prefix that includes this: ./Data-Storage/ */
filePath = filePath.substring(15, filePath.length)
let http = require('http');
let http = SA.nodeModules.http
let url = 'http://' + host +
':' + port +
'/Storage/' +
-18
View File
@@ -1,18 +0,0 @@
{
"name": "task-modules",
"version": "0.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ip": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
},
"ws": {
"version": "7.4.6",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A=="
}
}
}
@@ -1,13 +0,0 @@
{
"name": "task-modules",
"version": "0.0.6",
"description": "Tasks Server",
"main": "EventServerClient.js",
"author": {
"name": "Luis-Fernando-Molina"
},
"dependencies": {
"ip": "^1.1.5",
"ws": "^7.4.6"
}
}
@@ -1,13 +1,13 @@
{
"type": "Assets",
"name": "Education-Project-CL",
"config": "{\"codeName\":\"Education-Project-CL\"}",
"name": "Education-Project-PL",
"config": "{\"codeName\":\"Education-Project-PL\"}",
"project": "Governance",
"assetClasses": [
{
"type": "Asset Class",
"name": "Client",
"config": "{\n \"folderPath\": \"Education/CL\"\n}",
"config": "{\n \"folderPath\": \"Education/PL\"\n}",
"project": "Governance",
"assetClasses": [],
"assets": [],
@@ -1,13 +1,13 @@
{
"type": "Assets",
"name": "Ethereum-Project-CL",
"config": "{\"codeName\":\"Ethereum-Project-CL\"}",
"name": "Ethereum-Project-PL",
"config": "{\"codeName\":\"Ethereum-Project-PL\"}",
"project": "Governance",
"assetClasses": [
{
"type": "Asset Class",
"name": "Client",
"config": "{\n \"folderPath\": \"Ethereum/CL\"\n}",
"config": "{\n \"folderPath\": \"Ethereum/PL\"\n}",
"project": "Governance",
"assetClasses": [],
"assets": [],
@@ -1,13 +1,13 @@
{
"type": "Assets",
"name": "Foundations-Project-CL",
"config": "{\"codeName\":\"Foundations-Project-CL\"}",
"name": "Foundations-Project-PL",
"config": "{\"codeName\":\"Foundations-Project-PL\"}",
"project": "Governance",
"assetClasses": [
{
"type": "Asset Class",
"name": "Client",
"config": "{\n \"folderPath\": \"Foundations/CL\"\n}",
"config": "{\n \"folderPath\": \"Foundations/PL\"\n}",
"project": "Governance",
"assetClasses": [],
"assets": [],
@@ -1,7 +1,7 @@
{
"type": "Assets",
"name": "Superalgos-CL",
"config": "{\"codeName\":\"Superalgos-CL\"}",
"name": "Superalgos-PL",
"config": "{\"codeName\":\"Superalgos-PL\"}",
"project": "Governance",
"assetClasses": [
{
@@ -12,7 +12,7 @@
"assetClasses": [
{
"type": "Asset Class",
"name": "Superalgos-CL",
"name": "Superalgos-PL",
"config": "{\n \"description\": \"\", \"relativeWeight\": 0 \n}",
"project": "Governance",
"assetClasses": [],
@@ -40,12 +40,12 @@
},
"referenceParent": {
"type": "Assets",
"name": "Superalgos-CL",
"name": "Superalgos-PL",
"id": "4a693d1b-c9cc-4ab6-aa56-e1e1e1e18854"
},
"referenceParentCombinedNodePath": [
[
"Superalgos-CL",
"Superalgos-PL",
"Assets",
"Governance",
"4a693d1b-c9cc-4ab6-aa56-e1e1e1e18854"
@@ -7792,7 +7792,7 @@
},
"referenceParent": {
"type": "Asset Class",
"name": "Superalgos-CL",
"name": "Superalgos-PL",
"id": "5d13e350-4267-4d2f-a3fa-a1fabd5df10d"
},
"referenceParentCombinedNodePath": [
@@ -7809,7 +7809,7 @@
"d6e22645-35ee-443e-9349-01d2e8362d79"
],
[
"Superalgos-CL",
"Superalgos-PL",
"Asset Class",
"Governance",
"5d13e350-4267-4d2f-a3fa-a1fabd5df10d"
@@ -12725,7 +12725,9 @@
"referenceParentCombinedNodePath": [
[
"Raplh2502",
"User Profile"
"User Profile",
"Governance",
"c538f02f-9a2c-47e2-bf92-f6e97ede4031"
]
]
}
@@ -13211,12 +13213,12 @@
"id": "a8de78f0-c3e4-4a2a-b7e8-f659073969db",
"savedPayload": {
"position": {
"x": 10000,
"y": 21251
"x": 7692.307692307692,
"y": 21250
},
"targetPosition": {
"x": 10000,
"y": 21251
"x": 7692.307692307692,
"y": 21250
},
"floatingObject": {
"isPinned": false,
@@ -6305,7 +6305,7 @@
},
"referenceParent": {
"type": "Asset Class",
"name": "Superalgos-CL",
"name": "Superalgos-PL",
"id": "5d13e350-4267-4d2f-a3fa-a1fabd5df10d"
},
"referenceParentCombinedNodePath": [
@@ -6322,7 +6322,7 @@
"d6e22645-35ee-443e-9349-01d2e8362d79"
],
[
"Superalgos-CL",
"Superalgos-PL",
"Asset Class",
"Governance",
"5d13e350-4267-4d2f-a3fa-a1fabd5df10d"
@@ -10681,7 +10681,7 @@
},
"referenceParentCombinedNodePath": [
[
"Superalgos-CL",
"Superalgos-PL",
"Assets",
"Governance",
"4a693d1b-c9cc-4ab6-aa56-e1e1e1e18854"
@@ -1082,8 +1082,8 @@
},
{
"type": "Plugin File",
"name": "Education-Project-CL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Education-Project-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"name": "Education-Project-PL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Education-Project-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"project": "Foundations",
"id": "eefc0ae6-0364-4c0e-84ba-138ba30e6ce8",
"savedPayload": {
@@ -1082,8 +1082,8 @@
},
{
"type": "Plugin File",
"name": "Ethereum-Project-CL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Ethereum-Project-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"name": "Ethereum-Project-PL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Ethereum-Project-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"project": "Foundations",
"id": "6a48da6b-88ae-4ae0-8638-2473d66abe58",
"savedPayload": {
@@ -1082,8 +1082,8 @@
},
{
"type": "Plugin File",
"name": "Foundations-Project-CL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Foundations-Project-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"name": "Foundations-Project-PL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Foundations-Project-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"project": "Foundations",
"id": "81f1afb2-c08c-4f98-88d9-be0790002c09",
"savedPayload": {
@@ -1193,8 +1193,8 @@
"pluginFiles": [
{
"type": "Plugin File",
"name": "Superalgos-CL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Superalgos-CL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"name": "Superalgos-PL",
"config": "{\"project\":\"Governance\",\"fileName\":\"Superalgos-PL\",\"folderName\":\"Assets\",\"nodeType\":\"Assets\"}",
"project": "Foundations",
"id": "92ef88cd-4921-4a11-ab45-3ae57c6c903c",
"savedPayload": {
@@ -100,6 +100,7 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
result: 'Error',
message: 'Handshake Not Done Yet.'
}
response.messageId = messageHeader.messageId
caller.socket.send(JSON.stringify(response))
return
}
@@ -108,11 +109,13 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
switch (caller.role) {
case 'Network Client': {
response = await clientInterface.messageReceived(messageHeader.payload, caller.userProfile)
response.messageId = messageHeader.messageId
caller.socket.send(JSON.stringify(response))
break
}
case 'Network Peer': {
response = await peerInterface.messageReceived(messageHeader.payload)
response.messageId = messageHeader.messageId
caller.socket.send(JSON.stringify(response))
break
}
+19 -11
View File
@@ -8,9 +8,10 @@ exports.newNetworkModulesWebSocketsClient = function newNetworkModulesWebSockets
let socketClient
let web3
let web3
let called = {}
let selectedNetworkNode // This is a Network Node we pick to try to connect to.
let onMessageFunctionsMap = new Map()
return thisObject
@@ -22,6 +23,7 @@ exports.newNetworkModulesWebSocketsClient = function newNetworkModulesWebSockets
web3 = undefined
called = undefined
onMessageFunctionsMap = undefined
}
async function initialize() {
@@ -192,6 +194,7 @@ exports.newNetworkModulesWebSocketsClient = function newNetworkModulesWebSockets
Network Node and from now on, all response messages will be received
at this following function.
*/
socketClient.onmessage = socketMessage => { onMenssage(socketMessage) }
resolve()
}
}
@@ -222,29 +225,23 @@ exports.newNetworkModulesWebSocketsClient = function newNetworkModulesWebSockets
}
let socketMessage = {
messageId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
messageType: 'Request',
payload: message
}
socketClient.onmessage = socketMessage => { onMenssage(socketMessage) }
onMessageFunctionsMap.set(socketMessage.messageId, onMenssageFunction)
socketClient.send(
JSON.stringify(socketMessage)
)
function onMenssage(socketMessage) {
function onMenssageFunction(response) {
try {
let response = JSON.parse(socketMessage.data)
/*
Chack if we are waiting for the Handshake response.
*/
if (response.result === 'Ok') {
resolve(response.data)
} else {
console.log('[ERROR] Web Sockets Client -> onMenssage -> response.message = ' + response.message)
console.log('[ERROR] Web Sockets Client -> onMenssageFunction -> response.message = ' + response.message)
reject(response.message)
}
} catch (err) {
callbackFunction = undefined
console.log('[ERROR] Web Sockets Client -> err.stack = ' + err.stack)
@@ -252,4 +249,15 @@ exports.newNetworkModulesWebSocketsClient = function newNetworkModulesWebSockets
}
}
}
function onMenssage(socketMessage) {
let response = JSON.parse(socketMessage.data)
/*
We get the functioin that is going to resolve or reject the promise given.
*/
onMenssageFunction = onMessageFunctionsMap.get(response.messageId)
onMessageFunctionsMap.delete(response.messageId)
onMenssageFunction(response)
}
}
+4 -4
View File
@@ -866,7 +866,7 @@
}
]
},
"CL": {
"PL": {
"utilities": [
{
"name": "Async Functions",
@@ -983,7 +983,7 @@
]
},
"TS": {},
"CL": {}
"PL": {}
},
{
"name": "TensorFlow",
@@ -1091,7 +1091,7 @@
"processModules": [],
"botModules": []
},
"CL": {}
"PL": {}
},
{
"name": "Governance",
@@ -1283,7 +1283,7 @@
]
},
"TS": {},
"CL": {},
"PL": {},
"plugins": [
"User Profiles",
"Pools",
@@ -47,11 +47,16 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule
queryMessage.emitterUserProfileId = DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID
messageHeader.queryMessage = JSON.stringify(queryMessage)
console.log((new Date()).toISOString(), '- Web App Interface', '- Query Message Received', JSON.stringify(queryMessage))
let response = {
result: 'Ok',
message: 'Web App Interface Query Processed.',
data: await DK.running.webSocketsClient.sendMessage(JSON.stringify(messageHeader))
}
console.log((new Date()).toISOString(), '- Web App Interface', '- Query Respose Sent', JSON.stringify(response))
return response
}
case 'Event': {
@@ -131,7 +136,7 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule
const fileHash = hash.update(fileContent).digest('hex')
const fileName = fileHash + ".json"
let filePath = './My-Social-Trading-Data/User-Posts/' + SA.projects.foundations.utilities.filesAndDirectories.pathFromDate(timestamp)
let filePath = './My-Social-Trading-Data/User-Posts/' + SA.projects.foundations.utilities.filesAndDirectories.pathFromDate(timestamp)
SA.projects.foundations.utilities.filesAndDirectories.mkDirByPathSync(filePath + '/')
SA.nodeModules.fs.writeFileSync(filePath + '/' + fileName, fileContent)
@@ -57,6 +57,7 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
messageHeader = JSON.parse(message)
} catch (err) {
let response = {
messageId: messageHeader.messageId,
result: 'Error',
message: 'messageHeader Not Coorrect JSON Format.'
}
@@ -69,12 +70,14 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
.catch(onError)
function sendResponseToWebApp(response) {
response.messageId = messageHeader.messageId
webApp.socket.send(JSON.stringify(response))
}
function onError(errorMessage) {
console.log('[ERROR] Web Sockets Interface -> onMenssage -> errorMessage = ' + errorMessage)
let response = {
messageId: messageHeader.messageId,
result: 'Error',
message: errorMessage
}
@@ -207,11 +207,16 @@ exports.newSocialTradingModulesClientInterface = function newSocialTradingModule
let query = NT.projects.socialTrading.modules.query.newSocialTradingModulesQuery()
query.initialize(queryReceived)
console.log((new Date()).toISOString(), '- Client Interface', '- Query Message Received', queryMessage)
let response = {
result: 'Ok',
message: 'Client Interface Query Processed.',
data: query.execute()
}
console.log((new Date()).toISOString(), '- Client Interface', '- Query Respose Sent', JSON.stringify(response))
return response
} catch (err) {
@@ -9,6 +9,7 @@ function newSocialTradingModulesWebSocketsClient() {
let socketClient
let called = {}
let onMessageFunctionsMap = new Map()
return thisObject
@@ -18,6 +19,7 @@ function newSocialTradingModulesWebSocketsClient() {
clientInterface = undefined
called = undefined
onMessageFunctionsMap = undefined
}
async function initialize() {
@@ -38,6 +40,7 @@ function newSocialTradingModulesWebSocketsClient() {
socketClient.onerror = err => { onError(err) }
function onConnection() {
socketClient.onmessage = socketMessage => { onMenssage(socketMessage) }
resolve()
}
@@ -65,22 +68,17 @@ function newSocialTradingModulesWebSocketsClient() {
}
let socketMessage = {
messageId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
messageType: 'Request',
payload: message
}
socketClient.onmessage = socketMessage => { onMenssage(socketMessage) }
onMessageFunctionsMap.set(socketMessage.messageId, onMenssageFunction)
socketClient.send(
JSON.stringify(socketMessage)
)
)
function onMenssage(socketMessage) {
function onMenssageFunction(response) {
try {
let response = JSON.parse(socketMessage.data)
/*
Chack if we are waiting for the Handshake response.
*/
if (response.result === 'Ok') {
resolve(response.data)
} else {
@@ -95,4 +93,15 @@ function newSocialTradingModulesWebSocketsClient() {
}
}
}
function onMenssage(socketMessage) {
let response = JSON.parse(socketMessage.data)
/*
We get the functioin that is going to resolve or reject the promise given.
*/
onMenssageFunction = onMessageFunctionsMap.get(response.messageId)
onMessageFunctionsMap.delete(response.messageId)
onMenssageFunction(response)
}
}
+2 -2
View File
@@ -101,7 +101,7 @@ Before you begin, it is recommended that you set up Chrome/Safari as your defaul
**IMPORTANT:** Use Chrome/Safari so that you have a similar environment as the dev team in case you need help. We are not testing on any other browsers, and it is a well-known fact that browsers behave differently.
# Superalgos Client Installation
# Superalgos Platform Client Installation
## 1. Fork the Superalgos Repository
@@ -283,7 +283,7 @@ If you're running Superalgos on a headless linux server like a Raspberry Pi, you
Create a `superalgos.service` file looking like this (change `<user>` to your user name and `/path/to/Superalgos` to your Superalgos folder, for instance `/home/John/Superalgos`):
```
[Unit]
Description=Superalgos client
Description=Superalgos Platform Client
[Service]
Type=simple
-207
View File
@@ -1,207 +0,0 @@
/* Load Environment Variables */
let ENVIRONMENT = require('../Environment.js');
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
global.env = ENVIRONMENT_MODULE
/* Setting up the handling of Node JS process events */
let NODE_JS_PROCESS = require('./NodeJsProcess.js');
let NODE_JS_PROCESS_MODULE = NODE_JS_PROCESS.newNodeJsProcess()
NODE_JS_PROCESS_MODULE.initialize()
/*
The TS object is accesible everywhere at the Superalgos Client.
It provides access to all modules built for the Task Server.
*/
global.TS = {}
/*
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(TS, 'TS')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/* Setting up the global Event Handler */
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT = TS.projects.foundations.taskModules.eventServerClient.newFoundationsTaskModulesEventServerClient()
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.initialize(preLoader)
function preLoader() {
/*
We read the first string sent as an argument when the process was created by the Task Manager.
There we will find the information of the identity
of this Task and know exactly what to run within this server instance.
*/
let taskId = process.argv[2] // reading what comes as an argument of the nodejs process.
if (taskId !== undefined) {
/*
The Task Manager sent the info via a process argument. In this case we listen to
an event with the Task Info that should be emitted at the UI
*/
try {
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.listenToEvent('Task Server - ' + taskId, 'Run Task', undefined, 'Task Server - ' + taskId, undefined, eventReceived)
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent('Task Manager - ' + taskId, 'Nodejs Process Ready for Task')
function eventReceived(message) {
try {
setUpAppSchema(JSON.parse(message.event.projectSchemas))
TS.projects.foundations.globals.taskConstants.TASK_NODE = JSON.parse(message.event.taskDefinition)
TS.projects.foundations.globals.taskConstants.NETWORK_NODE = JSON.parse(message.event.networkDefinition)
bootingProcess()
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> eventReceived -> ' + err.stack)
}
}
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE -> ' + err.stack)
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE = ' + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE).substring(0, 1000))
}
}
else {
/*
This process was started not by the Task Manager, but independently
(most likely for debugging purposes). In this case we listen to an event
with the Task Info that should be emitted at the UI, bypassing the Task Manager.
But before that, we need to change the path of these env variables since the home
directory now is TaskServer and not its parent.
*/
global.env.PATH_TO_DATA_STORAGE = '.' + global.env.PATH_TO_DATA_STORAGE
global.env.PATH_TO_PROJECTS = '.' + global.env.PATH_TO_PROJECTS
global.env.PATH_TO_LOG_FILES = '.' + global.env.PATH_TO_LOG_FILES
try {
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.listenToEvent('Task Server', 'Debug Task Started', undefined, 'Task Server', undefined, startDebugging)
function startDebugging(message) {
try {
setUpAppSchema(JSON.parse(message.event.projectSchemas))
TS.projects.foundations.globals.taskConstants.TASK_NODE = JSON.parse(message.event.taskDefinition)
TS.projects.foundations.globals.taskConstants.NETWORK_NODE = JSON.parse(message.event.networkDefinition)
bootingProcess()
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> startDebugging -> ' + err.stack)
}
}
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE -> ' + err.stack)
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE = ' + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE).substring(0, 1000))
}
}
function setUpAppSchema(projectSchemas) {
/* Setup the APP_SCHEMA_MAP based on the APP_SCHEMA_ARRAY */
for (let i = 0; i < projectSchemas.length; i++) {
let project = projectSchemas[i]
for (let j = 0; j < project.schema.length; j++) {
let schemaDocument = project.schema[j]
let key = project.name + '-' + schemaDocument.type
TS.projects.foundations.globals.taskConstants.APP_SCHEMA_MAP.set(key, schemaDocument)
}
}
}
}
function bootingProcess() {
try {
initializeProjectDefinitionNode()
setupTaskHeartbeats()
function initializeProjectDefinitionNode() {
TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE = TS.projects.foundations.utilities.nodeFunctions.findNodeInNodeMesh(TS.projects.foundations.globals.taskConstants.TASK_NODE, 'Project Definition')
if (TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Project Definition not found. ")
TS.projects.foundations.globals.taskVariables.FATAL_ERROR_MESSAGE = 'Project Definition not found. Fatal Error, can not continue. Fix the problem and try again.'
TS.projects.foundations.functionLibraries.nodeJSFunctions.exitProcess
throw ('Fatal Error')
}
if (TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Project Definition with codeName undefined. ")
TS.projects.foundations.globals.taskVariables.FATAL_ERROR_MESSAGE = 'Project Definition with codeName undefined. Fatal Error, can not continue. Fix the problem and try again.'
TS.projects.foundations.functionLibraries.nodeJSFunctions.exitProcess
throw ('Fatal Error')
}
if (TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName === '') {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Project Definition without codeName. ")
TS.projects.foundations.globals.taskVariables.FATAL_ERROR_MESSAGE = 'Project Definition without codeName. Fatal Error, can not continue. Fix the problem and try again.'
TS.projects.foundations.functionLibraries.nodeJSFunctions.exitProcess
throw ('Fatal Error')
}
}
function setupTaskHeartbeats() {
/*
Heartbeat sent to the UI
*/
let key = TS.projects.foundations.globals.taskConstants.TASK_NODE.name + '-' + TS.projects.foundations.globals.taskConstants.TASK_NODE.type + '-' + TS.projects.foundations.globals.taskConstants.TASK_NODE.id
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.createEventHandler(key)
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(key, 'Running') // Meaning Task Running
TS.projects.foundations.globals.taskConstants.TASK_HEARTBEAT_INTERVAL_HANDLER = setInterval(taskHearBeat, 1000)
function taskHearBeat() {
/* The heartbeat event is raised at the event handler of the instance of this task, created at the TS. */
let event = {
seconds: (new Date()).getSeconds()
}
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(key, 'Heartbeat', event)
}
}
for (let processIndex = 0; processIndex < TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes.length; processIndex++) {
/*
Here we will validate that the process is connected all the way to a Mine
and that nodes in the middle have whatever config is mandatory.
*/
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Process Instance without a Reference Parent. This process will not be executed. -> Process Instance = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex]));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Process Definition without parent Bot Definition. -> Process Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Bot Definition without parent Mine. -> Bot Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Process Definition without a codeName defined. -> Process Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Bot Definition without a codeName defined. -> Bot Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Mine without a codeName defined. -> Mine Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode));
continue
}
startProcessInstance(processIndex);
}
} catch (err) {
console.log('[ERROR] Task Server -> Task -> bootingProcess -> Fatal Error. Can not run this task. -> ' + err.stack)
}
}
function startProcessInstance(processIndex) {
const ROOT_MODULE = require('./ProcessInstance')
let root = ROOT_MODULE.newProcessInstance()
root.start(processIndex)
}
+192
View File
@@ -0,0 +1,192 @@
exports.newTaskServer = function newTaskServer() {
let thisObject = {
run: run
}
return thisObject
async function run() {
/* Setting up the handling of Node JS process events */
let NODE_JS_PROCESS = require('./NodeJsProcess.js');
let NODE_JS_PROCESS_MODULE = NODE_JS_PROCESS.newNodeJsProcess()
NODE_JS_PROCESS_MODULE.initialize()
/* Setting up the global Event Handler */
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT = TS.projects.foundations.taskModules.eventServerClient.newFoundationsTaskModulesEventServerClient()
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.initialize(preLoader)
function preLoader() {
/*
We read the first string sent as an argument when the process was created by the Task Manager.
There we will find the information of the identity
of this Task and know exactly what to run within this server instance.
*/
let taskId = process.argv[2] // reading what comes as an argument of the nodejs process.
if (taskId !== undefined) {
/*
The Task Manager sent the info via a process argument. In this case we listen to
an event with the Task Info that should be emitted at the UI
*/
try {
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.listenToEvent('Task Server - ' + taskId, 'Run Task', undefined, 'Task Server - ' + taskId, undefined, eventReceived)
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent('Task Manager - ' + taskId, 'Nodejs Process Ready for Task')
function eventReceived(message) {
try {
setUpAppSchema(JSON.parse(message.event.projectSchemas))
TS.projects.foundations.globals.taskConstants.TASK_NODE = JSON.parse(message.event.taskDefinition)
TS.projects.foundations.globals.taskConstants.NETWORK_NODE = JSON.parse(message.event.networkDefinition)
bootingProcess()
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> eventReceived -> ' + err.stack)
}
}
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE -> ' + err.stack)
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE = ' + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE).substring(0, 1000))
}
}
else {
/*
This process was started not by the Task Manager, but independently
(most likely for debugging purposes). In this case we listen to an event
with the Task Info that should be emitted at the UI, bypassing the Task Manager.
But before that, we need to change the path of these env variables since the home
directory now is TaskServer and not its parent.
*/
global.env.PATH_TO_DATA_STORAGE = '.' + global.env.PATH_TO_DATA_STORAGE
global.env.PATH_TO_PROJECTS = '.' + global.env.PATH_TO_PROJECTS
global.env.PATH_TO_LOG_FILES = '.' + global.env.PATH_TO_LOG_FILES
try {
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.listenToEvent('Task Server', 'Debug Task Started', undefined, 'Task Server', undefined, startDebugging)
function startDebugging(message) {
try {
setUpAppSchema(JSON.parse(message.event.projectSchemas))
TS.projects.foundations.globals.taskConstants.TASK_NODE = JSON.parse(message.event.taskDefinition)
TS.projects.foundations.globals.taskConstants.NETWORK_NODE = JSON.parse(message.event.networkDefinition)
bootingProcess()
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> startDebugging -> ' + err.stack)
}
}
} catch (err) {
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE -> ' + err.stack)
console.log('[ERROR] Task Server -> Task -> preLoader -> TS.projects.foundations.globals.taskConstants.TASK_NODE = ' + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE).substring(0, 1000))
}
}
function setUpAppSchema(projectSchemas) {
/* Setup the APP_SCHEMA_MAP based on the APP_SCHEMA_ARRAY */
for (let i = 0; i < projectSchemas.length; i++) {
let project = projectSchemas[i]
for (let j = 0; j < project.schema.length; j++) {
let schemaDocument = project.schema[j]
let key = project.name + '-' + schemaDocument.type
TS.projects.foundations.globals.taskConstants.APP_SCHEMA_MAP.set(key, schemaDocument)
}
}
}
}
function bootingProcess() {
try {
initializeProjectDefinitionNode()
setupTaskHeartbeats()
function initializeProjectDefinitionNode() {
TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE = TS.projects.foundations.utilities.nodeFunctions.findNodeInNodeMesh(TS.projects.foundations.globals.taskConstants.TASK_NODE, 'Project Definition')
if (TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Project Definition not found. ")
TS.projects.foundations.globals.taskVariables.FATAL_ERROR_MESSAGE = 'Project Definition not found. Fatal Error, can not continue. Fix the problem and try again.'
TS.projects.foundations.functionLibraries.nodeJSFunctions.exitProcess
throw ('Fatal Error')
}
if (TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Project Definition with codeName undefined. ")
TS.projects.foundations.globals.taskVariables.FATAL_ERROR_MESSAGE = 'Project Definition with codeName undefined. Fatal Error, can not continue. Fix the problem and try again.'
TS.projects.foundations.functionLibraries.nodeJSFunctions.exitProcess
throw ('Fatal Error')
}
if (TS.projects.foundations.globals.taskConstants.PROJECT_DEFINITION_NODE.config.codeName === '') {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Project Definition without codeName. ")
TS.projects.foundations.globals.taskVariables.FATAL_ERROR_MESSAGE = 'Project Definition without codeName. Fatal Error, can not continue. Fix the problem and try again.'
TS.projects.foundations.functionLibraries.nodeJSFunctions.exitProcess
throw ('Fatal Error')
}
}
function setupTaskHeartbeats() {
/*
Heartbeat sent to the UI
*/
let key = TS.projects.foundations.globals.taskConstants.TASK_NODE.name + '-' + TS.projects.foundations.globals.taskConstants.TASK_NODE.type + '-' + TS.projects.foundations.globals.taskConstants.TASK_NODE.id
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.createEventHandler(key)
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(key, 'Running') // Meaning Task Running
TS.projects.foundations.globals.taskConstants.TASK_HEARTBEAT_INTERVAL_HANDLER = setInterval(taskHearBeat, 1000)
function taskHearBeat() {
/* The heartbeat event is raised at the event handler of the instance of this task, created at the TS. */
let event = {
seconds: (new Date()).getSeconds()
}
TS.projects.foundations.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(key, 'Heartbeat', event)
}
}
for (let processIndex = 0; processIndex < TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes.length; processIndex++) {
/*
Here we will validate that the process is connected all the way to a Mine
and that nodes in the middle have whatever config is mandatory.
*/
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Process Instance without a Reference Parent. This process will not be executed. -> Process Instance = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex]));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Process Definition without parent Bot Definition. -> Process Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Bot Definition without parent Mine. -> Bot Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Process Definition without a codeName defined. -> Process Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Bot Definition without a codeName defined. -> Bot Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode));
continue
}
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName === undefined) {
console.log("[ERROR] Task Server -> Task -> bootingProcess -> Mine without a codeName defined. -> Mine Definition = " + JSON.stringify(TS.projects.foundations.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode));
continue
}
startProcessInstance(processIndex);
}
} catch (err) {
console.log('[ERROR] Task Server -> Task -> bootingProcess -> Fatal Error. Can not run this task. -> ' + err.stack)
}
}
function startProcessInstance(processIndex) {
const ROOT_MODULE = require('./ProcessInstance')
let root = ROOT_MODULE.newProcessInstance()
root.start(processIndex)
}
}
}
+59
View File
@@ -0,0 +1,59 @@
/*
This module represents the execution root of the Task Server.
We use this module that is outside the Task Server folder to
load all node dependencies and get them ready to the actual App.
*/
/*
The TS object is accesible everywhere at the Superalgos Platform Client.
It provides access to all modules built for the Task Server.
*/
global.TS = {}
/*
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(TS, 'TS')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
util: require('util'),
path: require('path'),
ws: require('ws'),
ip: require('ip'),
telegraf: require('telegraf'),
telegram: require('telegram'),
https: require('https'),
http: require('http'),
web3: require('web3'),
nodeFetch: require('node-fetch'),
ccxt: require('ccxt'),
ccxtMisc: require('./node_modules/ccxt/js/base/functions/misc'),
lookpath: require('lookpath')
}
run()
async function run() {
TS.app = require('./TaskServer/TaskServer.js').newTaskServer()
await TS.app.run()
console.log('Superalgos TaskSerer is Running!')
}
+4 -59
View File
@@ -7,65 +7,10 @@ The Superalgos Desktop is one of the 3 clients of the Superalgos Network:
Users can unse any of these clients for their social trading activities.
This module is the starting point of the Superalgos Desktop App.
This module represents the Nodejs command that users have to start the Desktop App..
*/
/*
The DK object is accesible everywhere at the Superalgos Desktop App.
It provides access to all modules built for this App.
*/
global.DK = {}
/*
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('./EnvironmentForDebug.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(DK, 'DK')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
web3: require('web3'),
ws: require('ws'),
open: require('open'),
http: require('http'),
octokit: require("@octokit/rest"),
simpleGit: require('simple-git')
}
/*
We will use this User Profile for Testing Purposes.
{
"githubUsername": "Test-Network-Client-Profile",
"address": "0xA0dCDA81b42C5EBDc45EC2875C72274B67560246",
"privateKey": "0x5fed4817a87431c8a328d0936561e63f45b6db289adac6125b9306ded644dfe9"
}
*/
DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID = "baa2f02c-2920-4edb-a103-d452fc61d82f"
DK.TEST_NETWORK_CLIENT_USER_PROFILE_HANDLE = "Test-Network-Client-Profile"
DK.TEST_NETWORK_CLIENT_USER_PROFILE_PRIVATE_KEY = "0x5fed4817a87431c8a328d0936561e63f45b6db289adac6125b9306ded644dfe9"
run()
async function run() {
DK.app = require('./Desktop/DesktopApp.js').newDesktopApp()
await DK.app.run()
console.log('Superalgos Desktop App is Running!')
}
let APP_ROOT = require('./DesktopRoot.js')
let APP_ROOT_MODULE = APP_ROOT.newDesktopRoot()
APP_ROOT_MODULE.run()
+4 -51
View File
@@ -7,57 +7,10 @@ The Superalgos Network offers 3 types of services:
Users can decide which services to run at their node.(TODO)
This module is the starting point of the Network Node.
This module represents the Nodejs command that users have to start the Network Node..
*/
/*
The NT object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for this Network.
*/
global.NT = {}
/*
The SA object is accesible everywhere at the Superalgos Network.
It provides access to all modules built for Superalgos in general.
*/
global.SA = {}
/* Load Environment Variables */
let ENVIRONMENT = require('./EnvironmentForDebug.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(NT, 'NT')
MULTI_PROJECT_MODULE.initialize(SA, 'SA')
/*
Setting up external dependencies.
*/
SA.nodeModules = {
fs: require('fs'),
nodeFetch: require('node-fetch'),
web3: require('web3'),
ws: require('ws')
}
/*
We will use this User Profile for testing purposes.
{
"githubUsername": "Test-Network-Node-Profile",
"address": "0xa153469c57A91F5a59Fc6c45A37aD8dbad85e417",
"privateKey": "0xac498ae59407e6b68429a814f64da2339550f93a767578e28c161ff119159271"
}
*/
NT.NETWORK_NODE_USER_PROFILE_HANDLE = "Test-Network-Node-Profile"
NT.NETWORK_NODE_USER_PROFILE_PRIVATE_KEY = "0xac498ae59407e6b68429a814f64da2339550f93a767578e28c161ff119159271"
NT.app = require('./Network/NetwokNode.js').newNetworkNode()
NT.app.run()
console.log('Superalgos Network is Running.')
let APP_ROOT = require('./NetworkRoot.js')
let APP_ROOT_MODULE = APP_ROOT.newNetworkRoot()
APP_ROOT_MODULE.run()
+636 -19
View File
@@ -1,7 +1,14 @@
{
"requires": true,
"name": "superalgos",
"version": "0.0.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@cryptography/aes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@cryptography/aes/-/aes-0.1.1.tgz",
"integrity": "sha512-PcYz4FDGblO6tM2kSC+VzhhK62vml6k6/YAkiWtyPvrgJVfnDRoHGDtKn5UiaRRUrvUTTocBpvc2rRgTCqxjsg=="
},
"@ethereumjs/common": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.4.0.tgz",
@@ -82,6 +89,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 +124,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 +174,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 +242,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 +259,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 +310,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 +333,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 +371,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 +415,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",
@@ -401,6 +608,14 @@
"@types/node": "*"
}
},
"abort-controller": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
"requires": {
"event-target-shim": "^5.0.0"
}
},
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
@@ -410,6 +625,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",
@@ -455,15 +675,23 @@
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
},
"async-mutex": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.3.2.tgz",
"integrity": "sha512-HuTK7E7MT7jZEh1P9GtRW9+aTWiDWWi9InbZ5hjxrnRa39KS4BW04+xLBhYNS2aXhHUIKZSw3gj4Pn1pj+qGAA==",
"requires": {
"tslib": "^2.3.1"
}
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"available-typed-arrays": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz",
"integrity": "sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA=="
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
"integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw=="
},
"aws-sign2": {
"version": "0.7.0",
@@ -496,11 +724,21 @@
"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",
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
},
"big-integer": {
"version": "1.6.48",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
"integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w=="
},
"bignumber.js": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
@@ -543,6 +781,11 @@
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8="
},
"browser-or-node": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/browser-or-node/-/browser-or-node-1.3.0.tgz",
"integrity": "sha512-0F2z/VSnLbmEeBcUrSuDH5l0HxTXdQQzLjkmBR4cYfvg1zJrKSlmIZFqyFR8oX0NrwPhy3c3HQ6i3OxMbew4Tg=="
},
"browserify-aes": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
@@ -648,6 +891,25 @@
"ieee754": "^1.1.13"
}
},
"buffer-alloc": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
"integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
"requires": {
"buffer-alloc-unsafe": "^1.1.0",
"buffer-fill": "^1.0.0"
}
},
"buffer-alloc-unsafe": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
"integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg=="
},
"buffer-fill": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
"integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw="
},
"buffer-to-arraybuffer": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/buffer-to-arraybuffer/-/buffer-to-arraybuffer-0.0.5.tgz",
@@ -714,6 +976,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",
@@ -980,11 +1252,44 @@
"randombytes": "^2.0.0"
}
},
"dom-serializer": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz",
"integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==",
"requires": {
"domelementtype": "^2.0.1",
"domhandler": "^4.2.0",
"entities": "^2.0.0"
}
},
"dom-walk": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
"integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w=="
},
"domelementtype": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A=="
},
"domhandler": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.2.tgz",
"integrity": "sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w==",
"requires": {
"domelementtype": "^2.2.0"
}
},
"domutils": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
"requires": {
"dom-serializer": "^1.0.1",
"domelementtype": "^2.2.0",
"domhandler": "^4.2.0"
}
},
"duplexer3": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
@@ -1031,22 +1336,28 @@
"once": "^1.4.0"
}
},
"entities": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz",
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="
},
"es-abstract": {
"version": "1.18.5",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.5.tgz",
"integrity": "sha512-DDggyJLoS91CkJjgauM5c0yZMjiD1uK3KcaCeAmffGwZ+ODWzOkPN4QwRbsK5DOFf06fywmyLci3ZD8jLGhVYA==",
"version": "1.18.6",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz",
"integrity": "sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==",
"requires": {
"call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"get-intrinsic": "^1.1.1",
"get-symbol-description": "^1.0.0",
"has": "^1.0.3",
"has-symbols": "^1.0.2",
"internal-slot": "^1.0.3",
"is-callable": "^1.2.3",
"is-callable": "^1.2.4",
"is-negative-zero": "^2.0.1",
"is-regex": "^1.1.3",
"is-string": "^1.0.6",
"is-regex": "^1.1.4",
"is-string": "^1.0.7",
"object-inspect": "^1.11.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
@@ -1175,6 +1486,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 +1544,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",
@@ -1228,6 +1624,11 @@
"strip-hex-prefix": "1.0.0"
}
},
"event-target-shim": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
},
"eventemitter3": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz",
@@ -1404,6 +1805,15 @@
"pump": "^3.0.0"
}
},
"get-symbol-description": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
"integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
"requires": {
"call-bind": "^1.0.2",
"get-intrinsic": "^1.1.1"
}
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
@@ -1533,6 +1943,17 @@
"minimalistic-crypto-utils": "^1.0.1"
}
},
"htmlparser2": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
"integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==",
"requires": {
"domelementtype": "^2.0.1",
"domhandler": "^4.0.0",
"domutils": "^2.5.2",
"entities": "^2.0.0"
}
},
"http": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz",
@@ -1577,6 +1998,11 @@
"sshpk": "^1.7.0"
}
},
"https": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/https/-/https-1.0.0.tgz",
"integrity": "sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q="
},
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -1605,6 +2031,11 @@
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
},
"imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
@@ -1620,6 +2051,11 @@
"side-channel": "^1.0.4"
}
},
"ip": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
@@ -1751,11 +2187,11 @@
}
},
"is-typed-array": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.7.tgz",
"integrity": "sha512-VxlpTBGknhQ3o7YiVjIhdLU6+oD8dPz/79vvvH4F+S/c8608UCVa9fgDpa1kZgFoUST2DCgacc70UszKgzKuvA==",
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz",
"integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==",
"requires": {
"available-typed-arrays": "^1.0.4",
"available-typed-arrays": "^1.0.5",
"call-bind": "^1.0.2",
"es-abstract": "^1.18.5",
"foreach": "^2.0.5",
@@ -1856,6 +2292,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",
@@ -1976,6 +2417,11 @@
"resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz",
"integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw=="
},
"module-alias": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.2.tgz",
"integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q=="
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -2049,6 +2495,14 @@
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz",
"integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg=="
},
"node-localstorage": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-2.2.1.tgz",
"integrity": "sha512-vv8fJuOUCCvSPjDjBLlMqYMHob4aGjkmrkaE42/mZr0VT+ZAU10jRF8oTnX9+pgU9/vYJ8P7YT3Vd6ajkmzSCw==",
"requires": {
"write-file-atomic": "^1.1.4"
}
},
"normalize-url": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz",
@@ -2135,6 +2589,11 @@
"is-wsl": "^2.2.0"
}
},
"os-browserify": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
"integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc="
},
"p-cancelable": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz",
@@ -2153,6 +2612,11 @@
"p-finally": "^1.0.0"
}
},
"pako": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz",
"integrity": "sha512-v8tweI900AUkZN6heMU/4Uy4cXRc2AYNRggVmTR+dEncawDJgCdLMximOVA2p4qO57WMynangsfGRb5WD6L1Bg=="
},
"parse-asn1": {
"version": "5.1.6",
"resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
@@ -2175,6 +2639,35 @@
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
},
"path": {
"version": "0.12.7",
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
"integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=",
"requires": {
"process": "^0.11.1",
"util": "^0.10.3"
},
"dependencies": {
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"util": {
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
"requires": {
"inherits": "2.0.3"
}
}
}
},
"path-browserify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
"integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
@@ -2375,11 +2868,24 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safe-compare": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/safe-compare/-/safe-compare-1.1.4.tgz",
"integrity": "sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ==",
"requires": {
"buffer-alloc": "^1.2.0"
}
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"sandwich-stream": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-2.0.2.tgz",
"integrity": "sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ=="
},
"scrypt-js": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz",
@@ -2514,6 +3020,11 @@
}
}
},
"slide": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz",
"integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc="
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@@ -2535,6 +3046,11 @@
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"store2": {
"version": "2.12.0",
"resolved": "https://registry.npmjs.org/store2/-/store2-2.12.0.tgz",
"integrity": "sha512-7t+/wpKLanLzSnQPX8WAcuLCCeuSHoWdQuh9SB3xD0kNOM38DNf+0Oa+wmvxmYueRzkmh6IcdKFtvTa+ecgPDw=="
},
"strict-uri-encode": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
@@ -2674,6 +3190,77 @@
}
}
},
"telegraf": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/telegraf/-/telegraf-4.4.2.tgz",
"integrity": "sha512-OGt9w1LbxYUOsRk3htAavBnL9hqWycmJNiOmS74oARzxKFnYS/MdwW8b5CX9VLCJt537AXkm8/eBNiEYD8E7lQ==",
"requires": {
"abort-controller": "^3.0.0",
"debug": "^4.3.1",
"minimist": "^1.2.5",
"module-alias": "^2.2.2",
"node-fetch": "^2.6.1",
"p-timeout": "^4.1.0",
"safe-compare": "^1.1.4",
"sandwich-stream": "^2.0.2",
"typegram": "^3.4.2"
},
"dependencies": {
"debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"requires": {
"ms": "2.1.2"
}
},
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"p-timeout": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz",
"integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw=="
}
}
},
"telegram": {
"version": "1.8.14",
"resolved": "https://registry.npmjs.org/telegram/-/telegram-1.8.14.tgz",
"integrity": "sha512-gOj6/Ebr0QMv3zufP3n3t2AwO+iJcBd4B+YbWBu9gHRm1OQkuUW+3cpDfLMBnFFGH2/dJGdB9n+uo4qrCRkxgQ==",
"requires": {
"@cryptography/aes": "^0.1.1",
"async-mutex": "^0.3.0",
"big-integer": "^1.6.48",
"browser-or-node": "^1.3.0",
"buffer": "^6.0.3",
"htmlparser2": "^6.1.0",
"mime-types": "^2.1.30",
"node-localstorage": "^2.1.6",
"os-browserify": "^0.3.0",
"pako": "^2.0.3",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"store2": "^2.12.0",
"ts-custom-error": "^3.2.0",
"ts-mixer": "^5.4.0",
"util": "^0.12.4",
"websocket": "^1.0.33"
},
"dependencies": {
"buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"requires": {
"base64-js": "^1.3.1",
"ieee754": "^1.2.1"
}
}
}
},
"timed-out": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
@@ -2698,6 +3285,21 @@
"punycode": "^2.1.1"
}
},
"ts-custom-error": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ts-custom-error/-/ts-custom-error-3.2.0.tgz",
"integrity": "sha512-cBvC2QjtvJ9JfWLvstVnI45Y46Y5dMxIaG1TDMGAD/R87hpvqFL+7LhvUDhnRCfOnx/xitollFWWvUKKKhbN0A=="
},
"ts-mixer": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-5.4.1.tgz",
"integrity": "sha512-Zo9HgPCtNouDgJ+LGtrzVOjSg8+7WGQktIKLwAfaNrlOK1mWGlz1ejsAF/YqUEqAGjUTeB5fEg8gH9Aui6w9xA=="
},
"tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@@ -2733,6 +3335,11 @@
"is-typedarray": "^1.0.0"
}
},
"typegram": {
"version": "3.4.3",
"resolved": "https://registry.npmjs.org/typegram/-/typegram-3.4.3.tgz",
"integrity": "sha512-pH0TQJzCWM2+7y6yiBoQVNt7PO9ZvAu/lQukVx4sm68FIBBZEBWI+2MzuMcdbwrD5mD5NrEMAyml9N6DupUZag=="
},
"ultron": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
@@ -3156,16 +3763,16 @@
}
},
"which-typed-array": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.6.tgz",
"integrity": "sha512-DdY984dGD5sQ7Tf+x1CkXzdg85b9uEel6nr4UkFg1LoE9OXv3uRuZhe5CoWdawhGACeFpEZXH8fFLQnDhbpm/Q==",
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz",
"integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==",
"requires": {
"available-typed-arrays": "^1.0.4",
"available-typed-arrays": "^1.0.5",
"call-bind": "^1.0.2",
"es-abstract": "^1.18.5",
"foreach": "^2.0.5",
"has-tostringtag": "^1.0.0",
"is-typed-array": "^1.1.6"
"is-typed-array": "^1.1.7"
}
},
"wrappy": {
@@ -3173,6 +3780,16 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"write-file-atomic": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz",
"integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=",
"requires": {
"graceful-fs": "^4.1.11",
"imurmurhash": "^0.1.4",
"slide": "^1.1.5"
}
},
"ws": {
"version": "8.2.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.1.tgz",
+18
View File
@@ -1,10 +1,28 @@
{
"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",
"https": "^1.0.0",
"ip": "^1.1.5",
"lookpath": "^1.2.2",
"node-fetch": "^2.6.1",
"open": "^8.2.1",
"path": "^0.12.7",
"simple-git": "^2.45.1",
"telegraf": "^4.4.2",
"telegram": "^1.8.14",
"util": "^0.12.4",
"web3": "^1.5.2",
"ws": "^8.2.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('')
}