fix merge conflicts

This commit is contained in:
ssplatt committed 2021-09-29 13:32:41 -04:00
commit 6aae1d54bc
279 files changed
+209233 -58422

No files matched your search

-1
View File
@@ -5,7 +5,6 @@ debug.log
*.db
.git*
.vscode
README.md
LICENSE
+2
View File
@@ -2,6 +2,8 @@ Data-Storage
Log-Files
My-Workspaces
My-Social-Trading-Data
My-Network-Nodes-Data
My-Secrets
debug.log
.DS_Store
*.db
+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
}
}
+4 -4
View File
@@ -45,7 +45,7 @@ exports.newDesktopApp = function newDesktopApp() {
*/
queryMessage = {
queryType: SA.projects.socialTrading.globals.queryTypes.USER_PROFILES,
emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID,
emitterUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId,
initialIndex: 'Last',
amountRequested: 10,
direction: 'Past'
@@ -74,7 +74,7 @@ exports.newDesktopApp = function newDesktopApp() {
let eventMessage = {
eventId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
eventType: SA.projects.socialTrading.globals.eventTypes.FOLLOW_USER_PROFILE,
emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID,
emitterUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId,
targetUserProfileId: profile.userProfileId
}
@@ -99,8 +99,8 @@ exports.newDesktopApp = function newDesktopApp() {
*/
queryMessage = {
queryType: SA.projects.socialTrading.globals.queryTypes.USER_PROFILE_STATS,
emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID,
targetUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID
emitterUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId,
targetUserProfileId: SA.secrets.map.get('Social Trading Desktop').userProfileId
}
query = {
+41 -11
View File
@@ -121,17 +121,47 @@ function newWebApp() {
}
function addToContentDiv(events) {
try {
let contentDiv = document.getElementById('content-div')
let contentDiv = document.getElementById('content-div')
/*
Delete al current content.
*/
while (contentDiv.childNodes.length > 4) {
let childToRemove = contentDiv.childNodes[contentDiv.childNodes.length - 1]
contentDiv.removeChild(childToRemove)
}
/*
Render the timeline.
*/
for (let i = 0; i < events.length; i++) {
let event = events[i]
for (let i = 0; i < events.length; i++) {
let event = events[i]
let postDiv = document.createElement("div")
postDiv.setAttribute("class", "post-div")
let textNode
let postDiv = document.createElement("div")
postDiv.setAttribute("class", "post-div")
let textNode = document.createTextNode('POST #' + i)
postDiv.appendChild(textNode)
contentDiv.appendChild(postDiv)
switch (event.eventType) {
case SA.projects.socialTrading.globals.eventTypes.NEW_USER_POST: {
textNode = document.createTextNode(event.emitterUserProfile.userProfileHandle + " POSTED " + event.postText)
break
}
case SA.projects.socialTrading.globals.eventTypes.FOLLOW_USER_PROFILE: {
textNode = document.createTextNode(event.emitterUserProfile.userProfileHandle + " FOLLOWED " + event.targetUserProfile.userProfileHandle)
break
}
case SA.projects.socialTrading.globals.eventTypes.UNFOLLOW_USER_PROFILE: {
textNode = document.createTextNode(event.emitterUserProfile.userProfileHandle + " UNFOLLOWED " + event.targetUserProfile.userProfileHandle)
break
}
}
postDiv.appendChild(textNode)
contentDiv.appendChild(postDiv)
}
}
catch (err) {
console.log('[ERROR] err.stack = ' + err.stack)
}
}
}
@@ -319,7 +349,7 @@ function newWebApp() {
eventType: eventType,
eventId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
targetUserProfileId: userProfileId,
timestamp: new Date()
timestamp: (new Date()).valueOf()
}
event = {
@@ -354,8 +384,8 @@ function newWebApp() {
eventMessage = {
eventType: SA.projects.socialTrading.globals.eventTypes.NEW_USER_POST,
eventId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
text: postText,
timestamp: new Date()
postText: postText,
timestamp: (new Date()).valueOf()
}
event = {
+3 -3
View File
@@ -119,11 +119,11 @@
</tr>
</table>
</div>>
<div class="content-div">
<div class="post-placeholder">
<div id="content-div" class="content-div">
<div id="post-placeholder" class="post-placeholder">
Placeholder
</div>
<div class="new-post-div">
<div id="new-post-div" class="new-post-div">
<table>
<tr>
<td>Profile Pic</td>
+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'),
nodeFetch: require('node-fetch')
}
/*
Setting up Secrets.
*/
SA.secrets = {
array: require('./My-Secrets/Secrets.json'),
map: new Map()
}
for (let i = 0; i < SA.secrets.array.length; i++) {
let secret = SA.secrets.array[i]
SA.secrets.map.set (secret.codeName, secret)
}
run()
async function run() {
DK.app = require('./Desktop/DesktopApp.js').newDesktopApp()
await DK.app.run()
console.log('Superalgos Desktop App is Running!')
}
}
}
+4 -27
View File
@@ -3,42 +3,19 @@ FROM node:16-alpine as BASE
FROM BASE as BUILDER
RUN apk add --no-cache python3 make g++ curl \
&& curl -sf https://gobinaries.com/tj/node-prune | sh
WORKDIR /app
COPY . .
WORKDIR /app/Platform
RUN npm ci --only=production && node-prune
WORKDIR /app/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data
RUN npm ci --only=production && node-prune
WORKDIR /app/Projects/Foundations/TS/Bot-Modules/API-Data-Fetcher-Bot
RUN npm ci --only=production && node-prune
WORKDIR /app/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Announcements
RUN npm ci --only=production && node-prune
WORKDIR /app/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs
RUN npm ci --only=production && node-prune
WORKDIR /app/Projects/Foundations/TS/Task-Modules
RUN npm ci --only=production && node-prune
WORKDIR /app/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning
COPY ./package.json /app/package.json
COPY ./package-lock.json /app/package-lock.json
RUN npm ci --only=production && node-prune
FROM BASE
ENV PYTHONUNBUFFERED 1
RUN apk add --no-cache python3
WORKDIR /app
COPY . .
COPY --from=BUILDER /app/Platform/node_modules /app/Platform/node_modules
COPY --from=BUILDER /app/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/node_modules /app/Projects/Foundations/TS/Bot-Modules/Sensor-Bot/Exchange-Raw-Data/node_modules
COPY --from=BUILDER /app/Projects/Foundations/TS/Bot-Modules/API-Data-Fetcher-Bot/node_modules /app/Projects/Foundations/TS/Bot-Modules/API-Data-Fetcher-Bot/node_modules
COPY --from=BUILDER /app/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Announcements/node_modules /app/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Announcements/node_modules
COPY --from=BUILDER /app/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/node_modules /app/Projects/Foundations/TS/Bot-Modules/Trading-Bot/Low-Frequency-Trading/APIs/node_modules
COPY --from=BUILDER /app/Projects/Foundations/TS/Task-Modules/node_modules /app/Projects/Foundations/TS/Task-Modules/node_modules
COPY --from=BUILDER /app/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules /app/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules
COPY --from=BUILDER /app/node_modules /app/node_modules
RUN mkdir -p Data-Storage Log-Files My-Workspaces \
&& addgroup superalgos \
&& adduser --disabled-password --no-create-home --ingroup superalgos superalgos \
&& adduser --disabled-password --no-create-home --home /app --ingroup superalgos superalgos \
&& chown -R superalgos:superalgos /app
USER superalgos
EXPOSE 34248
EXPOSE 18041
-105
View File
@@ -1,105 +0,0 @@
const path = require("path");
const process = require("process");
const { exec } = require("child_process");
const systemCheck = require('./Launch-Scripts/system-check')
const platform = require('os').platform(); // Possible values are: 'aix', 'darwin', 'freebsd', 'linux', 'openbsd', 'sunos', and 'win32'.
// Check system is set up correctly
systemCheck();
// Handle adding shortcuts
if (process.argv.includes("noShortcuts")) {
// Cancel running script if flag provided
console.log('');
console.log('noShortcuts ................................................... Setting up without shortcuts.')
} else {
// Run create-shortcuts script
try {
const { fork } = require('child_process')
fork('./Launch-Scripts/create-shortcut.js')
} catch (err) {
console.log('')
console.log(err)
console.log('')
}
}
// Create Operating System compatable paths to each node_modules directory.
let nodeModulesDirs = [
path.join( process.cwd(), "Platform"),
path.join( process.cwd(), "Projects", "Foundations", "TS", "Bot-Modules", "Sensor-Bot", "Exchange-Raw-Data"),
path.join( process.cwd(), "Projects", "Foundations", "TS", "Bot-Modules", "API-Data-Fetcher-Bot"),
path.join( process.cwd(), "Projects", "Foundations", "TS", "Bot-Modules", "Trading-Bot", "Announcements"),
path.join( process.cwd(), "Projects", "Foundations", "TS", "Bot-Modules", "Trading-Bot", "Low-Frequency-Trading", "APIs"),
path.join( process.cwd(), "Projects", "Foundations", "TS", "Task-Modules")
];
if (
process.argv.includes("TensorFlow") ||
process.argv.includes("tensorflow") ||
process.argv.includes("--TensorFlow") ||
process.argv.includes("-TensorFlow") ||
process.argv.includes("--tensorflow") ||
process.argv.includes("--tensorflow")
) {
nodeModulesDirs = [
path.join( process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules", "Learning-Bot", "Low-Frequency-Learning")
]
}
// Check if WinOS because extra dependencies may be required for tfjs:
var tfjsWinInstallFlag = false;
if (platform === 'win32') { // *Note: win32 == win32 || win64
tfjsWinInstallFlag = true;
}
console.log('');
console.log("Installing node dependencies at the following directories:");
console.log('');
console.log(nodeModulesDirs);
console.log('');
for (let dir of nodeModulesDirs) {
// Loop through directories and run npm ci in a child process shell.
let command = "echo Results of install at "+ dir + " & npm ci";
exec( command,
{
cwd: dir
},
function ( error, stdout ){
if (error) {
console.log('');
console.log("There was an error installing some dependencies error: ");
console.log('');
console.log( error );
if (tfjsWinInstallFlag == true && dir == path.join(process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules", "Learning-Bot", "Low-Frequency-Learning")) {
tfjsWinInstall();
}
return;
}
console.log('');
console.log( stdout );
});
};
/* If WinOS && error with tfjs installation:
* This is a well known and documented issue with @Tensorflow/tfjs-node installation on WinOS.
* npm's windows-build-tools via: `npm install --global --production windows-build-tools` &&
* `npm install -g node-gyp` can sometimes correct the issue but not always depending on the
* version and options the user defined when installing npm/nodejs.
* The best reliable way to correct that I (Pluvtech) have found to work on many versions of WinOS
* is to reinstall nodejs and select to install chocolatey during the installation configuration.
*/
function tfjsWinInstall() {
console.log("\n*** Note to Windows Users Regarding the Superalgos TensorFlow Project ***");
console.log("If you have no other errors with this setup script and do not wish to use the TensorFlow Project:\nThen all is successful with your Superalgos setup and you may proceed to use the software.");
console.log("\nIf you do wish to install the @Tensorflow/tfjs-node modules required for use with the Superalgos TensorFlow Project:");
console.log("In this case it is likely your system is missing some dependencies required to build the TensorFlow (tfjs-node) bindings and you will need to follow the below steps:");
console.log("\n1.) Reinstall node.js from https://nodejs.org/en/download/ @Version 14.17.5 or higher.\nDuring installation, when you arrive at the 'Tools for Native Modules' screen you need to select the box to:\n\t'Automatically install the necessary tools...Chocolatey...'");
console.log("Doing this will cause a pop-up script in a new window which will install many npm/node tools and dependencies for use within the WinOS ecosystem.");
console.log("2.) When the installations finally complete you need to navigate back to your Superalgos directory and run `node setup` again.\n");
}
+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',
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
cd ..
node run
node platform
"$SHELL"
+1 -1
View File
@@ -1,3 +1,3 @@
cd /d %~dp0
cd ..
cmd /k "node run"
cmd /k "node platform"
+7 -7
View File
@@ -1,24 +1,24 @@
exports.newNetworkNode = function newNetworkNode() {
let thisObject = {
socialGraphService: undefined,
storage: undefined,
run: run
}
return thisObject
function run() {
async function run() {
/*
Let's start the Network Interfaces
*/
NT.webSocketsInterface = NT.projects.network.modules.webSocketsInterface.newNetworkModulesWebSocketsInterface()
NT.webSocketsInterface.initialize()
start()
async function start() {
let socialGraphService = NT.projects.socialTrading.modules.socialGraph.newSocialGraph()
await socialGraphService.initialize()
}
thisObject.socialGraphService = NT.projects.socialTrading.modules.socialGraph.newNetworkModulesSocialGraph()
await thisObject.socialGraphService.initialize()
thisObject.storage = NT.projects.socialTrading.modules.storage.newSocialTradingModulesStorage()
thisObject.storage.initialize()
}
}
+68
View File
@@ -0,0 +1,68 @@
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'),
path: require('path'),
util: require('util'),
nodeFetch: require('node-fetch'),
web3: require('web3'),
ws: require('ws'),
simpleGit: require('simple-git')
}
/*
Setting up Secrets.
*/
SA.secrets = {
array: require('./My-Secrets/Secrets.json'),
map: new Map()
}
for (let i = 0; i < SA.secrets.array.length; i++) {
let secret = SA.secrets.array[i]
SA.secrets.map.set(secret.codeName, secret)
}
NT.app = require('./Network/NetwokNode.js').newNetworkNode()
NT.app.run()
console.log('Superalgos Network is Running.')
}
}
+139 -32
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,
@@ -301,15 +301,17 @@ exports.newGithubServer = function newGithubServer() {
if (await validateFileNameEqualsGithubUsername() === false) { continue }
if (await validateFileChangedIsUserProfile() === false) { continue }
if (await validateMessageSignedIsGithubUsername() === false) { continue }
if (await validateMessageSignedHashIsSignatureHash() === false) { continue }
if (await validateUserProfileNodeNameEqualsGithubUsername() === false) { continue }
if (await validateUserProfileIdDoesNotBelongtoAnotherUserProfile() === false) { continue }
if (await validateUserProfileBlockchainAccountDoesNotBelongtoAnotherUserProfile() === false) { continue }
if (await validateUserProfileSigningAccountsDoesNotBelongtoAnotherUserProfile() === false) { continue }
if (await mergePullRequest() === false) {
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 +335,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 +343,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 +381,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 +389,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 +404,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 +423,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 +431,41 @@ 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,
pull_number: pullRequest.number,
state: 'closed'
});
return false
}
}
async function validateMessageSignedHashIsSignatureHash() {
/*
Validation #5: The message signed has is equal to the signature messageHash.
*/
let config = JSON.parse(userProfile.config)
let serverResponse = await PL.servers.WEB3_SERVER.hashData(
config.signature.message
)
let messageSignedHash = serverResponse.hash
let signatureHash = config.signature.messageHash
if (messageSignedHash !== signatureHash) {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #5 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Message Signed Hash is not equal to the the Signature Hash. -> messageSignedHash = ' + messageSignedHash + '-> signatureHash = ' + signatureHash)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: pullRequest.number,
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the Message Signed Hash is not equal to the the Signature Hash.\n\n messageSignedHash = "' + messageSignedHash + '"\n\n signatureHash = "' + signatureHash + '"'
});
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
@@ -442,12 +478,12 @@ exports.newGithubServer = function newGithubServer() {
async function validateUserProfileNodeNameEqualsGithubUsername() {
/*
Validation #5: The name of the User Profile node is not the Github Username.
Validation #6: The name of the User Profile node is not the Github Username.
*/
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)
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #6 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 +491,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,
@@ -468,7 +504,7 @@ exports.newGithubServer = function newGithubServer() {
async function validateUserProfileIdDoesNotBelongtoAnotherUserProfile() {
/*
Validation #6: The id of the User Profile can not be the id of an already existing User Profile
Validation #7: The id of the User Profile can not be the id of an already existing User Profile
unless the existing one belongs to the same Github username.
*/
let userProfileIdMap = new Map()
@@ -493,9 +529,9 @@ exports.newGithubServer = function newGithubServer() {
if (testUserProfile === undefined) { return true }
if (testUserProfile !== userProfile.name) {
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)
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #7 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 +539,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,
@@ -517,7 +553,7 @@ exports.newGithubServer = function newGithubServer() {
async function validateUserProfileBlockchainAccountDoesNotBelongtoAnotherUserProfile() {
try {
/*
Validation #7 The blockchain account of the User Profile can not be the
Validation #8 The blockchain account of the User Profile can not be the
blockchain account of an already existing User Profile
unless the existing one belongs to the same Github username.
*/
@@ -538,7 +574,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 +582,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
)
@@ -554,9 +590,9 @@ exports.newGithubServer = function newGithubServer() {
if (testUserProfile === undefined) { return true }
if (testUserProfile !== userProfile.name) {
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)
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #8 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 +600,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,
@@ -578,11 +614,82 @@ exports.newGithubServer = function newGithubServer() {
}
}
async function validateUserProfileSigningAccountsDoesNotBelongtoAnotherUserProfile() {
try {
if (userProfile.signingAccounts === undefined) { return true }
for (let i = 0; i < userProfile.signingAccounts.signingAccounts.length; i++) {
let signingAccount = userProfile.signingAccounts.signingAccounts[i]
let config = JSON.parse(signingAccount.config)
/*
Validation #9 Signing accounts of the User Profile
must have a signature of the same Github username of the User Profile.
*/
let messageSigned = config.signature.message
if (messageSigned !== githubUsername) {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #9 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Signing Account ' + signingAccount.name + ' has not signed the current Github User Account, but something else. -> messageSigned = ' + messageSigned + '-> githubUsername = ' + githubUsername)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: pullRequest.number,
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the Signing Account "' + signingAccount.name + '" has not signed the current Github User Account, but something else. \n\n messageSigned = "' + messageSigned + '" \n\n githubUsername = "' + githubUsername + '"'
});
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
pull_number: pullRequest.number,
state: 'closed'
});
return false
}
/*
Validation #10: The message signed has is equal to the signature messageHash.
*/
let serverResponse = await PL.servers.WEB3_SERVER.hashData(
config.signature.message
)
let messageSignedHash = serverResponse.hash
let signatureHash = config.signature.messageHash
if (messageSignedHash !== signatureHash) {
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #10 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Message Signed Hash is not equal to the the Signature Hash. -> messageSignedHash = ' + messageSignedHash + '-> signatureHash = ' + signatureHash)
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.issues.createComment({
owner: owner,
repo: repo,
issue_number: pullRequest.number,
body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because the Message Signed Hash is not equal to the the Signature Hash.\n\n messageSignedHash = "' + messageSignedHash + '"\n\n signatureHash = "' + signatureHash + '"'
});
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
await octokit.rest.pulls.update({
owner: owner,
repo: repo,
pull_number: pullRequest.number,
state: 'closed'
});
return false
}
}
return true
} catch (err) {
console.log(err.stack)
}
}
async function mergePullRequest() {
/*
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 +710,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 +738,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 +746,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,
+97 -43
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) {
@@ -43,16 +43,17 @@ exports.newHttpInterface = function newHttpInterface() {
case 'WEB3':
{
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let params = JSON.parse(body)
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 +64,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 +73,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 +85,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
)
@@ -92,9 +93,18 @@ exports.newHttpInterface = function newHttpInterface() {
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(serverResponse), httpResponse)
return
}
case 'hashData': {
let serverResponse = await PL.servers.WEB3_SERVER.hashData(
params.data
)
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(serverResponse), httpResponse)
return
}
case 'recoverAddress': {
let serverResponse = await CL.servers.WEB3_SERVER.recoverAddress(
let serverResponse = await PL.servers.WEB3_SERVER.recoverAddress(
params.signature
)
@@ -103,7 +113,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
)
@@ -131,10 +141,11 @@ exports.newHttpInterface = function newHttpInterface() {
break
case 'CCXT':
{
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let params = JSON.parse(body)
switch (params.method) {
@@ -242,9 +253,11 @@ exports.newHttpInterface = function newHttpInterface() {
break
}
case 'New-Message': {
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
function processRequest(messageReceived) {
if (messageReceived === undefined) { return }
let timestamp = (new Date()).valueOf()
let source = requestPath[3]
let exchange = requestPath[4]
@@ -291,10 +304,12 @@ exports.newHttpInterface = function newHttpInterface() {
{
switch (requestPath[2]) { // switch by command
case 'Save-Node-Schema': {
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let docsSchema = JSON.parse(body)
let project = requestPath[3]
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Nodes'
@@ -322,10 +337,12 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'Save-Concept-Schema': {
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let docsSchema = JSON.parse(body)
let project = requestPath[3]
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Concepts'
@@ -353,10 +370,12 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'Save-Topic-Schema': {
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let docsSchema = JSON.parse(body)
let project = requestPath[3]
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Topics'
@@ -384,10 +403,12 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'Save-Tutorial-Schema': {
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let docsSchema = JSON.parse(body)
let project = requestPath[3]
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Tutorials'
@@ -415,10 +436,12 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'Save-Review-Schema': {
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let docsSchema = JSON.parse(body)
let project = requestPath[3]
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Reviews'
@@ -446,10 +469,12 @@ exports.newHttpInterface = function newHttpInterface() {
}
case 'Save-Book-Schema': {
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let docsSchema = JSON.parse(body)
let project = requestPath[3]
let filePath = global.env.PATH_TO_PROJECTS + '/' + project + '/Schemas/Docs-Books'
@@ -625,8 +650,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 +690,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 +721,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 +785,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 +815,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 +856,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 +880,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 +915,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 +943,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',
@@ -991,16 +1016,18 @@ exports.newHttpInterface = function newHttpInterface() {
related to the Governance System are implemented here and routed
to the backend Servers that can process them.
*/
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let params = JSON.parse(body)
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 +1038,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 +1049,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,18 +1060,27 @@ 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
)
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(serverResponse), httpResponse)
setInterval(
PL.servers.GITHUB_SERVER.mergePullRequests,
60000,
params.commitMessage,
params.username,
params.token
)
return
}
case 'payContributors': {
let serverResponse = await CL.servers.WEB3_SERVER.payContributors(
let serverResponse = await PL.servers.WEB3_SERVER.payContributors(
params.contractAddress,
params.contractAbi,
params.paymentsArray,
@@ -1068,7 +1104,11 @@ exports.newHttpInterface = function newHttpInterface() {
message: err.message,
stack: err.stack
}
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(error), httpResponse)
try {
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(error), httpResponse)
} catch(err) {
// we just try to reponnd to the web app, but maybe the response has already been sent.
}
}
}
}
@@ -1375,6 +1415,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,
@@ -1407,10 +1452,12 @@ exports.newHttpInterface = function newHttpInterface() {
break
case 'SavePlugin':
{
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
try {
if (body === undefined) { return }
let plugin = JSON.parse(body)
let project = requestPath[2]
let folder = requestPath[3]
@@ -1541,10 +1588,12 @@ exports.newHttpInterface = function newHttpInterface() {
break
case 'SaveWorkspace':
{
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, processRequest)
SA.projects.foundations.utilities.httpRequests.getRequestBody(httpRequest, httpResponse, processRequest)
async function processRequest(body) {
if (body === undefined) { return }
let fileContent = body
let fileName = unescape(requestPath[2])
let filePath = global.env.PATH_TO_MY_WORKSPACES + '/' + fileName + '.json'
@@ -1693,11 +1742,16 @@ 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) {
console.log(err.stack)
if (err.stack !== undefined) {
console.log(err.stack)
}
if (err.message !== undefined) {
console.log('[ERROR] onHttpRequest -> err.message = ' + err.message)
}
}
}
}
+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)
+22 -5
View File
@@ -7,6 +7,7 @@ exports.newWeb3Server = function newWeb3Server() {
createWalletAccount: createWalletAccount,
getWalletBalances: getWalletBalances,
signData: signData,
hashData: hashData,
recoverAddress: recoverAddress,
mnemonicToPrivateKey: mnemonicToPrivateKey,
payContributors: payContributors,
@@ -15,7 +16,7 @@ exports.newWeb3Server = function newWeb3Server() {
run: run
}
const Web3 = require('web3');
const Web3 = SA.nodeModules.web3
let web3Map = new Map()
return thisObject
@@ -223,6 +224,22 @@ exports.newWeb3Server = function newWeb3Server() {
}
}
async function hashData(data) {
try {
let web3 = new Web3()
let hash = web3.eth.accounts.hashMessage(data)
return {
hash: hash,
result: 'Ok'
}
} catch (err) {
return { error: 'Could not hash the data. ' + err.stack }
}
}
async function recoverAddress(signature) {
try {
let signatureObject = JSON.parse(signature)
@@ -241,7 +258,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 +286,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 +305,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)
}
}
+7 -8
View File
@@ -1,7 +1,6 @@
let postLoader
function newAppLoader() {
const MODULE_NAME = 'App Loader'
const INFO_LOG = false
const ERROR_LOG = true
const logger = newWebDebugLog()
@@ -65,8 +64,8 @@ function newAppLoader() {
for (let i = 0; i < fileArray.length; i++) {
let item = fileArray[i]
project = item[0]
fileName = item[1]
let project = item[0]
let fileName = item[1]
urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Function-Libraries' + '/' + fileName)
}
@@ -85,8 +84,8 @@ function newAppLoader() {
for (let i = 0; i < fileArray.length; i++) {
let item = fileArray[i]
project = item[0]
fileName = item[1]
let project = item[0]
let fileName = item[1]
urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Utilities' + '/' + fileName)
}
@@ -105,8 +104,8 @@ function newAppLoader() {
for (let i = 0; i < fileArray.length; i++) {
let item = fileArray[i]
project = item[0]
fileName = item[1]
let project = item[0]
let fileName = item[1]
urlArray.push('Projects' + '/' + project + '/' + 'UI' + '/' + 'Globals' + '/' + fileName)
}
@@ -138,7 +137,7 @@ function newAppLoader() {
for (let i = 0; i < modulesArray.length; i++) {
let path = modulesArray[i]
console.log(path)
REQUIREJS([path], onRequired)
if (INFO_LOG === true) { logger.write('[INFO] loadModules -> Module Requested.') }
+26
View File
@@ -459,6 +459,32 @@ function newCanvas() {
return
}
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.saveFloatingObjectToBeMoved || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.saveFloatingObjectToBeMoved.toLowerCase())
) {
UI.projects.foundations.spaces.floatingSpace.saveFloatingObjectToBeMoved()
if (event.preventDefault !== undefined) {
event.preventDefault()
}
return
}
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.moveSavedFloatingObjectToMouse || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.moveSavedFloatingObjectToMouse.toLowerCase())
) {
UI.projects.foundations.spaces.floatingSpace.moveSavedFloatingObjectToMouse(thisObject.mouse.position)
if (event.preventDefault !== undefined) {
event.preventDefault()
}
return
}
let nodeOnFocus = await UI.projects.foundations.spaces.designSpace.workspace.getNodeThatIsOnFocus()
if (nodeOnFocus !== undefined) {
if (nodeOnFocus.payload.uiObject.codeEditor !== undefined) {
+13 -13
View File
@@ -1,5 +1,5 @@
function newEventsServerClient(networkNode) {
function newEventsServerClient(lanNetworkNode) {
/* Web Sockets Connection */
const MODULE_NAME = 'System Event Handler'
@@ -192,19 +192,19 @@ function newEventsServerClient(networkNode) {
if (thisObject.isConnected() !== true) {
if (lastTryToReconnectDatetime !== undefined) {
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.')
if (lanNetworkNode !== undefined) {
if (lanNetworkNode.payload !== undefined) {
if (lanNetworkNode.payload.uiObject !== undefined) {
lanNetworkNode.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.')
}
}
}
}
} else {
if (networkNode !== undefined) {
if (networkNode.payload !== undefined) {
if (networkNode.payload.uiObject !== undefined) {
networkNode.payload.uiObject.setStatus('Connected to Superalgos Client via WebSockets.')
if (lanNetworkNode !== undefined) {
if (lanNetworkNode.payload !== undefined) {
if (lanNetworkNode.payload.uiObject !== undefined) {
lanNetworkNode.payload.uiObject.setStatus('Connected to Superalgos Platform Client via WebSockets.')
retryCommandsPhysics()
}
}
@@ -220,14 +220,14 @@ function newEventsServerClient(networkNode) {
let port
/* At this point the node does not have the payload property yet, that is why we have to do this manually */
try {
let config = JSON.parse(networkNode.config)
let config = JSON.parse(lanNetworkNode.config)
host = config.host
port = config.webSocketsPort
/* Check if we really have to stablish the connection. */
if (config.autoConnect === false) { return }
} catch (err) {
networkNode.payload.uiObject.setErrorMessage(
lanNetworkNode.payload.uiObject.setErrorMessage(
'Bad configuration. Invalid JSON Format.',
undefined,
{
@@ -241,7 +241,7 @@ function newEventsServerClient(networkNode) {
}
if (host === undefined) {
networkNode.payload.uiObject.setErrorMessage(
lanNetworkNode.payload.uiObject.setErrorMessage(
'Bad configuration. Host Property Not Found.',
undefined,
{
@@ -255,7 +255,7 @@ function newEventsServerClient(networkNode) {
}
if (port === undefined) {
networkNode.payload.uiObject.setErrorMessage(
lanNetworkNode.payload.uiObject.setErrorMessage(
'Bad configuration. WebSocketsPort Property Not Found.',
undefined,
{
+3
View File
@@ -98,6 +98,9 @@ function newUniqueId () {
function splitTextIntoPhrases (text, wordsPerLine) {
try {
if (text.split === undefined) {
return []
}
let splittedLabel = text.split(' ')
let phrases = []
let phrase = ''
-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,6 +21,7 @@
},
{
"action": "Delete UI Object",
"actionProject": "Foundations",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"actionFunction": "payload.executeAction",
@@ -21,6 +21,7 @@
},
{
"action": "Delete UI Object",
"actionProject": "Foundations",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"actionFunction": "payload.executeAction",
@@ -3,22 +3,25 @@
"menuItems": [
{
"action": "Add UI Object",
"actionProject": "Foundations",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "spaceStyle",
"label": "Add Space Style",
"relatedUiObject": "Space Style",
"propertyToCheckFor": "docsSpaceStyle",
"label": "Add Docs Space Style",
"relatedUiObject": "Docs Space Style",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"actionProject": "Foundations",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "spaceSettings",
"label": "Add Space Settings",
"relatedUiObject": "Space Settings",
"propertyToCheckFor": "docsSpaceSettings",
"label": "Add Docs Space Settings",
"relatedUiObject": "Docs Space Settings",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"actionProject": "Foundations",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"actionFunction": "payload.executeAction",
@@ -50,6 +50,7 @@ function newEducationTutorialSpace() {
let tutorialFormDiv = document.getElementById('tutorialFormDiv')
let htmlGif = document.createElement("IMG")
let htmlImage = document.createElement("IMG")
//let htmlVid = document.createElement("iframe")
let currentGifName
let newGifName
@@ -182,6 +183,7 @@ function newEducationTutorialSpace() {
checkPressButton()
checkGif()
checkImage()
//checkVid()
checkDocumentation()
checkWorkspaces()
checkSlider()
@@ -326,6 +328,17 @@ function newEducationTutorialSpace() {
}
}
function checkVid() {
let tutorialGifDiv = document.getElementById('tutorialGifDiv')
if (tutorialGifDiv !== null && tutorialGifDiv !== undefined) {
tutorialGifDiv.appendChild(htmlGif)
}
if (currentGifName === newGifName) { return }
currentGifName = newGifName
htmlVid.src = currentGifName
}
function checkDocumentation() {
if (currentNode === undefined) { return }
let config = JSON.parse(currentNode.config)
@@ -994,7 +1007,7 @@ function newEducationTutorialSpace() {
function resumeTutorial(node) {
if (UI.projects.foundations.spaces.designSpace.workspace.isInitialized !== true) { return }
//Testing if removing the navigationStack reset here fixes the tutorial resume issues
//navigationStack = []
navigationStack = []
node.payload.uiObject.isPlaying = true
tutorialRootNode = node
currentNode = node
@@ -1016,7 +1029,7 @@ function newEducationTutorialSpace() {
function resumeTutorialTopic(node) {
//Testing if removing the navigationStack reset here fixes the tutorial resume issues
//navigationStack = []
navigationStack = []
currentTopicNode = node
currentNode = node
currentStatus = 'Playing Topic'
@@ -1037,7 +1050,7 @@ function newEducationTutorialSpace() {
function resumeTutorialStep(node) {
//Testing if removing the navigationStack reset here fixes the tutorial resume issues
//navigationStack = []
navigationStack = []
currentStepNode = node
currentNode = node
currentStatus = 'Playing Step'
@@ -1432,6 +1445,13 @@ function newEducationTutorialSpace() {
newGifName = text
break
}
case 'Youtube': {
let text = UI.projects.education.utilities.docs.getTextBasedOnLanguage(paragraph)
let src = UI.projects.education.utilities.docs.parseYoutube(text)
console.log('text', src)
html = html + '<iframe width="400" height="215" src="https://www.youtube.com/embed/' + text + '" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
break
}
case 'Text': {
let text = UI.projects.education.utilities.docs.getTextBasedOnLanguage(paragraph)
text = UI.projects.education.utilities.docs.addKeyboard(text)
@@ -1536,8 +1556,9 @@ function newEducationTutorialSpace() {
function onOpening() {
//console.log('onOpening');
let nodeResume = navigationStack.pop()
if (currentStatus !== "Stopped"){return}
let nodeResume = navigationStack.pop()
switch (nodeResume.type) {
case 'Tutorial': {
resumeTutorial(nodeResume)
@@ -21,7 +21,7 @@
}
],
"referencingRules": {
"compatibleTypes": "->Network Node->"
"compatibleTypes": "->LAN Network Node->"
},
"editors": {
"config": true
@@ -42,8 +42,8 @@ function newEthereumUtilitiesRouteToClient() {
return
}
let networkNodeConfig = JSON.parse(networkClient.payload.referenceParent.config)
let url = 'http://' + networkNodeConfig.host + ':' + networkNodeConfig.webPort + '/' + 'WEB3'
let lanNetworkNodeConfig = JSON.parse(networkClient.payload.referenceParent.config)
let url = 'http://' + lanNetworkNodeConfig.host + ':' + lanNetworkNodeConfig.webPort + '/' + 'WEB3'
return {
params: params,
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -19330,7 +19330,7 @@
},
{
"type": "Indicator Bot",
"name": "Relative Strenght Index (RSI)",
"name": "Relative Strength Index (RSI)",
"config": "{\n\"codeName\": \"RSI\"\n}",
"project": "Foundations",
"processes": [
@@ -19383,7 +19383,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Indicator Bot",
"Foundations",
"b2fc1830-30e3-407a-9cd2-ab93a9e36cc7"
@@ -19535,7 +19535,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Indicator Bot",
"Foundations",
"b2fc1830-30e3-407a-9cd2-ab93a9e36cc7"
@@ -19829,7 +19829,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Indicator Bot",
"Foundations",
"b2fc1830-30e3-407a-9cd2-ab93a9e36cc7"
@@ -19920,7 +19920,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Indicator Bot",
"Foundations",
"b2fc1830-30e3-407a-9cd2-ab93a9e36cc7"
@@ -20717,7 +20717,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -38266,7 +38266,7 @@
},
{
"type": "Plotter",
"name": "Relative Strenght Index (RSI)",
"name": "Relative Strength Index (RSI)",
"config": "{\n\"codeName\": \"Plotter RSI\"\n}",
"project": "Foundations",
"modules": [
@@ -39291,7 +39291,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -39363,7 +39363,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -39435,7 +39435,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -39507,7 +39507,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -39664,7 +39664,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -39736,7 +39736,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -39808,7 +39808,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -39880,7 +39880,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40037,7 +40037,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40109,7 +40109,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40181,7 +40181,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40253,7 +40253,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40410,7 +40410,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40482,7 +40482,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40554,7 +40554,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40626,7 +40626,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40783,7 +40783,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -40855,7 +40855,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41012,7 +41012,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41084,7 +41084,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41241,7 +41241,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41313,7 +41313,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41470,7 +41470,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41542,7 +41542,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41699,7 +41699,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41771,7 +41771,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -41985,7 +41985,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -42057,7 +42057,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -42214,7 +42214,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -42286,7 +42286,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -42358,7 +42358,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
@@ -42430,7 +42430,7 @@
"63b3bd4b-97da-47a7-8f72-b9eaf0632ebb"
],
[
"Relative Strenght Index (RSI)",
"Relative Strength Index (RSI)",
"Plotter",
"Foundations",
"d87c1a49-c376-404b-98ff-62feac714c64"
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{\n \"host\": \"localhost\",\n \"webPort\": \"34248\",\n \"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
@@ -166,11 +166,11 @@
},
{
"type": "Task",
"name": "Relative Strenght Index (RSI)",
"name": "Relative Strength Index (RSI)",
"project": "Foundations",
"bot": {
"type": "Indicator Bot Instance",
"name": "Relative Strenght Index (RSI)",
"name": "Relative Strength Index (RSI)",
"config": "{ \n\"parameter1\": \"Value for parameter1 defined at the Product Definition\"\n}",
"project": "Foundations",
"processes": [
@@ -2736,7 +2736,7 @@
},
{
"type": "Bot Products",
"name": "Relative Strenght Index (RSI)",
"name": "Relative Strength Index (RSI)",
"project": "Foundations",
"dataProducts": [
{
@@ -21362,7 +21362,7 @@
},
{
"type": "Bot Layers",
"name": "Relative Strenght Index (RSI)",
"name": "Relative Strength Index (RSI)",
"project": "Foundations",
"layers": [
{
@@ -31933,7 +31933,7 @@
},
{
"type": "Bot Layers",
"name": "Relative Strenght Index (RSI)",
"name": "Relative Strength Index (RSI)",
"project": "Foundations",
"layers": [
{
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
File diff suppressed because it is too large. Load diff
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
@@ -140433,8 +140433,8 @@
"status": "Done"
},
"referenceParent": {
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"id": "3c165071-7558-4708-9999-8ffe71d346b1"
}
}
@@ -141009,8 +141009,8 @@
"status": "Done"
},
"referenceParent": {
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"id": "3c165071-7558-4708-9999-8ffe71d346b1"
}
}
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
@@ -7994,7 +7994,7 @@
"status": "Done"
},
"referenceParent": {
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"id": "e452cf65-2b2b-44f2-9e67-bdd9d3c008e4"
}
File diff suppressed because it is too large. Load diff
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
@@ -4,12 +4,12 @@
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Network",
"name": "My Network",
"type": "LAN Network",
"name": "My LAN Network",
"project": "Foundations",
"networkNodes": [
"lanNetworkNodes": [
{
"type": "Network Node",
"type": "LAN Network Node",
"name": "My Computer",
"config": "{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}",
"project": "Foundations",
@@ -4,6 +4,7 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () {
getDirectories: getDirectories,
getAllFilesInDirectoryAndSubdirectories: getAllFilesInDirectoryAndSubdirectories,
pathFromDate: pathFromDate,
pathFromDatetime: pathFromDatetime,
mkDirByPathSync: mkDirByPathSync
}
@@ -21,8 +22,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);
@@ -55,18 +56,38 @@ exports.newFoundationsUtilitiesFilesAndDirectories = function () {
}
function pathFromDate(timestamp) {
let file = { date: new Date(timestamp) }
file.year = file.date.getUTCFullYear()
file.month = file.date.getUTCMonth() + 1
file.day = file.date.getUTCDate()
return file.year + '/' +
SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' +
SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2)
}
function pathFromDatetime(timestamp) {
let file = { date: new Date(timestamp) }
file.year = file.date.getUTCFullYear()
file.month = file.date.getUTCMonth() + 1
file.day = file.date.getUTCDate()
file.hour = file.date.getUTCHours()
file.minute = file.date.getMinutes()
return file.year + '/' +
SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.month, 2) + '/' +
SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.day, 2) + '/' +
SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.hour, 2) + '/' +
SA.projects.foundations.utilities.miscellaneousFunctions.pad(file.minute, 2)
}
/* 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 +98,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!
@@ -6,7 +6,7 @@ exports.newFoundationsUtilitiesHttpRequests = function () {
return thisObject
function getRequestBody(httpRequest, callback) { // Gets the de body from a POST httpRequest to the web server
function getRequestBody(httpRequest, httpResponse, callback) { // Gets the de body from a POST httpRequest to the web server
try {
let body = ''
@@ -26,10 +26,12 @@ exports.newFoundationsUtilitiesHttpRequests = function () {
httpRequest.on('error', function (err) {
console.log('[ERROR] getBody -> err.stack = ' + err.stack)
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse)
callback()
})
} catch (err) {
console.log('[ERROR] getBody -> err.stack = ' + err.stack)
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse)
callback()
}
}
}
@@ -33,32 +33,48 @@
"propertyNameAtParent": "assets",
"alternativeIcons": [
{
"codeName": "XMR",
"iconName": "monero"
"codeName": "ADA",
"iconName": "cardano"
},
{
"codeName": "USDT",
"iconName": "tether"
"codeName": "BCH",
"iconName": "bitcoin-cash"
},
{
"codeName": "TRX",
"iconName": "tron"
"codeName": "BNB",
"iconName": "binance-coin"
},
{
"codeName": "XLM",
"iconName": "stellar"
"codeName": "BTC",
"iconName": "bitcoin"
},
{
"codeName": "QTUM",
"iconName": "qtum"
"codeName": "BUSD",
"iconName": "binance-usd"
},
{
"codeName": "NEO",
"iconName": "neo"
"codeName": "CAKE",
"iconName": "cake"
},
{
"codeName": "LTC",
"iconName": "litecoin"
"codeName": "DAI",
"iconName": "dai"
},
{
"codeName": "DASH",
"iconName": "dash"
},
{
"codeName": "DOGE",
"iconName": "dogecoin"
},
{
"codeName": "DOT",
"iconName": "polkadot"
},
{
"codeName": "EOS",
"iconName": "eos"
},
{
"codeName": "ETC",
@@ -69,72 +85,76 @@
"iconName": "ethereum"
},
{
"codeName": "EOS",
"iconName": "eos"
},
{
"codeName": "DASH",
"iconName": "dash"
},
{
"codeName": "ADA",
"iconName": "cardano"
},
{
"codeName": "BCH",
"iconName": "bitcoin-cash"
},
{
"codeName": "BTC",
"iconName": "bitcoin"
},
{
"codeName": "BNB",
"iconName": "binance-coin"
},
{
"codeName": "USD",
"iconName": "us-dollar"
},
{
"codeName": "ZAR",
"iconName": "zar"
},
{
"codeName": "XRP",
"iconName": "xrp"
},
{
"codeName": "DOGE",
"iconName": "dogecoin"
},
{
"codeName": "SOL",
"iconName": "solana"
},
{
"codeName": "DOT",
"iconName": "polkadot"
},
{
"codeName": "UNI",
"iconName": "uniswap"
},
{
"codeName": "BUSD",
"iconName": "binance-usd"
},
{
"codeName": "SXP",
"iconName": "swipe"
"codeName": "EUR",
"iconName": "euro"
},
{
"codeName": "LINK",
"iconName": "chainlink"
},
{
"codeName": "EUR",
"iconName": "euro"
"codeName": "LTC",
"iconName": "litecoin"
},
{
"codeName": "NANO",
"iconName": "nano"
},
{
"codeName": "NEO",
"iconName": "neo"
},
{
"codeName": "QTUM",
"iconName": "qtum"
},
{
"codeName": "SOL",
"iconName": "solana"
},
{
"codeName": "SXP",
"iconName": "swipe"
},
{
"codeName": "TRX",
"iconName": "tron"
},
{
"codeName": "XMR",
"iconName": "monero"
},
{
"codeName": "UNI",
"iconName": "uniswap"
},
{
"codeName": "USD",
"iconName": "us-dollar"
},
{
"codeName": "USDC",
"iconName": "usdc"
},
{
"codeName": "USDT",
"iconName": "tether"
},
{
"codeName": "VET",
"iconName": "vechain"
},
{
"codeName": "XLM",
"iconName": "stellar"
},
{
"codeName": "XRP",
"iconName": "xrp"
},
{
"codeName": "ZAR",
"iconName": "zar"
}
]
}
@@ -41,6 +41,12 @@
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Add UI Object",
"label": "Add Social Bots",
"relatedUiObject": "Social Bots",
"actionFunction": "payload.executeAction"
},
{
"action": "Add Missing Children",
"label": "Add Missing Children",
@@ -38,7 +38,7 @@
"addLeftIcons": true,
"level": 2,
"attachingRules": {
"compatibleTypes": "->Network Node->"
"compatibleTypes": "->LAN Network Node->"
},
"propertyNameAtParent": "dataStorage",
"childrenNodesProperties": [
@@ -49,7 +49,7 @@
"addLeftIcons": true,
"level": 2,
"attachingRules": {
"compatibleTypes": "->Network Node->"
"compatibleTypes": "->LAN Network Node->"
},
"propertyNameAtParent": "dataTasks",
"childrenNodesProperties": [
@@ -41,6 +41,12 @@
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Add UI Object",
"label": "Add Social Bots",
"relatedUiObject": "Social Bots",
"actionFunction": "payload.executeAction"
},
{
"action": "Add Missing Children",
"label": "Add Missing Children",
@@ -1,5 +1,5 @@
{
"type": "Network Node",
"type": "LAN Network Node",
"menuItems": [
{
"action": "Configure",
@@ -69,7 +69,7 @@
"addLeftIcons": true,
"level": 1,
"attachingRules": {
"compatibleTypes": "->Network->"
"compatibleTypes": "->LAN Network->"
},
"childrenNodesProperties": [
{
@@ -103,5 +103,5 @@
"autoAdd": true
}
],
"propertyNameAtParent": "networkNodes"
"propertyNameAtParent": "lanNetworkNodes"
}
@@ -1,10 +1,10 @@
{
"type": "Network",
"type": "LAN Network",
"menuItems": [
{
"action": "Add UI Object",
"label": "Add Network Node",
"relatedUiObject": "Network Node",
"label": "Add LAN Network Node",
"relatedUiObject": "LAN Network Node",
"actionFunction": "payload.executeAction"
},
{
@@ -22,9 +22,9 @@
"level": 0,
"childrenNodesProperties": [
{
"name": "networkNodes",
"name": "lanNetworkNodes",
"type": "array",
"childType": "Network Node"
"childType": "LAN Network Node"
}
]
}
@@ -49,7 +49,7 @@
"addLeftIcons": true,
"level": 2,
"attachingRules": {
"compatibleTypes": "->Network Node->"
"compatibleTypes": "->LAN Network Node->"
},
"propertyNameAtParent": "learningTasks",
"childrenNodesProperties": [
@@ -41,6 +41,12 @@
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Add UI Object",
"label": "Add Social Bots",
"relatedUiObject": "Social Bots",
"actionFunction": "payload.executeAction"
},
{
"action": "Add Missing Children",
"label": "Add Missing Children",
@@ -4,7 +4,7 @@
{
"action": "Add UI Object",
"label": "Add Network",
"relatedUiObject": "Network",
"relatedUiObject": "LAN Network",
"actionFunction": "payload.executeAction"
},
{
@@ -41,6 +41,12 @@
"dontShowAtFullscreen": true,
"actionFunction": "uiObject.configEditor.activate"
},
{
"action": "Add UI Object",
"label": "Add Social Bots",
"relatedUiObject": "Social Bots",
"actionFunction": "payload.executeAction"
},
{
"action": "Add Missing Children",
"label": "Add Missing Children",
@@ -49,7 +49,7 @@
"addLeftIcons": true,
"level": 0,
"attachingRules": {
"compatibleTypes": "->Network Node->"
"compatibleTypes": "->LAN Network Node->"
},
"propertyNameAtParent": "productionTradingTasks",
"childrenNodesProperties": [
@@ -49,7 +49,7 @@
"addLeftIcons": true,
"level": 0,
"attachingRules": {
"compatibleTypes": "->Network Node->"
"compatibleTypes": "->LAN Network Node->"
},
"propertyNameAtParent": "testingTradingTasks",
"childrenNodesProperties": [
@@ -17,7 +17,7 @@
},
{
"style": "Chapter",
"text": "III->Foundations->Topic->Network->The Network hierarchy organizes the infrastructure to run bots and store data. It is the hierarchy you will use the most to operate the system.",
"text": "III->Foundations->Topic->LAN Network->The Network hierarchy organizes the infrastructure to run bots and store data. It is the hierarchy you will use the most to operate the system.",
"updated": 1610309740906
},
{
@@ -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": [
@@ -141,7 +141,7 @@
},
{
"style": "Javascript",
"text": "parameterValue = \nMath.trunc((new Date()).valueOf() / \nTS.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nTS.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS",
"text": "parameterValue = \nMath.trunc((new Date()).valueOf() / \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS",
"updated": 1622477009814
},
{
@@ -151,7 +151,7 @@
},
{
"style": "Javascript",
"text": "parameterValue = Math.trunc((new Date()).valueOf() / \nTS.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nTS.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS + \nTS.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1",
"text": "parameterValue = Math.trunc((new Date()).valueOf() / \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS) * \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS + \nSA.projects.foundations.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1",
"updated": 1622477088684
},
{
@@ -1,5 +1,5 @@
{
"type": "Network Node",
"type": "LAN Network Node",
"definition": {
"text": "A network node represents a machine running Superalgos, on which processes run and data is stored.",
"translations": [
@@ -1,5 +1,5 @@
{
"type": "Network",
"type": "LAN Network",
"definition": {
"text": "The network hierarchy provides the control functions for running data-mining and trading operations. Because operations may be run either on a single machine or distributed over a network of machines, it also contains definitions regarding the physical location in which nodes live or function.",
"translations": [
@@ -80,8 +80,8 @@
},
{
"style": "Text",
"text": "Ctrl or Cmd + Shift + Key-S",
"updated": 1615891225650
"text": "Ctrl or Cmd + Shift + Alt + Key-S",
"updated": 1631372841724
},
{
"style": "Success",
@@ -0,0 +1,23 @@
{
"review": "Superalgos Project Review",
"pageNumber": 27,
"type": "Superalgos Review - My highly constructive and original review",
"definition": {
"text": "Write a summary for this review page."
},
"paragraphs": [
{
"style": "Text",
"text": "The project looks nice.",
"updated": 1631145094399
},
{
"style": "Text",
"text": "This was my highly constructive and original review."
},
{
"style": "Text",
"text": "Tentacule23"
}
]
}
@@ -0,0 +1,22 @@
{
"review": "Superalgos Project Review",
"pageNumber": 31,
"type": "Superalgos Review - Great Getting Started Tutorials But Not Fully Stable",
"definition": {
"text": "Write a summary for this review page."
},
"paragraphs": [
{
"style": "Text",
"text": "Great GUI - hierarchy, options to move icons around, create backups, and workspaces."
},
{
"style": "Text",
"text": "Although, an opportunity to improve troubleshooting errors exists (e.g. providing more on-screen user feedback). A couple of errors occured for me during the getting started tutorials, which made my learning experience a little frustrating."
},
{
"style": "Text",
"text": "Otherwise, I'm looking forward to exploring the full potential of the app framework! :)"
}
]
}
@@ -62,7 +62,7 @@
},
{
"style": "Javascript",
"text": "dataStorage = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(networkNode, 'Data Storage')",
"text": "dataStorage = UI.projects.foundations.functionLibraries.uiObjectsFromNodes.addUIObject(lanNetworkNode, 'Data Storage')",
"updated": 1614943544233
},
{
@@ -21,6 +21,15 @@
"style": "Success",
"text": "If you change the code of your function, reload the UI and you can debug it again with the new changes.",
"updated": 1614939195464
},
{
"style": "Text",
"text": "You can find more information about setting up and debugging in this topic:",
"updated": 1631371694241
},
{
"style": "List",
"text": "Debugging - Download and Install Visual Studio Code"
}
]
}
@@ -70,17 +70,17 @@
},
{
"style": "Title",
"text": "Network",
"text": "LAN Network",
"updated": 1609945037649
},
{
"style": "Include",
"text": "Foundations->Node->Network->Definition",
"text": "Foundations->Node->LAN Network->Definition",
"updated": 1609945860234
},
{
"style": "Include",
"text": "Foundations->Node->Network->Content",
"text": "Foundations->Node->LAN Network->Content",
"updated": 1609945864347
},
{
@@ -1,20 +1,20 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "1",
"type": "Network Hierarchy",
"type": "LAN Network Hierarchy",
"definition": {
"text": "The Network Hierarchy organizes the infrastructure to run bots and store data. It is the hierarchy you will use the most to operate the system.",
"text": "The LAN Network Hierarchy organizes the infrastructure to run bots and store data. It is the hierarchy you will use the most to operate the system.",
"updated": 1610043827538
},
"paragraphs": [
{
"style": "Include",
"text": "Foundations->Node->Network->Definition",
"text": "Foundations->Node->LAN Network->Definition",
"updated": 1610043677920
},
{
"style": "Include",
"text": "Foundations->Node->Network->Content",
"text": "Foundations->Node->LAN Network->Content",
"updated": 1610043683253
},
{
@@ -24,21 +24,21 @@
},
{
"style": "Hierarchy",
"text": "Foundations->Network->3",
"text": "Foundations->LAN Network->3",
"updated": 1610049486480
},
{
"style": "Title",
"text": "Network Node"
"text": "LAN Network Node"
},
{
"style": "Include",
"text": "Foundations->Node->Network Node->Definition",
"text": "Foundations->Node->LAN Network Node->Definition",
"updated": 1610043762523
},
{
"style": "Include",
"text": "Foundations->Node->Network Node->Content",
"text": "Foundations->Node->LAN Network Node->Content",
"updated": 1610043768852
},
{
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "2",
"type": "Organization of Tasks",
"definition": {
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "3",
"type": "Data Tasks Section",
"definition": {
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "4",
"type": "Indicator and Sensor Bot Instances",
"definition": {
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "5",
"type": "Testing Trading Tasks Section",
"definition": {
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "6",
"type": "Production Trading Tasks Section",
"definition": {
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "7",
"type": "Trading Bot Instance and Trading Sessions",
"definition": {
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "8",
"type": "Trading Session References",
"definition": {
@@ -1,5 +1,5 @@
{
"topic": "Network",
"topic": "LAN Network",
"pageNumber": "9",
"type": "Trading Session Parameters",
"definition": {
Loaded 100 of 279 files, more files were not shown because too many files have changed in this diff. Show more