Skip to content

Commit

Permalink
s/SocialTrade/SocialTrading
Browse files Browse the repository at this point in the history
  • Loading branch information
NAmorim committed Nov 28, 2022
1 parent 4400536 commit 0825df3
Show file tree
Hide file tree
Showing 32 changed files with 64 additions and 64 deletions.
8 changes: 4 additions & 4 deletions .tests/Environment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ const expectedObject = {
PATH_TO_PROJECTS_REQUIRED: path.join(basePath, './Projects'),
PATH_TO_PROJECT_SCHEMA: path.join(basePath, './Projects/ProjectsSchema.json'),
PATH_TO_PLATFORM: path.join(basePath, './Platform'),
PATH_TO_DESKTOP: './SocialTrade',
PATH_TO_DESKTOP: './SocialTrading',
PATH_TO_DEFAULT_WORKSPACE: path.join(basePath, './Plugins/Foundations/Workspaces'),
PATH_TO_MY_WORKSPACES: path.join(basePath, './Platform/My-Workspaces'),
PATH_TO_SECRETS: path.join(basePath, './My-Secrets'),
PATH_TO_FONTS: path.join(basePath, './Platform/WebServer/Fonts'),
PATH_TO_BITCOIN_FACTORY: path.join(basePath, './Bitcoin-Factory'),
DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1',
DESKTOP_APP_MAX_OUTGOING_PEERS: 1,
DESKTOP_APP_MAX_OUTGOING_START_PEERS: 0,
SOCIALTRADING_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1',
SOCIALTRADING_APP_MAX_OUTGOING_PEERS: 1,
SOCIALTRADING_APP_MAX_OUTGOING_START_PEERS: 0,
TASK_SERVER_APP_MAX_OUTGOING_PEERS: 1,
TASK_SERVER_APP_MAX_OUTGOING_START_PEERS: 1,
MOBILE_APP_SIGNING_ACCOUNT: 'Social-Trading-Mobile-App-1',
Expand Down
6 changes: 3 additions & 3 deletions .tests/Launch-Scripts/createShortcut.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jest.mock('child_process', () => {
if (command === `$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut("${dir}"); $S.TargetPath = "${target}"; $S.IconLocation = "${icon}"; $S.Save()`) {
return 0
}
if (command === `cp ${name}.desktop ~/SocialTrade/${name}.desktop & cp ${name}.desktop ~/.local/share/applications/${name}.desktop`) {
if (command === `cp ${name}.desktop ~/SocialTrading/${name}.desktop & cp ${name}.desktop ~/.local/share/applications/${name}.desktop`) {
return 0
}
if (command === `chmod +x ${name}.command & cp ${name}.command ~/SocialTrade/${name}.command`) {
if (command === `chmod +x ${name}.command & cp ${name}.command ~/SocialTrading/${name}.command`) {
return 0
}
if (command === `npm install -g fileicon`) {
return 0
}
if (command === `./node_modules/fileicon/bin/fileicon set ~/SocialTrade/${name}.command ./Launch-Scripts/superalgos.ico`) {
if (command === `./node_modules/fileicon/bin/fileicon set ~/SocialTrading/${name}.command ./Launch-Scripts/superalgos.ico`) {
return 0
}
if (command === `npm uninstall -g fileicon`) {
Expand Down
6 changes: 3 additions & 3 deletions .tests/Launch-Scripts/runUninstall.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jest.mock('child_process', () => {
let cwd = __dirname
let dirs = cwd.split(path.sep)
let name = dirs[dirs.length - 1]
let desktop = path.join(os.homedir(), "SocialTrade", `${name}.lnk`)
let desktop = path.join(os.homedir(), "SocialTrading", `${name}.lnk`)
let startMenu = path.join(os.homedir(), "AppData", "Roaming", "Microsoft", "Windows", "Start Menu", "Programs", `${name}.lnk`)

return {
Expand All @@ -17,10 +17,10 @@ jest.mock('child_process', () => {
if (command === `del "${desktop}" & del "${startMenu}"`) {
return 0
}
if (command === `rm ~/SocialTrade/${name}.command`) {
if (command === `rm ~/SocialTrading/${name}.command`) {
return 0
}
if (command === `rm ~/SocialTrade/${name}.desktop & rm ~/.local/share/applications/${name}.desktop`) {
if (command === `rm ~/SocialTrading/${name}.desktop & rm ~/.local/share/applications/${name}.desktop`) {
return 0
}
})
Expand Down
10 changes: 5 additions & 5 deletions DesktopReact/DesktopAppBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ It provides access to all modules built for this App.
let ENVIRONMENT = require('../Environment.js');
global.env = ENVIRONMENT.newEnvironment();

if (debugSettings !== undefined && debugSettings.DESKTOP_APP_SIGNING_ACCOUNT !== undefined) {
global.env.DESKTOP_APP_SIGNING_ACCOUNT = debugSettings.DESKTOP_APP_SIGNING_ACCOUNT
if (debugSettings !== undefined && debugSettings.SOCIALTRADING_APP_SIGNING_ACCOUNT !== undefined) {
global.env.SOCIALTRADING_APP_SIGNING_ACCOUNT = debugSettings.SOCIALTRADING_APP_SIGNING_ACCOUNT
}
/*
First thing is to load the project schema file.
Expand Down Expand Up @@ -104,11 +104,11 @@ It provides access to all modules built for this App.
*/
thisObject.p2pNetworkClient = SA.projects.network.modules.p2pNetworkClient.newNetworkModulesP2PNetworkClient()
await thisObject.p2pNetworkClient.initialize(
global.env.DESKTOP_APP_SIGNING_ACCOUNT,
global.env.SOCIALTRADING_APP_SIGNING_ACCOUNT,
global.env.DESKTOP_TARGET_NETWORK_TYPE,
global.env.DESKTOP_TARGET_NETWORK_CODENAME,
global.env.DESKTOP_APP_MAX_OUTGOING_PEERS,
global.env.DESKTOP_APP_MAX_OUTGOING_START_PEERS,
global.env.SOCIALTRADING_APP_MAX_OUTGOING_PEERS,
global.env.SOCIALTRADING_APP_MAX_OUTGOING_START_PEERS,
thisObject.p2pNetworkInterface.eventReceived
)
}
Expand Down
22 changes: 11 additions & 11 deletions Environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ exports.newEnvironment = function () {
PLATFORM_WEB_SOCKETS_INTERFACE_PORT: 18041,
NETWORK_WEB_SOCKETS_INTERFACE_PORT: 18042,
DASHBOARDS_WEB_SOCKETS_INTERFACE_PORT: 18043,
SOCIALTRADE_WEB_SOCKETS_INTERFACE_PORT: 16041,
SOCIALTRADE_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
SOCIALTRADING_WEB_SOCKETS_INTERFACE_PORT: 16041,
SOCIALTRADING_WEB_SOCKETS_INTERFACE_HOST: 'localhost',
PLATFORM_HTTP_INTERFACE_PORT: 34248,
SOCIALTRADE_HTTP_INTERFACE_PORT: 33248,
SOCIALTRADING_HTTP_INTERFACE_PORT: 33248,
NETWORK_HTTP_INTERFACE_PORT: 31248,
PATH_TO_DATA_STORAGE: path.join(basePath, './Platform/My-Data-Storage'),
PATH_TO_PROJECTS: path.join(basePath, './Projects'),
Expand All @@ -32,19 +32,19 @@ exports.newEnvironment = function () {
PATH_TO_PROJECTS_REQUIRED: path.join(basePath, './Projects'),
PATH_TO_PROJECT_SCHEMA: path.join(basePath, './Projects/ProjectsSchema.json'),
PATH_TO_PLATFORM: path.join(basePath, './Platform'),
PATH_TO_SOCIALTRADE: './SocialTrade',
PATH_TO_SOCIALTRADING: './Social-Trading',
PATH_TO_DEFAULT_WORKSPACE: path.join(basePath, './Plugins/Foundations/Workspaces'),
PATH_TO_MY_WORKSPACES: path.join(basePath, './Platform/My-Workspaces'),
PATH_TO_SECRETS: path.join(basePath, './My-Secrets'),
PATH_TO_FONTS: path.join(basePath, './Platform/WebServer/Fonts'),
PATH_TO_BITCOIN_FACTORY: path.join(basePath, './Bitcoin-Factory'),
SOCIALTRADE_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1',
SOCIALTRADE_APP_MAX_OUTGOING_PEERS: 5,
SOCIALTRADE_APP_MAX_OUTGOING_START_PEERS: 1,
SOCIALTRADE_TARGET_NETWORK_TYPE: 'P2P Network',
SOCIALTRADE_TARGET_NETWORK_CODENAME: 'Testnet',
SOCIALTRADE_DEFAULT_SOCIAL_PERSONA: 'Social-Persona-1',
SOCIALTRADE_DEFAULT_SOCIAL_TRADING_BOT: 'Social-Trading-Bot-2',
SOCIALTRADING_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1',
SOCIALTRADING_APP_MAX_OUTGOING_PEERS: 5,
SOCIALTRADING_APP_MAX_OUTGOING_START_PEERS: 1,
SOCIALTRADING_TARGET_NETWORK_TYPE: 'P2P Network',
SOCIALTRADING_TARGET_NETWORK_CODENAME: 'Testnet',
SOCIALTRADING_DEFAULT_SOCIAL_PERSONA: 'Social-Persona-1',
SOCIALTRADING_DEFAULT_SOCIAL_TRADING_BOT: 'Social-Trading-Bot-2',
TASK_SERVER_APP_MAX_OUTGOING_PEERS: 1,
TASK_SERVER_APP_MAX_OUTGOING_START_PEERS: 1,
MOBILE_APP_SIGNING_ACCOUNT: 'Social-Trading-Mobile-App-1',
Expand Down
2 changes: 1 addition & 1 deletion Launch-Scripts/createShortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const createShortcut = () => {
let target = path.join( __dirname, "launch-windows.bat")
let icon = path.join( __dirname, "superalgos.ico")
let shortcutPaths = [
path.join(os.homedir(), "SocialTrade", `${name}.lnk`),
path.join(os.homedir(), "SocialTrading", `${name}.lnk`),
path.join(os.homedir(),
"AppData",
"Roaming",
Expand Down
6 changes: 3 additions & 3 deletions Launch-Scripts/runUninstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const uninstall = () => {

// Remove Windows Shortcuts
if (os.platform() == "win32") {
let desktop = path.join( os.homedir(), "SocialTrade", `${name}.lnk`)
let desktop = path.join( os.homedir(), "SocialTrading", `${name}.lnk`)
let startMenu = path.join( os.homedir(), "AppData", "Roaming", "Microsoft", "Windows", "Start Menu", "Programs", `${name}.lnk`)

// Remove .desktop files
Expand All @@ -37,7 +37,7 @@ const uninstall = () => {
if (version.includes("Ubuntu")) {

// Remove .desktop files
let command = `rm ~/SocialTrade/${name}.desktop & rm ~/.local/share/applications/${name}.desktop`
let command = `rm ~/SocialTrading/${name}.desktop & rm ~/.local/share/applications/${name}.desktop`
exec(command, (error) => {
if (error) {
console.log('')
Expand All @@ -59,7 +59,7 @@ const uninstall = () => {
} // Mac Shortcuts
if (os.platform() == "darwin") {
// Remove .desktop files
let command = `rm ~/SocialTrade/${name}.command`
let command = `rm ~/SocialTrading/${name}.command`
exec(command, (error) => {
if (error) {
console.log('')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ exports.newHttpInterface = function newHttpInterface() {
break
case 'Images': // This means the Images folder.
{
let path = global.env.PATH_TO_DESKTOP + '/WebServer/Images/' + requestPath[2]
let path = global.env.PATH_TO_SOCIALTRADING + '/WebServer/Images/' + requestPath[2]

if (requestPath[3] !== undefined) {
path = path + '/' + requestPath[3]
Expand All @@ -96,7 +96,7 @@ exports.newHttpInterface = function newHttpInterface() {
break
default:
{
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_DESKTOP)
SA.projects.foundations.utilities.httpResponses.respondWithWebFile(httpResponse, endpointOrFile, global.env.PATH_TO_SOCIALTRADING)
}
}
} catch (err) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ exports.newSocialTradingApp = function newSocialTradingApp() {
*/
thisObject.p2pNetworkClient = SA.projects.network.modules.p2pNetworkClient.newNetworkModulesP2PNetworkClient()
await thisObject.p2pNetworkClient.initialize(
global.env.SOCIALTRADE_APP_SIGNING_ACCOUNT,
global.env.SOCIALTRADE_TARGET_NETWORK_TYPE,
global.env.SOCIALTRADE_TARGET_NETWORK_CODENAME,
global.env.SOCIALTRADE_APP_MAX_OUTGOING_PEERS,
global.env.SOCIALTRADE_APP_MAX_OUTGOING_START_PEERS,
thisObject.p2pNetworkInterface.eventReceived,
[]
global.env.SOCIALTRADING_APP_SIGNING_ACCOUNT,
global.env.SOCIALTRADING_TARGET_NETWORK_TYPE,
global.env.SOCIALTRADING_TARGET_NETWORK_CODENAME,
global.env.SOCIALTRADING_APP_MAX_OUTGOING_PEERS,
global.env.SOCIALTRADING_APP_MAX_OUTGOING_START_PEERS,
thisObject.p2pNetworkInterface.eventReceived
)
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ function loadSuperalgos() {

function loadGlobals() {
let path = "Globals.js"
REQUIREJS([path], onRequired)
//REQUIREJS([path], onRequired)
requirejs([path], onRequired)

function onRequired(pModule) {
setupEnvironment()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions SocialTradeRoot.js → SocialTradingRoot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports.newSocialTradeRoot = function newSocialTradeRoot() {
exports.newSocialTradingRoot = function newSocialTradingRoot() {
/*
This module represents the execution root of the Desktop App.
We use this module that is outside the Desktop folder to
Expand Down Expand Up @@ -26,8 +26,8 @@ exports.newSocialTradeRoot = function newSocialTradeRoot() {
let ENVIRONMENT_MODULE = ENVIRONMENT.newEnvironment()
global.env = ENVIRONMENT_MODULE

if (debugSettings !== undefined && debugSettings.DESKTOP_APP_SIGNING_ACCOUNT !== undefined) {
global.env.DESKTOP_APP_SIGNING_ACCOUNT = debugSettings.DESKTOP_APP_SIGNING_ACCOUNT
if (debugSettings !== undefined && debugSettings.SOCIALTRADING_APP_SIGNING_ACCOUNT !== undefined) {
global.env.SOCIALTRADING_APP_SIGNING_ACCOUNT = debugSettings.SOCIALTRADING_APP_SIGNING_ACCOUNT
}
/*
First thing is to load the project schema file.
Expand Down Expand Up @@ -74,7 +74,7 @@ exports.newSocialTradeRoot = function newSocialTradeRoot() {
run()

async function run() {
ST.app = require('./SocialTrade/SocialTradeApp.js').newSocialTradingApp()
ST.app = require('./Social-Trading/SocialTradingApp.js').newSocialTradingApp()
await ST.app.run()
console.log('Superalgos Desktop App is Running!')
}
Expand Down
2 changes: 1 addition & 1 deletion desktop-app-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ defined at the Environment.js file.

let APP_ROOT = require('./DesktopRoot.js')
let APP_ROOT_MODULE = APP_ROOT.newDesktopRoot()
APP_ROOT_MODULE.run({DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1'})
APP_ROOT_MODULE.run({SOCIALTRADING_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-1'})
2 changes: 1 addition & 1 deletion desktop-app-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ defined at the Environment.js file.

let APP_ROOT = require('./DesktopRoot.js')
let APP_ROOT_MODULE = APP_ROOT.newDesktopRoot()
APP_ROOT_MODULE.run({DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-2'})
APP_ROOT_MODULE.run({SOCIALTRADING_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-2'})
2 changes: 1 addition & 1 deletion desktop-app-3.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ defined at the Environment.js file.

let APP_ROOT = require('./DesktopRoot.js')
let APP_ROOT_MODULE = APP_ROOT.newDesktopRoot()
APP_ROOT_MODULE.run({DESKTOP_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-3'})
APP_ROOT_MODULE.run({SOCIALTRADING_APP_SIGNING_ACCOUNT: 'Social-Trading-Desktop-App-3'})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dist": "electron-builder -c build/electron-builder.json",
"postinstall": "electron-builder install-app-deps",
"startNetwork": "node network",
"startSocialTrade": "node socialTrade",
"startSocialTrading": "node socialTrading",
"installDesktopReact": "cd ./DesktopReact && npm ci",
"startLocalDesktopReact": "start npm run startNetwork && cd ./DesktopReact && start npm run startDesktopReactBackend && start npm run startDesktopReactFrontend",
"startDesktopReact": "cd ./DesktopReact && start npm run startDesktopReactBackend && start npm run startDesktopReactFrontend",
Expand Down
16 changes: 0 additions & 16 deletions socialTrade.js

This file was deleted.

16 changes: 16 additions & 0 deletions socialTrading.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
The Superalgos Social Trade is one of the 3 clients of the Superalgos P2P Network:
* Superalgos Mobile
* Superalgos Social Trade
* Superalgos Server
Users can use any of these clients for their social trading activities.
This module represents the Nodejs command that users have to start the Social Trade App..
*/

let APP_ROOT = require('./SocialTradingRoot.js')
let APP_ROOT_MODULE = APP_ROOT.newSocialTradingRoot()
APP_ROOT_MODULE.run()

0 comments on commit 0825df3

Please sign in to comment.