Merge branch 'develop' of https://github.com/Superalgos/Superalgos into develop

This commit is contained in:
Smidy13 committed 2021-09-04 08:43:59 +12:00
commit 585bb001ba
115 files changed
+4445 -1942

No files matched your search

+61 -9
View File
@@ -6,21 +6,73 @@ exports.newDesktopApp = function newDesktopApp() {
return thisObject
function run() {
async function run() {
/*
let socialGraphService = NT.projects.network.modules.socialGraph.newSocialGraph()
await socialGraphService.initialize()
*/
/*
Let's start the Network Interfaces
*/
DK.webSocketsClient = SA.projects.network.modules.webSocketsClient.newNetworkModulesWebSocketsClient()
DK.webSocketsClient.initialize()
await DK.webSocketsClient.initialize()
return
start()
async function start() {
let socialGraphService = NT.projects.network.modules.socialGraph.newSocialGraph()
await socialGraphService.initialize()
let queryMessage
let query
/*
Test Query User Profiles.
*/
queryMessage = {
queryType: SA.projects.socialTrading.globals.queryTypes.USER_PROFILES,
emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID,
initialIndex: 'Last',
amountRequested: 10,
direction: 'Past'
}
query = {
requestType: 'Query',
queryMessage: JSON.stringify(queryMessage)
}
await DK.webSocketsClient.sendMessage(
JSON.stringify(query)
)
.then(showProfiles)
.catch(onError)
function showProfiles(profiles) {
console.log(profiles)
}
/*
Test Query User Profile Stats.
*/
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
}
query = {
requestType: 'Query',
queryMessage: JSON.stringify(queryMessage)
}
await DK.webSocketsClient.sendMessage(
JSON.stringify(query)
)
.then(showProfilesStats)
.catch(onError)
function showProfilesStats(profile) {
console.log(profile)
}
/*
Error Handling
*/
function onError(errorMessage) {
console.log('[ERROR] Query not executed. ' + errorMessage)
}
}
}
+16
View File
@@ -0,0 +1,16 @@
{
"files.exclude": {
"**/Data-Storage": true,
"**/Documentation": true,
"**/Log-Files": true,
"**/node_modules": true,
"**/Deprecated-Code": true
},
"search.exclude": {
"**/Data-Storage": true,
"**/Documentation": true,
"**/Log-Files": true,
"**/Deprecated-Code": true
},
"search.maintainFileSearchCache": true
}
@@ -1 +1 @@
{"type":"Data Mine","name":"Delta","config":"{\n \"codeName\": \"Delta\"\n}","project":"Foundations","sensorBots":[],"indicatorBots":[{"type":"Indicator Bot","name":"Relative Strenght Index - Wilder Method (RSI-W)","config":"{\n \"codeName\": \"RSI-W\"\n}","project":"Foundations","processes":[{"type":"Process Definition","name":"Multi-Time-Frame-Market","config":"{\n \"codeName\": \"Multi-Time-Frame-Market\",\n \"description\": \"Calculates Wilder RSI.\",\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 0,\n \"retryWaitTime\": 10000,\n \"sleepWaitTime\": 3600000,\n \"comaWaitTime\": 86400000,\n \"framework\": {\n \"name\": \"Multi-Time-Frame-Market\"\n }\n}","project":"Foundations","processOutput":{"type":"Process Output","name":"New Process Output","project":"Foundations","outputDatasets":[{"type":"Output Dataset","name":"Multi-Time-Frame-Market RSI-W14","project":"Foundations","id":"75881553-ec60-4954-9404-052ba11904f4","savedPayload":{"position":{"x":19646.18251638588,"y":17789.2053813897},"targetPosition":{"x":19675.299658959913,"y":17897.87203684722},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"a94722c3-a453-4f46-931f-aeb244e7cb66"}}}],"outputDatasetFolders":[],"id":"ffb59a7e-565a-4588-bd44-999a7cb66122","savedPayload":{"position":{"x":19675.299658959913,"y":17897.87203684722},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","project":"Foundations","statusDependencies":[{"type":"Status Dependency","name":"Candles Volumes Multi-Time-Frame-Market","config":"{\n \"mainUtility\": \"Market Ending Point\"\n}","project":"Foundations","id":"b0af9801-ba4e-4bfd-a605-98d9ac121b5f","savedPayload":{"position":{"x":19650.151086682014,"y":17594.3496655382},"targetPosition":{"x":19762.651086682014,"y":17789.2053813897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"a0a61ba9-91cb-4ec7-92fe-134ff079de2d"}}},{"type":"Status Dependency","name":"Relative Strenght Index - Wilder Method (RSI-W) Multi-Time-Frame-Market","config":"{\n \"mainUtility\": \"Self Reference\"\n}","project":"Foundations","id":"02d64b4a-7c3c-4c89-918d-b3697b5955b2","savedPayload":{"position":{"x":19820.88537183008,"y":17571.87207047466},"targetPosition":{"x":19762.651086682014,"y":17789.2053813897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"2b961dac-9f41-4eed-a495-4e55f26714c3"}}}],"dataDependencies":[{"type":"Data Dependency","name":"Candles Multi-Time-Frame-Market","project":"Foundations","id":"25315413-2e01-4a7d-83bc-1257d43f8fe6","savedPayload":{"position":{"x":19957.506802533513,"y":17676.7053813897},"targetPosition":{"x":19762.651086682014,"y":17789.2053813897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"2b03494a-67d6-47f1-89b6-53fc4c9116a8"}}}],"dataMineDataDependencies":[],"id":"b14516a1-e5cc-48f8-ab0f-0e46faf6c41c","savedPayload":{"position":{"x":19762.651086682014,"y":17789.2053813897},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","project":"Foundations","id":"2b961dac-9f41-4eed-a495-4e55f26714c3","savedPayload":{"position":{"x":19863.51582730092,"y":17847.439666537768},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"Candles Volumes Multi-Time-Frame-Market","project":"Foundations","id":"c1598823-e0b3-4036-8ad6-669ae0e3f638","savedPayload":{"position":{"x":19921.750112448986,"y":17948.304407156673},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Execution FinisheLine truncated
{"type":"Data Mine","name":"Delta","config":"{\n \"codeName\": \"Delta\"\n}","project":"Foundations","sensorBots":[],"indicatorBots":[{"type":"Indicator Bot","name":"Relative Strength Index - Wilder Method (RSI-W)","config":"{\n \"codeName\": \"RSI-W\"\n}","project":"Foundations","processes":[{"type":"Process Definition","name":"Multi-Time-Frame-Market","config":"{\n \"codeName\": \"Multi-Time-Frame-Market\",\n \"description\": \"Calculates Wilder RSI.\",\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 0,\n \"retryWaitTime\": 10000,\n \"sleepWaitTime\": 3600000,\n \"comaWaitTime\": 86400000,\n \"framework\": {\n \"name\": \"Multi-Time-Frame-Market\"\n }\n}","project":"Foundations","processOutput":{"type":"Process Output","name":"New Process Output","project":"Foundations","outputDatasets":[{"type":"Output Dataset","name":"Multi-Time-Frame-Market RSI-W14","project":"Foundations","id":"75881553-ec60-4954-9404-052ba11904f4","savedPayload":{"position":{"x":19646.18251638588,"y":17789.2053813897},"targetPosition":{"x":19675.299658959913,"y":17897.87203684722},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"a94722c3-a453-4f46-931f-aeb244e7cb66"}}}],"outputDatasetFolders":[],"id":"ffb59a7e-565a-4588-bd44-999a7cb66122","savedPayload":{"position":{"x":19675.299658959913,"y":17897.87203684722},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":1,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","project":"Foundations","statusDependencies":[{"type":"Status Dependency","name":"Candles Volumes Multi-Time-Frame-Market","config":"{\n \"mainUtility\": \"Market Ending Point\"\n}","project":"Foundations","id":"b0af9801-ba4e-4bfd-a605-98d9ac121b5f","savedPayload":{"position":{"x":19650.151086682014,"y":17594.3496655382},"targetPosition":{"x":19762.651086682014,"y":17789.2053813897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"a0a61ba9-91cb-4ec7-92fe-134ff079de2d"}}},{"type":"Status Dependency","name":"Relative Strength Index - Wilder Method (RSI-W) Multi-Time-Frame-Market","config":"{\n \"mainUtility\": \"Self Reference\"\n}","project":"Foundations","id":"02d64b4a-7c3c-4c89-918d-b3697b5955b2","savedPayload":{"position":{"x":19820.88537183008,"y":17571.87207047466},"targetPosition":{"x":19762.651086682014,"y":17789.2053813897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"2b961dac-9f41-4eed-a495-4e55f26714c3"}}}],"dataDependencies":[{"type":"Data Dependency","name":"Candles Multi-Time-Frame-Market","project":"Foundations","id":"25315413-2e01-4a7d-83bc-1257d43f8fe6","savedPayload":{"position":{"x":19957.506802533513,"y":17676.7053813897},"targetPosition":{"x":19762.651086682014,"y":17789.2053813897},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"2b03494a-67d6-47f1-89b6-53fc4c9116a8"}}}],"dataMineDataDependencies":[],"id":"b14516a1-e5cc-48f8-ab0f-0e46faf6c41c","savedPayload":{"position":{"x":19762.651086682014,"y":17789.2053813897},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"statusReport":{"type":"Status Report","name":"New Status Report","project":"Foundations","id":"2b961dac-9f41-4eed-a495-4e55f26714c3","savedPayload":{"position":{"x":19863.51582730092,"y":17847.439666537768},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{}}},"executionStartedEvent":{"type":"Execution Started Event","name":"Candles Volumes Multi-Time-Frame-Market","project":"Foundations","id":"c1598823-e0b3-4036-8ad6-669ae0e3f638","savedPayload":{"position":{"x":19921.750112448986,"y":17948.304407156673},"targetPosition":{"x":19704.416801533946,"y":18006.53869230474},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Execution FinisheLine truncated
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,251 @@
{
"type": "Tutorial",
"name": "Governance Program Walk Through Tutorial",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\financial-programs\",\n \"project\": \"Governance\"\n },\n \"position\": \"Center\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - Into the Thick of It\"\n },\n \"controlDocs\": {\n \"panel\": \"\",\n \"closeTutorialEditor\": false,\n \"page\": {\n \"project\": \"Foundations\",\n \"category\": \"\",\n \"type\": \"\"\n }\n }\n}",
"project": "Education",
"tutorialSteps": [
{
"type": "Tutorial Step",
"name": "Refer a Friend",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\referral-program\",\n \"project\": \"Governance\"\n },\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - Refer a Friend\"\n },\n \"controlDocs\": {\n \"panel\": \"Open\",\n \"closeTutorialEditor\": true,\n \"page\": {\n \"project\": \"Governance\",\n \"category\": \"Topic\",\n \"type\": \"Referral Program Overview\"\n }\n }\n}",
"project": "Education",
"id": "a3df7ac4-69e0-41b9-af1c-fd0087d26161",
"savedPayload": {
"position": {
"x": 21016,
"y": 30930.750000000004
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Reset"
}
}
},
{
"type": "Tutorial Step",
"name": "A Thank You for Support",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\support-program\",\n \"project\": \"Governance\"\n },\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - A Thank You for Support\"\n },\n \"controlDocs\": {\n \"panel\": \"Open\",\n \"closeTutorialEditor\": true,\n \"page\": {\n \"project\": \"Governance\",\n \"category\": \"Topic\",\n \"type\": \"Support Program Overview\"\n }\n }\n}",
"project": "Education",
"id": "dc20ebdc-6708-4fed-a75b-bade62d3ce0c",
"savedPayload": {
"position": {
"x": 20903.04694055762,
"y": 31165.299444740413
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Reset"
}
}
},
{
"type": "Tutorial Step",
"name": "Find a Mentor",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\mentorship-program\",\n \"project\": \"Governance\"\n },\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - Find a Mentor\"\n },\n \"controlDocs\": {\n \"panel\": \"Open\",\n \"closeTutorialEditor\": true,\n \"page\": {\n \"project\": \"Governance\",\n \"category\": \"Topic\",\n \"type\": \"Mentorship Program Overview\"\n }\n }\n}",
"project": "Education",
"id": "258b83f3-200d-41d7-8288-81eec5da0ccf",
"savedPayload": {
"position": {
"x": 20649.243719813105,
"y": 31223.22837365455
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Reset"
}
}
},
{
"type": "Tutorial Step",
"name": "Claim some Contributions",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\claims-program\",\n \"project\": \"Governance\"\n },\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - Claim some Contributions\"\n },\n \"controlDocs\": {\n \"panel\": \"Open\",\n \"closeTutorialEditor\": true,\n \"page\": {\n \"project\": \"Governance\",\n \"category\": \"Topic\",\n \"type\": \"Contribution Claims Program Overview\"\n }\n }\n}",
"project": "Education",
"id": "7301eace-be0a-45f8-9f8d-14afb7e9336a",
"savedPayload": {
"position": {
"x": 20445.709339629273,
"y": 31060.91512173527
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Reset"
}
}
},
{
"type": "Tutorial Step",
"name": "Lend a Vote",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\voting-program\",\n \"project\": \"Governance\"\n },\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - Lend a Vote\"\n },\n \"controlDocs\": {\n \"panel\": \"Open\",\n \"closeTutorialEditor\": true,\n \"page\": {\n \"project\": \"Governance\",\n \"category\": \"Topic\",\n \"type\": \"Voting Program Overview\"\n }\n }\n}",
"project": "Education",
"id": "61b34c29-85ce-4b86-8a77-21f8e8888c35",
"savedPayload": {
"position": {
"x": 20445.709339629273,
"y": 30800.584878264737
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Reset"
}
}
},
{
"type": "Tutorial Step",
"name": "Delegate some Power",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\delegation-program\",\n \"project\": \"Governance\"\n },\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - Delegate some Power\"\n },\n \"controlDocs\": {\n \"panel\": \"Open\",\n \"closeTutorialEditor\": true,\n \"page\": {\n \"project\": \"Governance\",\n \"category\": \"Topic\",\n \"type\": \"Delegation Program Overview\"\n }\n }\n}",
"project": "Education",
"id": "bb0b161f-af82-4b93-87a8-30ae6ace533c",
"savedPayload": {
"position": {
"x": 20649.243719813105,
"y": 30638.271626345457
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Reset"
}
}
},
{
"type": "Tutorial Step",
"name": "Stake some Tokens",
"config": "{\n \"icon\": {\n \"name\": \"Programs\\\\staking-program\",\n \"project\": \"Governance\"\n },\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"pressButton\": \"\",\n \"docs\": {\n \"project\": \"Governance\",\n \"category\": \"Tutorial\",\n \"type\": \"Tutorial Step - Stake some Tokens\"\n },\n \"controlDocs\": {\n \"panel\": \"Open\",\n \"closeTutorialEditor\": true,\n \"page\": {\n \"project\": \"Governance\",\n \"category\": \"Topic\",\n \"type\": \"Staking Program Overview\"\n }\n }\n}",
"project": "Education",
"id": "507fc893-7a06-4bba-ba23-fb7125aa2017",
"savedPayload": {
"position": {
"x": 20903.04694055762,
"y": 30696.200555259595
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Reset"
}
}
}
],
"tutorialTopics": [],
"id": "eb85fbbd-080f-41c6-91a8-c6b68195a74b",
"savedPayload": {
"position": {
"x": 20716,
"y": 30930.750000000004
},
"targetPosition": {
"x": 20716,
"y": 30930.750000000004
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 1
},
"uiObject": {
"isRunning": false
},
"tutorial": {
"status": "Done"
}
}
}
@@ -64,7 +64,7 @@
},
{
"style": "Text",
"text": "Data Mines are created by power users and contributed to the project (the ones shipping with the software). Users might create Data Mines for their personal use and never share them. However, if they share them, they receive SA tokens for that, and also for adapting and mantaining them, if necessary, for each new release."
"text": "Data Mines are created by power users and contributed to the project (the ones shipping with the software). Users might create Data Mines for their personal use and never share them. However, if they share them, they receive SA Tokens for that, and also for adapting and mantaining them, if necessary, for each new release."
},
{
"style": "Title",
@@ -265,7 +265,7 @@
},
{
"style": "List",
"text": "Step #30: Once you have successfully mapped the whole API and you have all the needed API Data Fetchers, Indicator Bots and Plotters tested, you are ready to share your API Map and Data Mine with the community as a plugin, and receive SA tokens in exchange for your contribution.",
"text": "Step #30: Once you have successfully mapped the whole API and you have all the needed API Data Fetchers, Indicator Bots and Plotters tested, you are ready to share your API Map and Data Mine with the community as a plugin, and receive SA Tokens in exchange for your contribution.",
"updated": 1622233875203
},
{
@@ -3,14 +3,14 @@
"pageNumber": "3",
"type": "Develop",
"definition": {
"text": "The Develop branch is the branch that is being used by developers involved in contributing to Superalgos. All the changes at this branch are sent to the Master branch everytime there is a new release. The Develop branch purpose is for accumulating changes at the codebase untiil the release date when all these changes are moved into the Master branch.",
"updated": 1622467883706
"text": "The Develop branch is the branch developers use to contribute to the codebase. Changes at this branch are merged into the Master branch upon each release or service pack. The purpose of the Develop branch is to accumulate changes at the codebase until the release date when changes are ready for merging.",
"updated": 1630657066558
},
"paragraphs": [
{
"style": "Text",
"text": "Contributors working at this branch coordinate their here:",
"updated": 1622468223194
"text": "Contributors working at this branch Hang out in the Telegram Develop Group.",
"updated": 1630657099841
},
{
"style": "Link",
@@ -3,7 +3,7 @@
"pageNumber": 1,
"type": "Sparta By @julian-molina",
"definition": {
"text": "The set of indicators built in the Sparta data mine include Simple Moving Average (SMA), Exponential Moving Averege (EMA), Relative Strenght Index (RSI), and Moving Average convergence Divergence (MACD).",
"text": "The set of indicators built in the Sparta data mine include Simple Moving Average (SMA), Exponential Moving Averege (EMA), Relative Strength Index (RSI), and Moving Average convergence Divergence (MACD).",
"updated": 1611685345604
},
"paragraphs": [
@@ -22,4 +22,4 @@
"text": "Collaborate with this data mine and report issues directly at the Superalgos repository."
}
]
}
}
@@ -1,9 +1,9 @@
{
"topic": "Sparta Data Mine",
"pageNumber": 4,
"type": "Relative Strenght Index (RSI) - Sparta Indicator",
"type": "Relative Strength Index (RSI) - Sparta Indicator",
"definition": {
"text": "The indicator produces the standard 14 setting of the Relative Strenght Index.",
"text": "The indicator produces the standard 14 setting of the Relative Strength Index.",
"updated": 1611662214310
},
"paragraphs": [
@@ -59,4 +59,4 @@
"text": "How’s the trend going at the 24-hours chart?"
}
]
}
}
@@ -24,7 +24,7 @@
host = 'localhost'
}
if (port === undefined) {
port = global.env.WEB_SOCKETS_INTERFACE_PORT
port = global.env.CLIENT_WEB_SOCKETS_INTERFACE_PORT
}
let messageCounter = 0
@@ -186,7 +186,9 @@ function newFoundationsChartingSpace() {
}
function resize() {
thisObject.viewport.resize()
if (thisObject.viewport !== undefined) {
thisObject.viewport.resize()
}
thisObject.container.frame.width = browserCanvas.width
thisObject.container.frame.height = COCKPIT_SPACE_POSITION
}
@@ -356,7 +356,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -1670,7 +1670,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -308,7 +308,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -807,7 +807,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -1,7 +1,7 @@
{
"type": "Pools",
"name": "Superalgos",
"config": "{\n \"tokens\": \"66000000\",\n \"codeName\": \"Superalgos\"\n}",
"config": "{\"tokens\":\"66000000\",\"codeName\":\"Superalgos\"}",
"project": "Governance",
"poolClasses": [
{
@@ -792,7 +792,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 2,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -817,7 +817,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -1740,14 +1740,12 @@
"referenceParent": {
"type": "Features",
"name": "Superalgos",
"id": "1d2c1985-c762-4ece-b350-15bd893bd1f4"
"id": "7c27de79-0ac7-4d48-81f0-5d7b6a4d93c6"
},
"referenceParentCombinedNodePath": [
[
"Superalgos",
"Features",
"Governance",
"1d2c1985-c762-4ece-b350-15bd893bd1f4"
"Features"
]
]
}
@@ -1816,7 +1814,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -170,7 +170,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -324,7 +324,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -0,0 +1,84 @@
{
"type": "User Profile",
"name": "Dummy",
"config": "{\"signature\":{\"message\":\"Dummy\",\"messageHash\":\"0x02896cc66d7707014218bb1765cc0c2d97ff890c3078f973a365ea0b3cc5bdcf\",\"v\":\"0x1c\",\"r\":\"0xd6e1c99e2fc5c83f17abf2372ef3b85b242b659ead4725ed036c4b4607ba1f60\",\"s\":\"0x226266f27b546c894dc7e5f7ca95c3580156f5d178073479ebfa8f18a2452707\",\"signature\":\"0xd6e1c99e2fc5c83f17abf2372ef3b85b242b659ead4725ed036c4b4607ba1f60226266f27b546c894dc7e5f7ca95c3580156f5d178073479ebfa8f18a24527071c\"},\"codeName\":\"Dummy\"}",
"project": "Governance",
"tokenPowerSwitch": {
"type": "Token Power Switch",
"name": "New Token Power Switch",
"config": "{}",
"project": "Governance",
"tokenPowerSwitch": [],
"id": "da7974b8-2894-4723-8c99-f8d9725efde3",
"savedPayload": {
"position": {
"x": 14265,
"y": 10794.5
},
"targetPosition": {
"x": 13965,
"y": 10794.5
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
},
"tokensMined": {
"type": "Tokens Mined",
"name": "New Tokens Mined",
"project": "Governance",
"id": "9ed9c490-7dd6-497a-8ed0-5ddd6ea8dbee",
"savedPayload": {
"position": {
"x": 13665,
"y": 10794.5
},
"targetPosition": {
"x": 13965,
"y": 10794.5
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
},
"id": "7f24cabd-729b-4fe5-9258-cbfa779ba03e",
"savedPayload": {
"position": {
"x": 30000,
"y": 21251
},
"targetPosition": {
"x": 30000,
"y": 21251
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
}
@@ -0,0 +1,84 @@
{
"type": "User Profile",
"name": "Test-Network-Client-Profile",
"config": "{\"signature\":{\"message\":\"Test-Network-Client-Profile\",\"messageHash\":\"0xd768f828a837f3fa0c3e9bb8090820c415ff08be93cad759a53bc2115487c5d7\",\"v\":\"0x1c\",\"r\":\"0x1401b80eec441aa9789580848e0179f36485acab9562fe184bca5e2fd9e77887\",\"s\":\"0x06400cef3453437805fb9b086c246d7def27a146ed975450edf7dcc46795a57d\",\"signature\":\"0x1401b80eec441aa9789580848e0179f36485acab9562fe184bca5e2fd9e7788706400cef3453437805fb9b086c246d7def27a146ed975450edf7dcc46795a57d1c\"},\"codeName\":\"Test-Network-Client-Profile\"}",
"project": "Governance",
"tokenPowerSwitch": {
"type": "Token Power Switch",
"name": "New Token Power Switch",
"config": "{}",
"project": "Governance",
"tokenPowerSwitch": [],
"id": "c2a1f8b1-0eb3-457a-9508-2e0c813ced37",
"savedPayload": {
"position": {
"x": 14303,
"y": 11452.5
},
"targetPosition": {
"x": 14003,
"y": 11452.5
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
},
"tokensMined": {
"type": "Tokens Mined",
"name": "New Tokens Mined",
"project": "Governance",
"id": "e796be1b-7d10-47f1-8b1a-4d7ce962a113",
"savedPayload": {
"position": {
"x": 13703,
"y": 11452.5
},
"targetPosition": {
"x": 14003,
"y": 11452.5
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
},
"id": "baa2f02c-2920-4edb-a103-d452fc61d82f",
"savedPayload": {
"position": {
"x": 20588.235294117643,
"y": 18250
},
"targetPosition": {
"x": 20588.235294117643,
"y": 18250
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
}
@@ -0,0 +1,84 @@
{
"type": "User Profile",
"name": "Test-Network-Node-Profile",
"config": "{\"signature\":{\"message\":\"Test-Network-Node-Profile\",\"messageHash\":\"0xa05026b7c6c2a2375480d5d24949621749cc48e461e6e80278a9ef1b6dc7c5f1\",\"v\":\"0x1c\",\"r\":\"0x8f28f992b0074e4d50007cdfbf18980ca58b4969e04a54d06e4d4798bb982c9a\",\"s\":\"0x1c11951a92a1beffe8f3ddd06426ebe1b89875b56d5e374426100d5f59245ea3\",\"signature\":\"0x8f28f992b0074e4d50007cdfbf18980ca58b4969e04a54d06e4d4798bb982c9a1c11951a92a1beffe8f3ddd06426ebe1b89875b56d5e374426100d5f59245ea31c\"},\"codeName\":\"Test-Network-Node-Profile\"}",
"project": "Governance",
"tokenPowerSwitch": {
"type": "Token Power Switch",
"name": "New Token Power Switch",
"config": "{}",
"project": "Governance",
"tokenPowerSwitch": [],
"id": "11f69cbe-00c8-4fac-9fcc-701a7600c92c",
"savedPayload": {
"position": {
"x": 14327,
"y": 11862
},
"targetPosition": {
"x": 14027,
"y": 11862
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
},
"tokensMined": {
"type": "Tokens Mined",
"name": "New Tokens Mined",
"project": "Governance",
"id": "501f456f-b4b5-4b7e-9118-0f26215dd20e",
"savedPayload": {
"position": {
"x": 13727,
"y": 11862
},
"targetPosition": {
"x": 14027,
"y": 11862
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
},
"id": "36c2b050-631f-4291-987c-418adc94317d",
"savedPayload": {
"position": {
"x": 17647.05882352941,
"y": 21251
},
"targetPosition": {
"x": 17647.05882352941,
"y": 21251
},
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": true,
"angleToParent": 1,
"distanceToParent": 3,
"arrangementStyle": 0
},
"uiObject": {
"isRunning": false
}
}
}
File diff suppressed because it is too large. Load diff
@@ -22,8 +22,17 @@
},
{
"style": "Chapter",
"text": "IV->Governance->Topic->Governance Flow->The Superalgos Governance Project implements a meritocratic system, by which the more you contribute, the more you are entitled to influence the direction of development. ",
"updated": 1624782801597
"text": "IV->Governance->Topic->Governance Flow->The Superalgos Governance Project implements a meritocratic system, by which the more you contribute, the more you are entitled to influence the direction of development.",
"updated": 1630576718872
},
{
"style": "Chapter",
"text": "V->Governance->Topic->Governance Workspaces->The Governance Project features multiple Project Definition Hierarchies spread across multiple Plugin Workspaces — one Workspace per Project — to facilitate the granular management of definitions by independent teams of maintainers. These are the Governance Workspaces.",
"updated": 1630576758374
},
{
"style": "Chapter",
"text": "VI->Governance->Topic->Governance How To->A collection of tips and tricks that will make your life easier while participating in governance."
}
]
}
@@ -1,8 +1,8 @@
{
"type": "Distribution Event",
"definition": {
"text": "The Superalgos Project distributes its native Superalgos SA Tokens after each release to compensate contributions and incentivize desirable behaviors. The Distribution Event represents the moment in time and the act of running the process that distributes tokens from the Treasury Account to the Governance Address associated with each User Profile that participates in governance.",
"updated": 1630234849482
"text": "The Superalgos Project distributes its native Superalgos SA Tokens after each release to reward contributions and incentivize desirable behaviors. The Distribution Event represents the moment in time and the act of running the process that distributes tokens from the Treasury Account to the Governance Address associated with each User Profile that participates in governance.",
"updated": 1630570602251
},
"paragraphs": [
{
@@ -9,27 +9,71 @@
"style": "Title",
"text": "Computational Limitations"
},
{
"style": "Block",
"text": "Computational Limitations"
},
{
"style": "Title",
"text": ""
},
{
"style": "Note",
"style": "Block",
"text": "Computational Limitations",
"updated": 1630569942063
},
{
"style": "Text",
"text": "The governance system does all calculations dynamically, in real-time, with every change in the definitions, and computes all the hierarchies loaded in the Current Workspace."
},
{
"style": "Important",
"text": "The above means that the calculations that you see from within any given Workspace is a partial calculation within the scope of the Current Workspace only. Definitions, claims, votes, and so on, existing on other workspaces or plugins are not computed."
},
{
"style": "Block",
"text": "Computational Limitations 2",
"updated": 1630569818098
},
{
"style": "Text",
"text": "If you cast votes or place claims in more than one Governance Workspace, you will not be able to see what some of your claims and votes are about — in particular, those that live on a workspace that is not the Current Workspace.",
"updated": 1630569998640
},
{
"style": "Text",
"text": "If you wish to have a clearer picture of all your votes and claims, you may want to set up a new workspace that includes all the hierarchies that you need to interact with. That way, you will be able to see all of your votes and claims at the same time. To do this, save a new workspace deriving from one of the Governance Workspaces and load the plugins you need.",
"updated": 1630570350637
},
{
"style": "Note",
"text": "Even if you do as suggested above, the calculations you see in terms of Token Rewards, Tokens Awarded, Tokens Bonus, and so on, are still partial. The actual Distribution Event calculation involves computing all of the Project Definition Hierarchies, including all User Profile hierarchies participating in governance.",
"updated": 1630570663757
},
{
"style": "Text",
"text": ""
},
{
"style": "Block",
"text": "Dummy",
"updated": 1630230740442
},
{
"style": "Title",
"text": "Deep in Governance",
"updated": 1630574167914
},
{
"style": "Block",
"text": "Deep in Governance"
},
{
"style": "Success",
"text": "If you have contributed work or wish to go deep with your participation in governance, you will most likely need to interact with one or more of the project-specific Governance Workspaces. To do that, load your User Profile into the corresponding workspaces so that you may establish references to place Contribution Claims and cast Weight Votes.",
"updated": 1630574190576
},
{
"style": "Block",
"text": "Dummy",
"updated": 1630574197424
},
{
"style": "Title",
"text": "Featuring Tokens Bonus"
@@ -12,7 +12,7 @@
},
{
"style": "Text",
"text": "Because this is the highest level definition of how tokens will be distributed, the Superalgos Pools hierarchy is present in all Governance Plugin Workspaces.",
"text": "Because this is the highest level definition of how tokens will be distributed, the Superalgos Pools hierarchy is present in all Governance Workspaces.",
"updated": 1630426648511
},
{
@@ -14,6 +14,18 @@
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Claim Votes Content"
},
{
"style": "Subtitle",
"text": "Working on Multiple Workspaces"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Deep in Governance"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations 2"
},
{
"style": "Block",
"text": "Configuration"
@@ -14,6 +14,18 @@
"style": "Include",
"text": "Governance->Concept->Weight Votes->Content"
},
{
"style": "Subtitle",
"text": "Working on Multiple Workspaces"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Deep in Governance"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations 2"
},
{
"style": "Block",
"text": "Configuration"
@@ -39,10 +39,20 @@
"text": "Your Incoming Power is added to your Own Power in the corresponding program, so that you may pass on more power to other User Profiles. Like in the reverse case, when you reference other User Profiles, you pass on 10% of the power that reaches the node establishing the reference.",
"updated": 1630166856996
},
{
"style": "Important",
"text": "This passing of 10% of the power from one user to the next has the effect of rewarding collaboration chains. ",
"updated": 1630683048349
},
{
"style": "Callout",
"text": "This passing of 10% of the power from one user to the next has the effect of rewarding collaboration chains. For instance, Alice tells her friend Bob about Superalgos. When Bob eventually sets up his User Profile, he declares Alice as his referrer. This means that Alice gets 10% of the Referral Power that Bob drives to his User Referrer node. Then, Bob brings his friend Charly to Superalgos. Charly sets up his profile and declares Bob as his referrer. So now Bob gets 10% of the Referral Power that Charly drives to his User Referrer node. Can you see what happens with Alice's Incoming Referral Power? That's it! She gets 10% of Bob's power, which includes 10% of Charly's power!",
"updated": 1630167091644
"text": "For instance, Alice tells her friend Bob about Superalgos. When Bob eventually sets up his User Profile, he declares Alice as his referrer. This means that Alice gets 10% of the Referral Power that Bob drives to his User Referrer node. Then, Bob brings his friend Charly to Superalgos. Charly sets up his profile and declares Bob as his referrer. So now Bob gets 10% of the Referral Power that Charly drives to his User Referrer node. ",
"updated": 1630683087674
},
{
"style": "Success",
"text": "Can you see what happens with Alice's Incoming Referral Power? That's it! She gets 10% of Bob's power, which includes 10% of Charly's power and son on!",
"updated": 1630683111245
},
{
"style": "Note",
@@ -50,13 +60,13 @@
},
{
"style": "Text",
"text": "The Incoming Power you get from other users is in a Direct Proportion to the number of tokens you get from the corresponding program Rewards Pool. The calculation is based on a Rule of Three, and the result is displayed under the Tokens Bonus node of the corresponding program.",
"updated": 1630170674503
"text": "The Incoming Power you get from other users is in a Direct Proportion to the number of tokens you get from the corresponding program Rewards Pool. The calculation is based on a Rule of Three, and the result is displayed under the Tokens Awarded node of the corresponding program.",
"updated": 1630682945130
},
{
"style": "Json",
"text": "Total Incoming Power [*] -> 100% of the pool\n Your Incoming Power [**] -> X% of the pool -> Tokens Rewards\n\nTokens Rewards = Your Incoming Power * 100% / Total Incoming Power\n\n[*] The sum of all Incoming Power (in the given program) in all User Profiles combined.\n[**] Your Incoming Power (in the given program).",
"updated": 1630215178623
"text": "Total Incoming Power [*] -> 100% of the pool\n Your Incoming Power [**] -> X% of the pool -> Tokens Awarded\n\nTokens Awarded = Your Incoming Power * 100% / Total Incoming Power\n\n[*] The sum of all Incoming Power (in the given program) in all User Profiles combined.\n[**] Your Incoming Power (in the given program).",
"updated": 1630683009510
},
{
"style": "Block",
@@ -0,0 +1,12 @@
{
"type": "community-buidling-programs",
"definition": {
"text": "Write the definition for this Node."
},
"paragraphs": [
{
"style": "Text",
"text": "Right click and select the pencil button to enter edit mode."
}
]
}
@@ -0,0 +1,12 @@
{
"type": "community-building-programs",
"definition": {
"text": "Write the definition for this Node."
},
"paragraphs": [
{
"style": "Text",
"text": "Right click and select the pencil button to enter edit mode."
}
]
}
@@ -14,6 +14,26 @@
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Claim Votes Content"
},
{
"style": "Subtitle",
"text": "Working on Multiple Workspaces"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Deep in Governance"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations 2"
},
{
"style": "Subtitle",
"text": ""
},
{
"style": "Text",
"text": ""
},
{
"style": "Block",
"text": "Configuration"
@@ -14,6 +14,18 @@
"style": "Include",
"text": "Governance->Concept->Weight Votes->Content"
},
{
"style": "Subtitle",
"text": "Working on Multiple Workspaces"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Deep in Governance"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations 2"
},
{
"style": "Block",
"text": "Configuration"
@@ -29,7 +29,7 @@
},
{
"style": "Text",
"text": "In addition, there is a third resource characteristic to the Pool Hierarchy. Each Pool may reference a separate Pools hierarchy so that the definitions may continue on a separate hierarchy, which may be included as a plugin in the same or in separate Governance Plugin Workspaces.",
"text": "In addition, there is a third resource characteristic to the Pool Hierarchy. Each Pool may reference a separate Pools hierarchy so that the definitions may continue on a separate hierarchy, which may be included as a plugin in the same or in separate Governance Workspaces.",
"updated": 1630426515819
},
{
@@ -15,6 +15,18 @@
"text": "Governance->Concept->Reusable Governance Snippets->Claim Votes Content",
"updated": 1630350813522
},
{
"style": "Subtitle",
"text": "Working on Multiple Workspaces"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Deep in Governance"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations 2"
},
{
"style": "Block",
"text": "Configuration"
@@ -14,6 +14,18 @@
"style": "Include",
"text": "Governance->Concept->Weight Votes->Content"
},
{
"style": "Subtitle",
"text": "Working on Multiple Workspaces"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Deep in Governance"
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations 2"
},
{
"style": "Block",
"text": "Configuration"
@@ -0,0 +1,66 @@
{
"topic": "Governance How To",
"pageNumber": "1",
"type": "Load a User Profile",
"definition": {
"text": "Use this guide if you ever wish to load a User Profile into any of the Governance Workspaces.",
"updated": 1630681599427
},
"paragraphs": [
{
"style": "Text",
"text": "Let's say you wish to declare your referrer in the Referral Program, or maybe you wish to support the Contribution Claims of a fellow developer. ",
"updated": 1630681643918
},
{
"style": "Callout",
"text": "In either case, you will need to load the User Profile of the person in question so that you may establish the appropriate references."
},
{
"style": "Note",
"text": "Or maybe you wish to load your own User Profile in one of the Other Governance Workspaces. It's the same process after all!",
"updated": 1630677919945
},
{
"style": "Title",
"text": "Start Here!",
"updated": 1630597272606
},
{
"style": "List",
"text": "Find out the person's User Profile name. If you know the person's identity on Github.com, then that's all you need to know. If you don't, then you may need to contact the person and ask! If it's your profile, then no need to do much in this regard!",
"updated": 1630681681124
},
{
"style": "List",
"text": "Verify that a file with the same name exists in the following path within the Superalgos folder in your hard drive...",
"updated": 1630597624699
},
{
"style": "Json",
"text": "/Projects/Governance/Plugins/User-Profiles/"
},
{
"style": "List",
"text": "If the file doesn't exist, make sure you have the latest version of the app. If it's still missing after updating, let the person know and wait for the profile to be submitted.",
"updated": 1630597643975
},
{
"style": "List",
"text": "If the file is there and assuming you already are in the workspace you wish to work with, go to the Plugins hierarchy and find the Dummy Plugin File under Plugin User Profiles > Governance Plugin Project.",
"updated": 1630597669225
},
{
"style": "List",
"text": "Access the configuration of the Dummy profile and change the fileName property using the appropriate name (Github.com username). Replace the name of the node too, to avoid confusion later on."
},
{
"style": "List",
"text": "Save the Current Workspace with Ctrl + Alt + Shift + Key-S and refresh the page."
},
{
"style": "List",
"text": "Once the page reloads, you should see the new profile along with the rest! That's it!"
}
]
}
@@ -0,0 +1,85 @@
{
"topic": "Governance Workspaces",
"pageNumber": "1",
"type": "Governance Workspaces",
"definition": {
"text": "The Governance Project features multiple Project Definition Hierarchies spread across multiple Plugin Workspaces — one Workspace per Project — to facilitate the granular management of definitions by independent teams of maintainers. These are the Governance Workspaces.",
"updated": 1630567756861
},
"paragraphs": [
{
"style": "Title",
"text": "Main Governance Workspace",
"updated": 1630568120363
},
{
"style": "Text",
"text": "The Token Distribution Superalgos Governance Workspace is the main workspace. Load this workspace to start your interaction with governance. This is where you would usually build and set up your User Profile.",
"updated": 1630568963531
},
{
"style": "Title",
"text": "Naming Convention"
},
{
"style": "Text",
"text": "All Governance Workspaces follow a similar naming structure, to make them easy to spot in the Workspaces Tab:"
},
{
"style": "Json",
"text": "Token Distribution XXX Project",
"updated": 1630568716919
},
{
"style": "Note",
"text": "XXX is replaced with the actual name of the Project.",
"updated": 1630568059149
},
{
"style": "Title",
"text": "Finding Your Way Arround Governance Workspaces",
"updated": 1630568467050
},
{
"style": "Text",
"text": "Each of the Governance Workspaces features several Project Definition Hierarchies describing the Pools, Assets, Features, and Positions of the corresponding Project.",
"updated": 1630568821141
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Deep in Governance"
},
{
"style": "Text",
"text": ""
},
{
"style": "Title",
"text": "Superalgos Pools Hierarchy",
"updated": 1630568627153
},
{
"style": "Include",
"text": "Governance->Concept->Superalgos Pools->Definition",
"updated": 1630568552530
},
{
"style": "Include",
"text": "Governance->Concept->Superalgos Pools->Content"
},
{
"style": "Title",
"text": "Scope of Calculations",
"updated": 1630569279039
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations",
"updated": 1630569313627
},
{
"style": "Include",
"text": "Governance->Concept->Reusable Governance Snippets->Computational Limitations 2"
}
]
}
@@ -0,0 +1,116 @@
{
"topic": "Governance Workspaces",
"pageNumber": "2",
"type": "Token Distribution Superalgos Governance Workspace",
"definition": {
"text": "This is the main governance workspace where broad Superalgos Project definitions live.",
"updated": 1630575735214
},
"paragraphs": [
{
"style": "Title",
"text": "Tutorials",
"updated": 1630576501552
},
{
"style": "List",
"text": "Creating Your User Profile Tutorial",
"updated": 1630576522747
},
{
"style": "Title",
"text": "User Profiles"
},
{
"style": "List",
"text": "Profiles of Core Team members and Community Mods."
},
{
"style": "Title",
"text": "Scope of Definitions"
},
{
"style": "Text",
"text": "The workspace features definitions that span the whole Superalgos Project.",
"updated": 1630576025223
},
{
"style": "Subtitle",
"text": "Pools"
},
{
"style": "List",
"text": "Superalgos Pools hierarchy.",
"updated": 1630576375102
},
{
"style": "Subtitle",
"text": "Positions"
},
{
"style": "List",
"text": "Superalgos Marketing (project-wide marketing-related positions),",
"updated": 1630576292069
},
{
"style": "List",
"text": "Superalgos (project-wide positions such as Community Mods, Core Team, or Business Lead).",
"updated": 1630576271333
},
{
"style": "Subtitle",
"text": "Features"
},
{
"style": "List",
"text": "Superalgos (project-wide features such as the Charting Space, the Visual Designer, the Tensor Flow integration, and so on).",
"updated": 1630576362020
},
{
"style": "Subtitle",
"text": "Assets"
},
{
"style": "List",
"text": "Superalgos Exchanges (assets related to exchange listings),",
"updated": 1630576480397
},
{
"style": "List",
"text": "Superalgos Marketing (project-wide, marketing-related assets),",
"updated": 1630576486012
},
{
"style": "List",
"text": "Client,",
"updated": 1630576385365
},
{
"style": "List",
"text": "UI,",
"updated": 1630576390127
},
{
"style": "List",
"text": "TS,",
"updated": 1630576395166
},
{
"style": "List",
"text": "Docker,"
},
{
"style": "List",
"text": "Launch Scripts,"
},
{
"style": "List",
"text": "Root Directory.",
"updated": 1630576402835
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,102 @@
{
"topic": "Governance Workspaces",
"pageNumber": "3",
"type": "Other Governance Workspaces",
"definition": {
"text": "The term refers to project-specific Governance Workspaces, as opposed to the main Token Distribution Superalgos Governance Workspace. Project-specific workspaces have a similar layout, as different projects usually have the same kinds of Assets, Features, Positions, and Pools categories.",
"updated": 1630597429410
},
"paragraphs": [
{
"style": "Title",
"text": "User Profiles",
"updated": 1630580093825
},
{
"style": "List",
"text": "Core Team members only, to keep the workspaces light."
},
{
"style": "Title",
"text": "Scope of Definitions"
},
{
"style": "Subtitle",
"text": "Pools"
},
{
"style": "List",
"text": "Superalgos Pools hierarchy (present in all Governance Workspaces for usability reasons)."
},
{
"style": "List",
"text": "A project-specific Pools hierarchy (for instance, Foundation-Project or Education-Project) defining pools for the main areas of the software, including pools for assets, features, positions, bug fixes, and improvements.",
"updated": 1630580570265
},
{
"style": "List",
"text": "A project-specific Pools hierarchy for assets (for instance, Foundations-Project-Assets or Education-Project-Assets), providing a more granular definition of various pools for several categories of assets, such as user interface, task server, app schemas, custom code, education, multi media,, and plugins.",
"updated": 1630581068210
},
{
"style": "Subtitle",
"text": "Positions"
},
{
"style": "List",
"text": "A project-specific Positions hierarchy (for instance Foundation-Project or Education-Project) defining positions such as the project's lead developer or bug hunters."
},
{
"style": "Subtitle",
"text": "Features"
},
{
"style": "List",
"text": "A project-specific Features hierarchy (for instance, Foundation-Project or Education-Project) usually defining project-specific features."
},
{
"style": "Subtitle",
"text": "Assets"
},
{
"style": "Text",
"text": "Several project-specific Assets hierarchies defining multiple catetories of assets, such as:"
},
{
"style": "List",
"text": "Client,"
},
{
"style": "List",
"text": "UI,"
},
{
"style": "List",
"text": "TS,"
},
{
"style": "List",
"text": "Plugins,",
"updated": 1630581417046
},
{
"style": "List",
"text": "Images,",
"updated": 1630581424128
},
{
"style": "List",
"text": "Docs,",
"updated": 1630581447409
},
{
"style": "List",
"text": "App Schemas,"
},
{
"style": "List",
"text": "Custom Code",
"updated": 1630581460500
}
]
}
@@ -55,7 +55,7 @@
},
{
"style": "Text",
"text": "Governance is defined across multiple Governance Plugin Workspaces that users may load and contribute to. These workspaces feature the definitions of several hierarchies that determine the relationship of all the concepts affecting governance.",
"text": "Governance is defined across multiple Governance Workspaces that users may load and contribute to. These workspaces feature the definitions of several hierarchies that determine the relationship of all the concepts affecting governance.",
"updated": 1630424913354
},
{
@@ -3,28 +3,23 @@
"pageNumber": 2,
"type": "Tutorial Step - Better Together",
"definition": {
"text": "Welcome to Superalgos Governance! Today I will walk you through everything you need to know about creating a Superalgos User Profile and joining the Governance network!",
"updated": 1629164302622,
"text": "This is the Governance Project! Today I will help you create a User Profile and join the first few Governance Programs!",
"updated": 1630604953792,
"icon": {
"name": "governance",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Text",
"text": "As a completely open source and collaborative project, Superalgos is not run by any singular set of people. ",
"updated": 1629164311647
},
{
"style": "Note",
"text": "Even the core team, who are dedicated to improving and maintaining Superalgos, do not directly control the path development will take. ",
"updated": 1629164322397
"text": "But before you start, you should know that you may only submit your profile to the Develop branch, so it's time to switch!",
"updated": 1630605011924
},
{
"style": "Text",
"text": "Instead, the governance system distributes decision making power across all User Profiles by leveraging the SA token.",
"updated": 1629701444641
"style": "Callout",
"text": "Go to the footer and switch both the Contributions Branch and the Current Branch to Develop. Then close and restart the app after the switch! <br/><br/>Once you're back, run the app.update command to get up to date with Develop, restart, and only then may you proceed with this tutorial!",
"updated": 1630605450785
},
{
"style": "Text",
@@ -1,7 +1,7 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 3,
"type": "Tutorial Step - Make sure You’re Comfortable",
"type": "Tutorial Step - Are You Ready?",
"definition": {
"text": "Before you jump into governance, it’s important you know how Superalgos works!",
"updated": 1629720525960,
@@ -13,13 +13,13 @@
"paragraphs": [
{
"style": "Text",
"text": "We have got a lot of exciting things to talk about, but I want to make sure you can follow along easily. ",
"updated": 1629164474591
"text": "We've got a lot of exciting things to talk about, but I want to make sure you can follow along easily.",
"updated": 1630657385662
},
{
"style": "Callout",
"text": "If you haven't already, make sure you go through the Getting Started Tutorials before continuing!",
"updated": 1629720338031
"text": "Make sure you go through the tutorials in the Getting Started Tutorials Plugin Workspace before continuing if you haven't yet!",
"updated": 1630598529991
},
{
"style": "Success",
@@ -3,8 +3,8 @@
"pageNumber": 4,
"type": "Tutorial Step - One Token to Rule Them All",
"definition": {
"text": "Unlike some crypto currencies the SA token actually means something!",
"updated": 1629162158011,
"text": "Unlike some crypto tokens the Superalgos SA Token actually means something!",
"updated": 1630599078911,
"icon": {
"name": "Programs\\staking-program",
"project": "Governance"
@@ -13,8 +13,8 @@
"paragraphs": [
{
"style": "Text",
"text": "The SA token is a BEP20 token hosted on the Binance Smart Chain (BSC). It represents your amount of investment in the Superalgos project and community. It is a way to reward and grow the Superalgos user base and development pool.",
"updated": 1629164803435
"text": "The SA Token is a BEP20 token on the Binance Smart Chain (BSC). Your token holdings embody your contributions to the Superalgos Project and Community, as the token is used to reward the user base and grow the development pool.",
"updated": 1630657545503
},
{
"style": "Note",
@@ -22,8 +22,8 @@
},
{
"style": "Success",
"text": "This means that the more you contribute to the project and help others, the more tokens you will earn!",
"updated": 1629164817915
"text": "The more you contribute to the project and help others, the more tokens you will earn!",
"updated": 1630657555715
},
{
"style": "Text",
@@ -3,8 +3,8 @@
"pageNumber": 5,
"type": "Tutorial Step - With Tokens Comes Responsibility",
"definition": {
"text": "Holding tokens does more than just show commitment. SA tokens also confer governance power!",
"updated": 1629162449407,
"text": "Holding tokens does more than just show commitment. SA Tokens also confer Token Power!",
"updated": 1630605735788,
"icon": {
"name": "governance",
"project": "Governance"
@@ -13,7 +13,7 @@
"paragraphs": [
{
"style": "Text",
"text": "The more tokens you hold the more influence you can have over the direction of the project. This means, by owning SA tokens, you hold the power to use those tokens to exert influence over what parts of the system will be developed and how the community will evolve.",
"text": "The more tokens you hold the more influence you can have over the direction of the project. This means, by owning SA Tokens, you hold the power to use those tokens to exert influence over what parts of the system will be developed and how the community will evolve.",
"updated": 1629165111109
},
{
@@ -3,8 +3,8 @@
"pageNumber": 6,
"type": "Tutorial Step - A Mighty Meritocracy",
"definition": {
"text": "Superalgos does not reward freeloading! Real contributions to the project and community are what get rewarded with SA tokens and Governance power.",
"updated": 1629162653518,
"text": "Superalgos does not reward freeloading! Real contributions to the project and community are what get rewarded with tokens and Token Power.",
"updated": 1630605807061,
"icon": {
"name": "Position\\positions",
"project": "Governance"
@@ -13,8 +13,8 @@
"paragraphs": [
{
"style": "Text",
"text": "The fancy word for this kind of project governance is meritocracy. In other words, the more you contribute to the improvement of Superalgos and to the support of our community, the more Token Power you earn to influence the future of the Superalgos project.",
"updated": 1629979557344
"text": "The fancy word for this kind of project governance is meritocracy. In other words, the more you contribute to the improvement of Superalgos and to the support of our Community, the more Token Power and Reputation you earn to influence the future of the project.",
"updated": 1630605980783
},
{
"style": "Note",
@@ -13,8 +13,8 @@
"paragraphs": [
{
"style": "Success",
"text": "Each of us bring unique talents and experience into our work with Superalgos. Even if you are not a programmer or expert trader there is still ways for you to get involved and grow the project!",
"updated": 1629165838038
"text": "Each of us bring unique talents and experience into our work with Superalgos. Even if you are not a programmer or expert trader there is still ways for you to get involved!",
"updated": 1630606036389
},
{
"style": "Text",
@@ -3,8 +3,8 @@
"pageNumber": 8,
"type": "Tutorial Step - What’s in a Profile?",
"definition": {
"text": "So what are we waiting for? Let’s get started! To participate in Governance you will first need a User Profile.",
"updated": 1629163040597,
"text": "So what are we waiting for? Let’s get started! To participate in Governance you will need a User Profile.",
"updated": 1630657682741,
"icon": {
"name": "User\\user-profile",
"project": "Governance"
@@ -3,8 +3,8 @@
"pageNumber": 9,
"type": "Tutorial Step - Program Participation",
"definition": {
"text": "How you use your Token Power is defined within a number of different Programs within your profile hierarchy.",
"updated": 1629163374967,
"text": "How you use your Token Power is defined within a number of Governance Programs within your profile hierarchy.",
"updated": 1630657749389,
"icon": {
"name": "User\\user-referrer",
"project": "Governance"
@@ -13,8 +13,8 @@
"paragraphs": [
{
"style": "Text",
"text": "These programs help organize the types of development and community relationships you want to reward. ",
"updated": 1629166399952
"text": "These programs help organize the types of development and community relationships you want to reward.",
"updated": 1630657777891
},
{
"style": "Note",
@@ -3,8 +3,8 @@
"pageNumber": 10,
"type": "Tutorial Step - Where it all Begins",
"definition": {
"text": "Here we are at the head of the governance project. Let’s get that profile created!",
"updated": 1629163572836,
"text": "Here we are at the head of the Governance Project hierarchy. Let’s get that profile created!",
"updated": 1630599538627,
"icon": {
"name": "governance",
"project": "Governance"
@@ -13,13 +13,13 @@
"paragraphs": [
{
"style": "Callout",
"text": "Click the Add Profile Constructor button.",
"updated": 1629163599518
"text": "Click the <i>Add Profile Constructor</i> button.",
"updated": 1630657850442
},
{
"style": "Text",
"text": "Now position the resulting Profile Constructor node where it is easy to see.",
"updated": 1629163626525
"text": "Now position the resulting Profile Constructor node where it is easy to see and work with.",
"updated": 1630657866373
}
]
}
@@ -13,8 +13,8 @@
"paragraphs": [
{
"style": "Text",
"text": "Not only that but it will create a unique Binance Smart Chain wallet that is connected with your profile. We call it your Governance Address.",
"updated": 1629166742408
"text": "It will create a unique Binance Smart Chain wallet that is connected with your profile: your Governance Address.",
"updated": 1630657968476
},
{
"style": "Note",
@@ -23,8 +23,8 @@
},
{
"style": "Text",
"text": "Your Governance Address will allow you to receive the SA tokens you earn. Superalgos will also read the balance of this address to become aware of the number of SA tokens you hold, and assign your profile an equivalent amount of Token Power.",
"updated": 1629166705049
"text": "Your Governance Address will allow you to receive the SA Tokens you earn. Superalgos will read the balance of this address to become aware of the number of SA Tokens you hold, and assign your profile an equivalent amount of Token Power.",
"updated": 1630606362346
}
]
}
@@ -3,8 +3,8 @@
"pageNumber": 12,
"type": "Tutorial Step - Pump that Heartbeat!",
"definition": {
"text": "Now let’s configure that Profile Constructor!",
"updated": 1629167519082,
"text": "Now let’s configure the Profile Constructor so that we may later build the profile!",
"updated": 1630658339365,
"icon": {
"name": "configuration",
"project": "Governance"
@@ -3,12 +3,12 @@
"pageNumber": 13,
"type": "Tutorial Step - Oh so Shiny",
"definition": {
"text": "We are almost there. Now click Build Profile and watch the magic happen. That’s right, you just created your profile!",
"text": "We are almost there. Now click <i>Build Profile</i> and watch the magic happen. That’s right, you just created your profile!",
"icon": {
"name": "User\\user-profile",
"project": "Governance"
},
"updated": 1629721281167
"updated": 1630658421560
},
"paragraphs": [
{
@@ -18,8 +18,8 @@
},
{
"style": "Note",
"text": "The constructor just generated your user profile, and either linked your address or created a unique SA Token Governance address. ",
"updated": 1629553674568
"text": "The constructor just generated your user profile, and either linked your address or created a unique SA Token Governance Address.",
"updated": 1630599816232
}
]
}
@@ -3,8 +3,8 @@
"pageNumber": 14,
"type": "Tutorial Step - Only You",
"definition": {
"text": "The profile constructor also did some work to make sure only you can change your profile.",
"updated": 1629553865897,
"text": "The Profile Constructor also did some work to make sure only you can change your profile.",
"updated": 1630658478769,
"icon": {
"name": "User\\user-profile",
"project": "Governance"
@@ -13,13 +13,13 @@
"paragraphs": [
{
"style": "Text",
"text": "A cryptographic message with your GitHub.com username has been signed with the private key corresponding to your governance address. This message will be stored in your User Profile so that we may authenticate it comes from you once you submit your profile as a plugin to the Governance Project.",
"updated": 1629553908808
"text": "A cryptographic message with your GitHub.com username has been signed with the private key corresponding to your Governance Address. This message will be stored in your User Profile so that we may authenticate it comes from you once you submit your profile as a plugin to the Governance Project.",
"updated": 1630658507981
},
{
"style": "Success",
"text": ". What this means is that your profile, and its associated token address, can only be accessed and changed by you!",
"updated": 1629553923815
"text": "What this means is that your profile and its associated token address can only be accessed and changed by you!",
"updated": 1630606585784
},
{
"style": "Text",
@@ -3,8 +3,8 @@
"pageNumber": 15,
"type": "Tutorial Step - Under the Hood",
"definition": {
"text": "Let's take a little closer look at the cryptographic signature in your new profile.",
"updated": 1629554334739,
"text": "Let's take a closer look at the cryptographic signature in your new profile.",
"updated": 1630658552742,
"icon": {
"name": "User\\user-profile",
"project": "Governance"
@@ -17,7 +17,7 @@
"updated": 1629554250933
},
{
"style": "Text",
"style": "Note",
"text": "Wow that’s a lot of numbers! Again, this is how the governance system will know that this User Profile belongs to the private key that signed the message, which in turn belongs to the address that will hold the tokens that confer your profile with Token Power.",
"updated": 1629554289159
}
@@ -3,8 +3,8 @@
"pageNumber": 16,
"type": "Tutorial Step - Save the Key!",
"definition": {
"text": "Now that you have a new rocking Profile, let’s talk some more about that private key. ",
"updated": 1629554694993,
"text": "Now that you have a new rocking User Profile, let’s talk some more about that private key.",
"updated": 1630658607513,
"icon": {
"name": "Key\\key-reference",
"project": "Foundations"
@@ -3,8 +3,8 @@
"pageNumber": 17,
"type": "Tutorial Step - Profile Backup",
"definition": {
"text": "Later on, you will be rewarded with Superalgos SA Tokens to the address you just generated. But before that happens, you must safely store the private key that you will use to access the address.",
"updated": 1629579328664,
"text": "Your Superalgos SA Token rewards will go to the address you just generated, so you should safely store the private key that you will use to access the address.",
"updated": 1630658720175,
"icon": {
"name": "Exchange\\exchange-account-asset",
"project": "Foundations"
@@ -12,14 +12,14 @@
},
"paragraphs": [
{
"style": "Text",
"text": "At this point, Superalgos doesn’t offer a built-in solution to securely back up your private keys. All the system does is generate a BSC address / private key pair and deliver it in the configuration of the Profile Constructor node. It is up to you to decide how you are going to handle this sensitive information.",
"updated": 1629578959187
"style": "Important",
"text": "Superalgos doesn’t offer a built-in solution to securely back up your private keys. The system generates a BSC address / private key pair and delivers it in the configuration of the Profile Constructor. It is up to you to decide how you are going to handle this sensitive information.",
"updated": 1630658807597
},
{
"style": "Callout",
"text": "Access the configuration of the Profile Constructor. You will find the address and private key, so that you may back up the information in whatever way you see fit.",
"updated": 1629578990303
"text": "Access the configuration of the Profile Constructor. Find the address and private key, and back up the information in whatever way you see fit.",
"updated": 1630600071978
},
{
"style": "Text",
@@ -3,8 +3,8 @@
"pageNumber": 19,
"type": "Tutorial Step - Program Partners",
"definition": {
"text": "You have successfully created your profile! You are now set up to be able to participate in all the various Governance programs!\n",
"updated": 1629924832003,
"text": "You have successfully created your profile! You are now set up to participate in all the various Governance Programs!",
"updated": 1630606740196,
"icon": {
"name": "Programs\\onboarding-programs",
"project": "Governance"
@@ -13,16 +13,17 @@
"paragraphs": [
{
"style": "Text",
"text": "The onboarding programs are your first stop into the world of Superalgos governance. So let’s add them to your profile! ",
"updated": 1629925086766
},
{
"style": "Success",
"text": "Under your user profile you will find the Token Power Switch node."
"text": "The Onboarding Programs are your first stop into the world of Superalgos governance. So let’s add them to your profile!",
"updated": 1630600253110
},
{
"style": "Callout",
"text": "On the Token Power Switch click Add Onboarding Programs."
"text": "Find the Token Power Switch node under the User Profile node and click Add Onboarding Programs on the menu.",
"updated": 1630658978533
},
{
"style": "Success",
"text": "The Onboarding Programs node should pop up as an offspring of the Token Power Switch."
}
]
}
@@ -3,8 +3,8 @@
"pageNumber": 20,
"type": "Tutorial Step - Drop it like it’s Hot",
"definition": {
"text": "Being a part of the Governance network is a valuable contribution! As such the airdrop program rewards you with tokens just for being here!",
"updated": 1629925355949,
"text": "Taking part in governance is a valuable contribution! As such the Airdrop Program rewards you with tokens on every release!",
"updated": 1630606894763,
"icon": {
"name": "Programs\\airdrop-program",
"project": "Governance"
@@ -13,18 +13,18 @@
"paragraphs": [
{
"style": "Text",
"text": "The SA token is not a meaningless crypto currency. Consequently, we are not a fan of mindless airdrops. However, since you took the time to create your User Profile you deserve some tokens!",
"updated": 1629925482831
"text": "We are not a fan of mindless airdrops. However, since you took the time to learn Superalgos and create your User Profile, you deserve a reward!",
"updated": 1630606981664
},
{
"style": "Callout",
"text": "On the Onboarding Programs node click Add Airdrop Program",
"updated": 1629925540228
"text": "On the Onboarding Programs node click <i>Add Airdrop Program</i>.",
"updated": 1630607006405
},
{
"style": "Success",
"text": "Now you will receive 1,000 SA tokens at the next distribution if you submit a PR with your User Profile! We'll get to that!",
"updated": 1629980519400
"text": "Just by deploying the program, you are all set to get up to 1,000 SA Tokens at the next Distribution Event and on every other future release provided that you submit your User Profile!",
"updated": 1630659363719
}
]
}
@@ -3,18 +3,22 @@
"pageNumber": 21,
"type": "Tutorial Step - GitHub Glory",
"definition": {
"text": "The GitHub Program allows you to receive some tokens for starting to get involved with the project!",
"updated": 1629926259120,
"text": "Now, the Github Program rewards you with more tokens for helping developers find Superalgos on Github.com search!",
"updated": 1630601440266,
"icon": {
"name": "Programs\\github-program",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Add the Github Program from the menu of the Onboarding Programs node.",
"updated": 1630601229528
},
{
"style": "Text",
"text": "There are three ways to gain more tokens with the Github Program. Doing all three will land you a nice Token bonus!",
"updated": 1629926280944
"text": "There are three things you can help with! Doing all three may land you up to SA 3,000 more!"
},
{
"style": "List",
@@ -22,16 +26,18 @@
},
{
"style": "List",
"text": "Fork the Superalgos repository to your Github account.",
"updated": 1629926002868
"text": "Fork the Superalgos repository to your Github account — you probably have already!",
"updated": 1630600687531
},
{
"style": "List",
"text": "Watch the Superalgos repository with your Github account."
"text": "Click the Watch button too!",
"updated": 1630601314552
},
{
"style": "Callout",
"text": "Adding the Github program is just like adding the Airdrop Program! On the Onboarding Programs node click Add Github Program."
"style": "Link",
"text": "Go to the Superalgos repo to click the Star and Watch buttons. Make sure you have a fork too!->github.com/Superalgos/Superalgos",
"updated": 1630601392808
},
{
"style": "Text",
@@ -0,0 +1,35 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 22,
"type": "Tutorial Step - How Github Works",
"definition": {
"text": "Github.com bumps up the search ranking of projects when they have many stars, forks, and people watching the repository!",
"updated": 1630659929485,
"icon": {
"name": "Programs\\github-program",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Note",
"text": "That is why we ask you to help in this manner! By completing those three tasks, you are effectively helping more developers find Superalgos, which is a win for everyone, as the more developers, the faster the project advances!",
"updated": 1630660356226
},
{
"style": "Text",
"text": "Now, this is how it works on the side of Superalgos:",
"updated": 1630659982457
},
{
"style": "List",
"text": "The system checks the repository and verifies if your Github account has a star, a fork, and/or a watch.",
"updated": 1630660104845
},
{
"style": "List",
"text": "There is a cap of SA 1,000 for each of these incentives. This means that you may get up to SA 3,000 if you maximize your participation.",
"updated": 1630660329237
}
]
}
@@ -1,29 +0,0 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 22,
"type": "Tutorial Step - Make it Official",
"definition": {
"text": "Now we are ready to push your new profile to the main Superalgos repository! ",
"updated": 1629583003718,
"icon": {
"name": "Programs\\github-program",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Text",
"text": "If you have gone through the welcome tutorials already, you should have set up your GitHub authentication and submitted a review. Submitting your profile will be exactly the same. Easy right!",
"updated": 1629583038275
},
{
"style": "Warning",
"text": "If this sounds strange to you. Read the docs page open to the right and go through the steps to set up your GitHub authentication. Then come back here and we'll finish up!",
"updated": 1629583121545
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,29 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 23,
"type": "Tutorial Step - Save Your Profile!",
"definition": {
"text": "Cool! We've covered the basics! Now you have a working User Profile and are already participating in the first two Governance Programs!",
"updated": 1630601962359,
"icon": {
"name": "backup-entity",
"project": "Foundations"
}
},
"paragraphs": [
{
"style": "Text",
"text": "It's time to save your User Profile! ",
"updated": 1630603392015
},
{
"style": "Callout",
"text": "Click Ctrl + Shift + Alt + Key-S to save the Current Workspace."
},
{
"style": "Success",
"text": "We set your profile to save as a Plugin every time you save the workspace! So that should save your User Profile too! ",
"updated": 1630603485216
}
]
}
@@ -1,33 +0,0 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 23,
"type": "Tutorial Step - To Infinity and Beyond",
"definition": {
"text": "If you have submitted a review then you are ready to go. We will be using the app.contribute command again to finish submitting your profile.",
"updated": 1629583914664,
"icon": {
"name": "User\\user-profile",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Go to the docs panel and type the following command into the search bar:",
"updated": 1629726858200
},
{
"style": "Json",
"text": "app.contribute This is my first submission of User Profile [add your name here]",
"updated": 1629726765903
},
{
"style": "Text",
"text": "If everything is set up correctly you should see the message appear that your pull request has been submitted. This means that your profile has been sent to the main Superalgos repository and will be automatically merged in just a few minutes!"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 24,
"type": "Tutorial Step - Low Hanging Fruit",
"definition": {
"text": "Now I'll hook you up with the Community Building Programs, which are also quite easy to set up and will earn you more tokens!",
"updated": 1630660957861,
"icon": {
"name": "Programs\\community-building-programs",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Go to the Token Power Switch node and select <i>Add Comunity Building Programs</i> from the menu.",
"updated": 1630661290597
},
{
"style": "Note",
"text": "Superalgos thrives through contributions and collaboration. We designed these programs to foster a community in which members are always ready to help and give back!",
"updated": 1630661420122
},
{
"style": "Success",
"text": "These programs are a bit more elaborate in their workings... you'll love them!",
"updated": 1630661576265
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 25,
"type": "Tutorial Step - I'll Lay Out the Basics",
"definition": {
"text": "All Community Building Programs have two built-in types of incentives: a Tokens Bonus, and Tokens Awarded by the program.",
"icon": {
"name": "Programs\\community-building-programs",
"project": "Governance"
},
"updated": 1630664341967
},
"paragraphs": [
{
"style": "Text",
"text": "In general terms, this is how it works:",
"updated": 1630664598834
},
{
"style": "List",
"text": "Tokens Bonus: It's an incentive to participate in the program. You earn these tokens simply by fulfilling the participation rules."
},
{
"style": "List",
"text": "Tokens Awarded: These programs incentivize desirable behaviors. If you constructively participate in the Community, then you will earn more tokens!",
"updated": 1630664896700
},
{
"style": "Success",
"text": "The interesting bit about these programs is that they reward chains of collaborations! Let's explore this concept within the Referral Program!",
"updated": 1630664769086
}
]
}
@@ -0,0 +1,40 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 26,
"type": "Tutorial Step - The Referral Program",
"definition": {
"text": "The Referral Program incentivizes the promotion of the project, either by word-of-mouth or “en masse” through articles, social media posts, videos, and other forms of influencer marketing!",
"updated": 1630665298091,
"icon": {
"name": "Programs\\referral-program",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Go to the Community Building Programs node and click <i>Add Referral Program</i>.",
"updated": 1630665425190
},
{
"style": "Text",
"text": "First, let's clarify what rules you must fulfill to earn your Tokens Bonus!",
"updated": 1630668604341
},
{
"style": "List",
"text": "You must deploy the program: Done!",
"updated": 1630665468816
},
{
"style": "List",
"text": "You must declare your referrer: We'll do that next!",
"updated": 1630665632799
},
{
"style": "List",
"text": "You must drive Token Power to the program: Wooh... token power... sounds neat? You bet!",
"updated": 1630666285261
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 27,
"type": "Tutorial Step - Declare Your Referrers",
"definition": {
"text": "The program is deployed! Now you have to declare your referrer to fulfill the second requirement!",
"icon": {
"name": "User\\user-referrer",
"project": "Governance"
},
"updated": 1630669057039
},
"paragraphs": [
{
"style": "Text",
"text": "Maybe you learned about Superalgos from an article, a video, a comment on Reddit, a tweet, the official website, or someone who told you about us!",
"updated": 1630669214566
},
{
"style": "Success",
"text": "Declaring your referrers is the best way to thank the people that may have written that article or tweet, produced that video, maintained the website, or told you about Superalgos!",
"updated": 1630669976768
},
{
"style": "Text",
"text": "To declare a referrer, you must establish a reference from the User Referrer node to the User Profile of your referrer! Does your referrer have a User Profile?",
"updated": 1630681537614
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 28,
"type": "Tutorial Step - Load the User Profile",
"definition": {
"text": "Do you know who your referrer is? Does your referrer have a User Profile? How do you find and load the right profile? Those are all good questions!",
"updated": 1630678332122,
"icon": {
"name": "User\\user-profile",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Follow the guide on the right to find the answers!",
"updated": 1630678762493
},
{
"style": "Note",
"text": "I brought you to the Dummy profile mentioned in the guide to make it easier for you!",
"updated": 1630678841266
},
{
"style": "Success",
"text": "If the question \"who is your referrer\" has no good answer then feel free to declare one of your friends in the Community! By the way, notice that the profiles of Community Mods and Core Team members are loaded already!",
"updated": 1630679299290
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 29,
"type": "Tutorial Step - Reference the User Profile",
"definition": {
"text": "Now that you have the target User Profile on the workspace, all that is left is to establish the reference from your User Referrer node to the User Profile.",
"icon": {
"name": "delink-node",
"project": "Foundations"
},
"updated": 1630679894593
},
"paragraphs": [
{
"style": "Callout",
"text": "Just in case you're not proficient with references, here's a quick reminder of how references work!",
"updated": 1630680014393
},
{
"style": "Note",
"text": "By the way, if you feel like you have more than one referrer, feel free to add User Referrer nodes and set up the references with their profiles!",
"updated": 1630680189459
},
{
"style": "Success",
"text": "Once you're done declaring your referrers, keep going with the tutorial!",
"updated": 1630680219618
}
]
}
@@ -0,0 +1,39 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 30,
"type": "Tutorial Step - Referral Token Awards",
"definition": {
"text": "Superalgos is a community-run project, not a VC-funded startup! We count on you helping with word-of-mouth marketing!",
"icon": {
"name": "tokens-awarded",
"project": "Governance"
},
"updated": 1630681292714
},
"paragraphs": [
{
"style": "Important",
"text": "The incentives to bring your friends, colleagues, or your following are significant! Find the short explanation below, and dive into the details on the right if so you wish!",
"updated": 1630681312671
},
{
"style": "Text",
"text": "This is the short version of how these programs work:",
"updated": 1630680801100
},
{
"style": "List",
"text": "The more people declare you as their referrers, the more tokens you earn on each and every release of the software, indefinitely!",
"updated": 1630680974311
},
{
"style": "List",
"text": "If the people you bring to Superalgos bring people too, you earn for those as well, and for those the latter bring, you earn too!",
"updated": 1630681200103
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 31,
"type": "Tutorial Step - Token Power Requirement",
"definition": {
"text": "Remember the third requirement to earn your Tokens Bonus? \"You must drive Token Power to the program\". What's that all about?",
"updated": 1630686739254,
"icon": {
"name": "Exchange\\exchange-account-asset",
"project": "Foundations"
}
},
"paragraphs": [
{
"style": "Text",
"text": "We're probably getting in the weeds here, but I'll try to keep it simple!",
"updated": 1630683871001
},
{
"style": "List",
"text": "When your Governance Address has some tokens in its balance, then you get the same amount of Token Power in your User Profile."
},
{
"style": "List",
"text": "Token Power flows down the hierarchy like a river! The amount of Token Power you let into each Governance Program determines how strongly you wish to participate in the program and impacts the Token Rewards you may get from it.",
"updated": 1630684153086
},
{
"style": "List",
"text": "By default, Token Power flows in equal amounts to all offspring nodes! You may change this tough!",
"updated": 1630684072593
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 32,
"type": "Tutorial Step - Controlling Flows",
"definition": {
"text": "The configuration of each node where Token Power may go in acts as a floodgate! That's how you control Token Power Flows!",
"icon": {
"name": "Switches\\votes-switch",
"project": "Governance"
},
"updated": 1630687488694
},
"paragraphs": [
{
"style": "Text",
"text": "Go back to the Onboarding Programs node. Guess what? Those programs do not need Token Power, so we will close the floodgate!",
"updated": 1630687366643
},
{
"style": "Callout",
"text": "Copy the below configuration and paste it into the Onboarding Programs node configuration!",
"updated": 1630687477137
},
{
"style": "Json",
"text": "{\n \"percentage\": 0\n }",
"updated": 1630687598132
}
]
}
@@ -0,0 +1,25 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 33,
"type": "Tutorial Step - What Token Power?",
"definition": {
"text": "If you have no tokens in your Governance Address, then you have zero Token Power! But don't worry! We'll work something out!",
"updated": 1630687902755,
"icon": {
"name": "Exchange\\exchange-account-asset",
"project": "Foundations"
}
},
"paragraphs": [
{
"style": "Text",
"text": "Whether you have any Token Power or not, notice that there is now 0% of Token Power going into the Onboarding Programs and 100% going into the Community Building Programs! Floodgates closed, the flow goes elsewhere! You can play with percentages too!",
"updated": 1630688907038
},
{
"style": "Important",
"text": "Now, here's the good news... Because chances are that you have no Token Power to fulfill the third requirement to participate in the Community Building Programs, we are going to delegate some power to all User Profiles in this release! Well take care of that, so forget about it! ",
"updated": 1630689031351
}
]
}
@@ -0,0 +1,25 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 34,
"type": "Tutorial Step - Support Your Supporters",
"definition": {
"text": "The Support Program works pretty much like the Referral Program, only that you declare who your favorite Community Mods are!",
"updated": 1630689246772,
"icon": {
"name": "Programs\\support-program",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Add the Support Program and use User Supporter nodes to set up references to your favorite moderators! Their profiles are loaded already!",
"updated": 1630689768928
},
{
"style": "Success",
"text": "While the Community is always ready to help with typical questions, it takes a certain level of experience and knowledge to provide effective support. This is why select Community Mods are in charge! Participating in this program is the best way to thank the people that selflessly help others!",
"updated": 1630689962795
}
]
}
@@ -0,0 +1,30 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 35,
"type": "Tutorial Step - Thank Your Mentors",
"definition": {
"text": "Mentors are crucial to developing Contributors. They are the people that go the extra mile to help you progress and master Superalgos!",
"updated": 1630690393118,
"icon": {
"name": "Programs\\mentorship-program",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Text",
"text": "The Mentorship Program is very similar the Support Program, only that your mentors don't need to be moderators. It may be your friend learning Superalgos with you, or any other Community member!",
"updated": 1630690674482
},
{
"style": "Callout",
"text": "Deploy the program, and declare your mentors!",
"updated": 1630690640463
},
{
"style": "Text",
"text": "Hit Ctrl + Shift + Alt + Key-S when you're done to save your profile! With this you've completed the setup of the main Governance Programs oriented to newcomers! Now it's time to contribute your User Profile to the Superalgos repository!",
"updated": 1630690916860
}
]
}
@@ -0,0 +1,29 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 36,
"type": "Tutorial Step - Make it Official",
"definition": {
"text": "Now you're ready to push your new profile to the main Superalgos repository!",
"updated": 1630607221921,
"icon": {
"name": "Programs\\github-program",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Hit Ctrl + Shift + Alt + Key-S to save your profile if you haven't yet. <br/><br/>Now, set up you Github API credentials to get ready to contribute your profile!",
"updated": 1630691166021
},
{
"style": "Warning",
"text": "If you don't know what I'm talking about, you may need a refresher on how to submit a contribution to Superalgos. Read these few steps taken from the Beyond the Basics Tutorial to remind you what the GitHub authentication process is like. ",
"updated": 1630691155123
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,34 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 37,
"type": "Tutorial Step - To Infinity and Beyond",
"definition": {
"text": "Let's get rolling! We will be using the app.contribute command to submit your profile.",
"updated": 1630604507310,
"icon": {
"name": "User\\user-profile",
"project": "Governance"
}
},
"paragraphs": [
{
"style": "Callout",
"text": "Copy the command making sure you replace the placeholder with your Github username, paste it in the search box, and click Enter.",
"updated": 1630604654229
},
{
"style": "Json",
"text": "app.contribute First submission of User Profile [add your name here]",
"updated": 1630604551655
},
{
"style": "Text",
"text": "If everything is set up correctly, you should see a message stating that your pull request has been submitted. This means that your profile has been sent to the main Superalgos repository and will be automatically merged in just a few minutes!",
"updated": 1630604694599
},
{
"style": "Text",
"text": ""
}
]
}
@@ -1,6 +1,6 @@
{
"tutorial": "Creating Your User Profile Tutorial",
"pageNumber": 24,
"pageNumber": 38,
"type": "Tutorial Step - Welcome aboard!",
"definition": {
"text": "You did it! You are now officially a part of the Superalgos governance community! Now that you have a profile, there are a few important things to do.",
@@ -106,8 +106,13 @@ function newGovernanceFunctionLibraryAirdropProgram() {
userProfile.payload.blockchainTokens === undefined
) {
node.payload.airdropProgram.isActive = false
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.")
userProfile.payload.uiObject.setErrorMessage(
"Waiting for blockchain balance. It takes 6 seconds to load the balance of each profile, bacause you are using a free API provided by BSC Scan.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
} else {
userProfile.payload.uiObject.resetErrorMessage()
}
/*
Next thing to do is to validate if the airdrop user profile has a star at the Superalgos repository.
@@ -117,7 +122,10 @@ function newGovernanceFunctionLibraryAirdropProgram() {
profileSignature === undefined
) {
node.payload.airdropProgram.isActive = false
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, and produce a signature of your Airdrop Username.")
userProfile.payload.uiObject.setErrorMessage(
"You need to setup this profile with the Profile Constructor, and produce a signature of your Airdrop Username.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
@@ -154,7 +162,10 @@ function newGovernanceFunctionLibraryAirdropProgram() {
if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 }
if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) {
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
programNode.payload.uiObject.setErrorMessage(
"Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
programNode.payload.airdropProgram.awarded.tokens = programNode.payload.airdropProgram.ownPower / totalPowerRewardRatio
@@ -170,7 +181,7 @@ function newGovernanceFunctionLibraryAirdropProgram() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' Airdrop Power')
node.payload.uiObject.setStatus(ownPowerText + ' Airdrop Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
@@ -180,12 +191,12 @@ function newGovernanceFunctionLibraryAirdropProgram() {
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
node.tokensAwarded.payload.uiObject.valueAtAngle = false
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
node.tokensAwarded.payload.uiObject.statusAngleOffset = 0
node.tokensAwarded.payload.uiObject.statusAtAngle = false
node.tokensAwarded.payload.uiObject.setStatus('For creating your Superalgos profile!')
node.tokensAwarded.payload.uiObject.setStatus('For creating your Superalgos profile!', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -12,10 +12,16 @@ function newGovernanceFunctionLibraryAssets() {
let folderPath = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'folderPath')
if (folderPath === undefined || folderPath === "") {
node.payload.uiObject.setErrorMessage("folderPath Config Property undefined.")
node.payload.uiObject.setErrorMessage(
"folderPath Config Property undefined.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
node.payload.uiObject.setInfoMessage("Hold on while we install all the assets inside the this path: " + folderPath + ". This might take a minute or two.")
node.payload.uiObject.setInfoMessage(
"Hold on while we install all the assets inside the this path: " + folderPath + ". This might take a minute or two.",
UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR
)
httpRequest(undefined, 'DirContent' + '/' + folderPath, onResponse)
function onResponse(err, data) {
@@ -32,7 +38,10 @@ function newGovernanceFunctionLibraryAssets() {
totalAssets++
createNodesFromPath(node, foldersArray)
}
node.payload.uiObject.setInfoMessage("A total of : " + totalAssets + " assets have been installed.")
node.payload.uiObject.setInfoMessage(
"A total of : " + totalAssets + " assets have been installed.",
UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR
)
}
function removeFirstFromArray(array) {
@@ -350,7 +350,10 @@ function newGovernanceFunctionLibraryClaimsProgram() {
}
}
if (totalPercentage > 100) {
node.payload.uiObject.setErrorMessage('Claim Power Switching Error. Total Percentage of children nodes is grater that 100.')
node.payload.uiObject.setErrorMessage(
'Claim Power Switching Error. Total Percentage of children nodes is grater that 100.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
let defaultPercentage = 0
@@ -446,7 +449,7 @@ function newGovernanceFunctionLibraryClaimsProgram() {
'Shared Between: ' + node.payload.claimsProgram.share.count + ' claims' + ' - ' +
'Share of Claims: ' + node.payload.claimsProgram.share.percentage.toFixed(2) + '%'
node.payload.uiObject.setStatus(status)
node.payload.uiObject.setStatus(status, UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
function drawProgram(node) {
@@ -457,7 +460,7 @@ function newGovernanceFunctionLibraryClaimsProgram() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' Claim Power')
node.payload.uiObject.setStatus(ownPowerText + ' Claim Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
@@ -472,8 +475,8 @@ function newGovernanceFunctionLibraryClaimsProgram() {
node.tokensAwarded.payload.uiObject.statusAngleOffset = 0
node.tokensAwarded.payload.uiObject.statusAtAngle = true
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.claimsProgram.count + ' Claims.')
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload.claimsProgram.count + ' Claims.', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
@@ -486,10 +489,12 @@ function newGovernanceFunctionLibraryClaimsProgram() {
node.payload.uiObject.percentageAngleOffset = 180
node.payload.uiObject.percentageAtAngle = true
node.payload.uiObject.setValue(programPowerText)
node.payload.uiObject.setValue(programPowerText, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
if (percentage !== undefined) {
node.payload.uiObject.setPercentage(percentage.toFixed(2))
node.payload.uiObject.setPercentage(percentage.toFixed(2),
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
}
}
}
@@ -498,7 +503,10 @@ function newGovernanceFunctionLibraryClaimsProgram() {
function installMissingClaims(node, rootNodes) {
if (node.payload === undefined) { return }
if (node.payload.referenceParent === undefined) {
node.payload.uiObject.setErrorMessage('To Install Missing Claims you need a Reference Parent')
node.payload.uiObject.setErrorMessage(
'To Install Missing Claims you need a Reference Parent',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
scanNodeBranch(node, node.payload.referenceParent)
@@ -211,7 +211,10 @@ function newGovernanceFunctionLibraryDelegationProgram() {
}
}
if (totalPercentage > 100) {
node.payload.uiObject.setErrorMessage('Delegate Power Switching Error. Total Percentage of children nodes is grater that 100.')
node.payload.uiObject.setErrorMessage(
'Delegate Power Switching Error. Total Percentage of children nodes is grater that 100.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
let defaultPercentage = 0
@@ -278,7 +281,9 @@ function newGovernanceFunctionLibraryDelegationProgram() {
drawProgram(node)
if (percentage !== undefined) {
node.payload.uiObject.setPercentage(percentage.toFixed(2))
node.payload.uiObject.setPercentage(percentage.toFixed(2),
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
}
return
}
@@ -294,10 +299,12 @@ function newGovernanceFunctionLibraryDelegationProgram() {
let powerType = 'Delegate Power'
const programPowerText = parseFloat(programPower.toFixed(0)).toLocaleString('en') + ' ' + powerType
node.payload.uiObject.setValue(programPowerText)
node.payload.uiObject.setValue(programPowerText, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
if (percentage !== undefined) {
node.payload.uiObject.setPercentage(percentage.toFixed(2))
node.payload.uiObject.setPercentage(percentage.toFixed(2),
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
}
}
}
@@ -310,18 +317,20 @@ function newGovernanceFunctionLibraryDelegationProgram() {
node.payload.uiObject.valueAngleOffset = 180
node.payload.uiObject.valueAtAngle = true
node.payload.uiObject.setValue(outgoingPowerText + ' Delegate Power')
node.payload.uiObject.setValue(outgoingPowerText + ' Delegate Power', UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
node.payload.uiObject.percentageAngleOffset = 180
node.payload.uiObject.percentageAtAngle = true
node.payload.uiObject.setPercentage(percentage)
node.payload.uiObject.setPercentage(percentage,
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
if (node.payload.referenceParent !== undefined) {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = true
node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power')
node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -334,7 +343,7 @@ function newGovernanceFunctionLibraryDelegationProgram() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' Delegate Power')
node.payload.uiObject.setStatus(ownPowerText + ' Delegate Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -106,8 +106,13 @@ function newGovernanceFunctionLibraryGithubProgram() {
userProfile.payload.blockchainTokens === undefined
) {
node.payload.githubProgram.isActive = false
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.")
userProfile.payload.uiObject.setErrorMessage(
"Waiting for blockchain balance. It takes 6 seconds to load the balance of each profile, bacause you are using a free API provided by BSC Scan.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
} else {
userProfile.payload.uiObject.resetErrorMessage()
}
/*
Next thing to do is to validate if the github user profile has a star at the Superalgos repository.
@@ -117,7 +122,10 @@ function newGovernanceFunctionLibraryGithubProgram() {
profileSignature === undefined
) {
node.payload.githubProgram.isActive = false
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, and produce a signature of your Github Username.")
userProfile.payload.uiObject.setErrorMessage(
"You need to setup this profile with the Profile Constructor, and produce a signature of your Github Username.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
let githubUsername = profileSignature.message
@@ -168,7 +176,10 @@ function newGovernanceFunctionLibraryGithubProgram() {
if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 }
if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) {
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
programNode.payload.uiObject.setErrorMessage(
"Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
const MAX_ENGAGEMENT = 3
@@ -185,7 +196,7 @@ function newGovernanceFunctionLibraryGithubProgram() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' Github Power')
node.payload.uiObject.setStatus(ownPowerText + ' Github Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
@@ -195,7 +206,7 @@ function newGovernanceFunctionLibraryGithubProgram() {
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
node.tokensAwarded.payload.uiObject.valueAtAngle = false
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
node.tokensAwarded.payload.uiObject.statusAngleOffset = 0
node.tokensAwarded.payload.uiObject.statusAtAngle = false
@@ -211,7 +222,7 @@ function newGovernanceFunctionLibraryGithubProgram() {
extraText = extraText + ' + 1 Fork'
}
node.tokensAwarded.payload.uiObject.setStatus('From' + extraText)
node.tokensAwarded.payload.uiObject.setStatus('From' + extraText, UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -12,7 +12,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
node.payload.parentNode.payload.uiObject.setErrorMessage(
"Config codeName must have the name of the project.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
}
@@ -28,7 +31,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
node.payload.parentNode.payload.uiObject.setErrorMessage(
"Config codeName must have the name of the project.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
}
@@ -44,7 +50,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
node.payload.parentNode.payload.uiObject.setErrorMessage(
"Config codeName must have the name of the project.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
}
@@ -60,7 +69,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
node.payload.parentNode.payload.uiObject.setErrorMessage(
"Config codeName must have the name of the project.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
}
@@ -76,7 +88,10 @@ function newGovernanceFunctionLibraryPluginsFunctions() {
let projectName = UI.projects.foundations.utilities.plugins.getProjectName(node)
if (projectName === "" || projectName === undefined) {
if (node.payload.parentNode !== undefined) {
node.payload.parentNode.payload.uiObject.setErrorMessage("Config codeName must have the name of the project.")
node.payload.parentNode.payload.uiObject.setErrorMessage(
"Config codeName must have the name of the project.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
}
@@ -16,7 +16,10 @@ function newGovernanceFunctionLibraryProfileConstructor() {
let mnemonic = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(node.payload, 'mnemonic')
if (githubUsername === undefined || githubUsername === "") {
node.payload.uiObject.setErrorMessage("githubUsername config property missing.")
node.payload.uiObject.setErrorMessage(
"githubUsername config property missing.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
@@ -48,7 +51,10 @@ function newGovernanceFunctionLibraryProfileConstructor() {
function onResponse(err, data) {
/* Lets check the result of the call through the http interface */
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
node.payload.uiObject.setErrorMessage('Call via HTTP Interface failed.')
node.payload.uiObject.setErrorMessage(
'Call via HTTP Interface failed.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
@@ -58,11 +64,17 @@ function newGovernanceFunctionLibraryProfileConstructor() {
if (response.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
if (mnemonic === undefined || mnemonic === "") {
node.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. ' + response.error)
node.payload.uiObject.setErrorMessage(
'Call to WEB3 Server failed. ' + response.error,
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
console.log('Call to WEB3 Server failed. ' + response.error)
return
} else {
node.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. Most likely the Mnemonic provided is not correct or you need to run node setup because a dependency is missing. ' + response.error)
node.payload.uiObject.setErrorMessage(
'Call to WEB3 Server failed. Most likely the Mnemonic provided is not correct or you need to run node setup because a dependency is missing. ' + response.error,
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
console.log('Call to WEB3 Server failed. Most likely the Mnemonic provided is not correct or you need to run node setup because a dependency is missing. ' + response.error)
return
}
@@ -88,7 +100,10 @@ function newGovernanceFunctionLibraryProfileConstructor() {
function onResponse(err, data) {
/* Lets check the result of the call through the http interface */
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
node.payload.uiObject.setErrorMessage('Call via HTTP Interface failed.')
node.payload.uiObject.setErrorMessage(
'Call via HTTP Interface failed.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
@@ -96,7 +111,10 @@ function newGovernanceFunctionLibraryProfileConstructor() {
/* Lets check the result of the method call */
if (response.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
node.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. ' + response.error)
node.payload.uiObject.setErrorMessage(
'Call to WEB3 Server failed. ' + response.error,
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
console.log('Call to WEB3 Server failed. ' + response.error)
return
}
@@ -124,9 +142,15 @@ function newGovernanceFunctionLibraryProfileConstructor() {
Show nice message.
*/
if (mnemonic === undefined || mnemonic === "") {
node.payload.uiObject.setInfoMessage("Profile Private Key has been successfully created. User Profile installed as a plugin and saved. Use the Private Key at a crypto wallet and delete this node once done.", 10000)
node.payload.uiObject.setInfoMessage(
"Profile Private Key has been successfully created. User Profile installed as a plugin and saved. Use the Private Key at a crypto wallet and delete this node once done.",
UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR
)
} else {
node.payload.uiObject.setInfoMessage("Mnemonic successfully imported. User Profile installed as a plugin and saved. Your external wallet was sucessfully linked to your profile.", 10000)
node.payload.uiObject.setInfoMessage(
"Mnemonic successfully imported. User Profile installed as a plugin and saved. Your external wallet was sucessfully linked to your profile.",
UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR
)
}
}
}
@@ -106,10 +106,15 @@ function newGovernanceFunctionLibraryStakingProgram() {
userProfile.payload.blockchainTokens === undefined
) {
node.payload.stakingProgram.isActive = false
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.")
userProfile.payload.uiObject.setErrorMessage(
"Waiting for blockchain balance. It takes 6 seconds to load the balance of each profile, bacause you are using a free API provided by BSC Scan.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
} else {
userProfile.payload.uiObject.resetErrorMessage()
node.payload.stakingProgram.isActive = true
}
node.payload.stakingProgram.isActive = true
}
function distributeProgram(programNode) {
@@ -142,7 +147,10 @@ function newGovernanceFunctionLibraryStakingProgram() {
if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 }
if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) {
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
programNode.payload.uiObject.setErrorMessage(
"Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
programNode.payload.stakingProgram.awarded.tokens = programNode.payload.stakingProgram.ownPower / totalPowerRewardRatio
@@ -158,7 +166,7 @@ function newGovernanceFunctionLibraryStakingProgram() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' Staking Power')
node.payload.uiObject.setStatus(ownPowerText + ' Staking Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
@@ -168,7 +176,7 @@ function newGovernanceFunctionLibraryStakingProgram() {
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
node.tokensAwarded.payload.uiObject.valueAtAngle = false
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
}
}
}
@@ -174,8 +174,8 @@ function newGovernanceFunctionLibraryTokenMining() {
userProfile.tokensMined.payload.uiObject.valueAngleOffset = 0
userProfile.tokensMined.payload.uiObject.valueAtAngle = true
userProfile.tokensMined.payload.uiObject.setStatus(awarded + ' Awarded + ' + bonus + ' Bonus')
userProfile.tokensMined.payload.uiObject.setValue(total + ' SA Tokens' + tokensAwardedBTC)
userProfile.tokensMined.payload.uiObject.setStatus(awarded + ' Awarded + ' + bonus + ' Bonus', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
userProfile.tokensMined.payload.uiObject.setValue(total + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
}
}
}
@@ -96,7 +96,10 @@ function newGovernanceFunctionLibraryTokenPower() {
Before we start we will do some validations:
*/
if (userProfile.tokenPowerSwitch === undefined) {
userProfile.payload.uiObject.setErrorMessage("You need to have a Token Power Switch child node.")
userProfile.payload.uiObject.setErrorMessage(
"You need to have a Token Power Switch child node.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
distributeTokenPower(
@@ -119,7 +122,10 @@ function newGovernanceFunctionLibraryTokenPower() {
Before we start we will do some validations:
*/
if (userProfile.tokenPowerSwitch === undefined) {
userProfile.payload.uiObject.setErrorMessage("You need to have a Token Power Switch child node.")
userProfile.payload.uiObject.setErrorMessage(
"You need to have a Token Power Switch child node.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
distributeTokenPower(
@@ -213,7 +219,10 @@ function newGovernanceFunctionLibraryTokenPower() {
}
}
if (totalPercentage > 100) {
node.payload.uiObject.setErrorMessage('Token Power Switching Error. Total Percentage of children nodes is grater that 100.')
node.payload.uiObject.setErrorMessage(
'Token Power Switching Error. Total Percentage of children nodes is grater that 100.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
let defaultPercentage = 0
@@ -287,7 +296,7 @@ function newGovernanceFunctionLibraryTokenPower() {
node.payload.uiObject.valueAngleOffset = 0
node.payload.uiObject.valueAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' + ' + incomingPowerText)
node.payload.uiObject.setStatus(ownPowerText + ' + ' + incomingPowerText, UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
return
}
@@ -297,12 +306,14 @@ function newGovernanceFunctionLibraryTokenPower() {
node.payload.uiObject.valueAngleOffset = 180
node.payload.uiObject.valueAtAngle = true
node.payload.uiObject.setValue(tokenPowerText)
node.payload.uiObject.setValue(tokenPowerText, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
if (percentage !== undefined) {
node.payload.uiObject.percentageAngleOffset = 180
node.payload.uiObject.percentageAtAngle = true
node.payload.uiObject.setPercentage(percentage.toFixed(2))
node.payload.uiObject.setPercentage(percentage.toFixed(2),
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
}
}
}
@@ -173,7 +173,7 @@ function newGovernanceFunctionLibraryTokens() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = true
node.payload.uiObject.setStatus(status)
node.payload.uiObject.setStatus(status, UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
} else {
status = 'Reward: ' + tokens.toLocaleString('en')
+ ' ' + 'SA' + ' ≃ ' + UI.projects.governance.utilities.conversions.estimateSATokensInBTC(tokens | 0) + ' BTC '
@@ -181,7 +181,7 @@ function newGovernanceFunctionLibraryTokens() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(status)
node.payload.uiObject.setStatus(status, UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -334,7 +334,10 @@ function newGovernanceFunctionLibraryVotingProgram() {
}
}
if (totalPercentage > 100) {
node.payload.uiObject.setErrorMessage('Voting Power Switching Error. Total Percentage of children nodes is grater that 100.')
node.payload.uiObject.setErrorMessage(
'Voting Power Switching Error. Total Percentage of children nodes is grater that 100.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
let defaultPercentage = 0
@@ -406,7 +409,9 @@ function newGovernanceFunctionLibraryVotingProgram() {
drawProgram(node, userProfile)
if (percentage !== undefined) {
node.payload.uiObject.setPercentage(percentage.toFixed(2))
node.payload.uiObject.setPercentage(percentage.toFixed(2),
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
}
return
}
@@ -457,10 +462,12 @@ function newGovernanceFunctionLibraryVotingProgram() {
node.payload.uiObject.valueAngleOffset = 0
node.payload.uiObject.valueAtAngle = true
node.payload.uiObject.setValue(votesText)
node.payload.uiObject.setValue(votesText, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
if (percentage !== undefined) {
node.payload.uiObject.setPercentage(percentage.toFixed(2))
node.payload.uiObject.setPercentage(percentage.toFixed(2),
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
}
}
@@ -472,18 +479,20 @@ function newGovernanceFunctionLibraryVotingProgram() {
node.payload.uiObject.valueAngleOffset = 180
node.payload.uiObject.valueAtAngle = true
node.payload.uiObject.setValue(outgoingPowerText + ' Voting Power')
node.payload.uiObject.setValue(outgoingPowerText + ' Voting Power', UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
node.payload.uiObject.percentageAngleOffset = 180
node.payload.uiObject.percentageAtAngle = true
node.payload.uiObject.setPercentage(percentage)
node.payload.uiObject.setPercentage(percentage,
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
if (node.payload.referenceParent !== undefined) {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = true
node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power')
node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -502,7 +511,7 @@ function newGovernanceFunctionLibraryVotingProgram() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming Voting Power' + ' + ' + reputationPowerText + ' Reputation Power')
node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming Voting Power' + ' + ' + reputationPowerText + ' Reputation Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -510,7 +519,10 @@ function newGovernanceFunctionLibraryVotingProgram() {
function installMissingVotes(node, rootNodes) {
if (node.payload === undefined) { return }
if (node.payload.referenceParent === undefined) {
node.payload.uiObject.setErrorMessage('To install votes you need a Reference Parent')
node.payload.uiObject.setErrorMessage(
'To install votes you need a Reference Parent',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
scanNodeBranch(node, node.payload.referenceParent)
@@ -0,0 +1,11 @@
function newGovernanceGlobalsDesigner() {
let thisObject = {
SET_VALUE_COUNTER: 1000,
SET_STATUS_COUNTER: 1000,
SET_ERROR_COUNTER_FACTOR: 10,
SET_INFO_COUNTER_FACTOR: 10,
SET_WARNING_COUNTER: 1000,
SET_PERCENTAGE_COUNTER: 1000
}
return thisObject
}
@@ -46,6 +46,8 @@ function newGobernanceReportsSpace() {
if (isInitialized === false) { return }
hidAppDiv()
thisObject.container.finalize()
thisObject.container = undefined
@@ -215,22 +217,38 @@ function newGobernanceReportsSpace() {
if (isInitialized === false) { return }
docsAppDivPhysics()
}
function docsAppDivPhysics() {
let docsSpaceDiv = document.getElementById('governance-reports-space-div')
docsAppDivPosition = {
x: 0,
y: 0
}
docsAppDivPosition = thisObject.container.frame.frameThisPoint(docsAppDivPosition)
docsSpaceDiv.style = ' ' +
'overflow-y: scroll;' +
'overflow-x: hidden;' +
'position:fixed; top:' + docsAppDivPosition.y + 'px; ' +
'left:' + docsAppDivPosition.x + 'px; z-index:1; ' +
'width: ' + thisObject.container.frame.width + 'px;' +
'height: ' + thisObject.container.frame.height + 'px'
function docsAppDivPhysics() {
let docsSpaceDiv = document.getElementById('governance-reports-space-div')
docsAppDivPosition = {
x: 0,
y: 0
}
docsAppDivPosition = thisObject.container.frame.frameThisPoint(docsAppDivPosition)
docsSpaceDiv.style = ' ' +
'overflow-y: scroll;' +
'overflow-x: hidden;' +
'position:fixed; top:' + docsAppDivPosition.y + 'px; ' +
'left:' + docsAppDivPosition.x + 'px; z-index:1; ' +
'width: ' + thisObject.container.frame.width + 'px;' +
'height: ' + thisObject.container.frame.height + 'px'
}
function hidAppDiv() {
let docsSpaceDiv = document.getElementById('governance-reports-space-div')
docsAppDivPosition = {
x: 100000000000,
y: 0
}
docsAppDivPosition = thisObject.container.frame.frameThisPoint(docsAppDivPosition)
docsSpaceDiv.style = ' ' +
'overflow-y: scroll;' +
'overflow-x: hidden;' +
'position:fixed; top:' + docsAppDivPosition.y + 'px; ' +
'left:' + docsAppDivPosition.x + 'px; z-index:1; ' +
'width: ' + thisObject.container.frame.width + 'px;' +
'height: ' + thisObject.container.frame.height + 'px'
}
function getContainer(point, purpose) {
@@ -16,11 +16,18 @@ function newGovernanceUserProfileSpace() {
let waitingForResponses = 0
const BSC_SCAN_RATE_LIMIT_DELAY = 6000
const DISTRIBUTION_PROCESS_RECALCULATION_DELAY = 5000
let intervalId
let reputationByAddress = new Map()
return thisObject
function initialize() {
/*
Here we will run the distribution process, that in turn will run all the programs.
*/
intervalId = setInterval(UI.projects.governance.functionLibraries.distributionProcess.calculate, DISTRIBUTION_PROCESS_RECALCULATION_DELAY)
/*
Here we will get a list of all github usernames who have a star or fork and are watching the
Superalgos Repository. This will later be used to know which user profiles are participating
@@ -292,6 +299,9 @@ function newGovernanceUserProfileSpace() {
}
function finalize() {
clearInterval(intervalId)
intervalId = undefined
thisObject.githubStars = undefined
thisObject.githubWatchers = undefined
thisObject.githubForks = undefined
@@ -320,10 +330,6 @@ function newGovernanceUserProfileSpace() {
function physics() {
if (UI.projects.foundations.spaces.designSpace.workspace === undefined) { return }
/*
Here we will run the distribution process, that in turn will run all the programs.
*/
UI.projects.governance.functionLibraries.distributionProcess.calculate()
/*
Load the user profiles with Token Power.
*/
let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile')
@@ -359,7 +365,10 @@ function newGovernanceUserProfileSpace() {
function onResponse(err, data) {
/* Lets check the result of the call through the http interface */
if (err.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
userProfile.payload.uiObject.setErrorMessage('Call via HTTP Interface failed.')
userProfile.payload.uiObject.setErrorMessage(
'Call via HTTP Interface failed.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
@@ -367,7 +376,10 @@ function newGovernanceUserProfileSpace() {
/* Lets check the result of the method call */
if (response.result !== GLOBAL.DEFAULT_OK_RESPONSE.result) {
userProfile.payload.uiObject.setErrorMessage('Call to WEB3 Server failed. ' + response.error)
userProfile.payload.uiObject.setErrorMessage(
'Call to WEB3 Server failed. ' + response.error,
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
console.log('Call to WEB3 Server failed. ' + response.error)
return
}
@@ -397,7 +409,9 @@ function newGovernanceUserProfileSpace() {
if (data.result === "Max rate limit reached, please use API Key for higher rate limit") {
userProfile.payload.blockchainTokens = undefined // This enables this profile to query the blockchain again.
} else {
userProfile.payload.uiObject.setInfoMessage(data)
userProfile.payload.uiObject.setInfoMessage(data,
UI.projects.governance.globals.designer.SET_INFO_COUNTER_FACTOR
)
userProfile.payload.blockchainTokens = Number(data.result) / 1000000000000000000
userProfile.payload.reputation = Math.min(reputationByAddress.get(blockchainAccount.toLowerCase()) | 0, userProfile.payload.blockchainTokens)
}
@@ -406,7 +420,9 @@ function newGovernanceUserProfileSpace() {
const message = err.message + ' - ' + 'Can not access BSC SCAN servers.'
console.log(message)
if (userProfile.payload !== undefined) {
userProfile.payload.uiObject.setErrorMessage(message, 1000)
userProfile.payload.uiObject.setErrorMessage(message,
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
}
waitingForResponses--
});
@@ -101,8 +101,13 @@ function newGovernanceUtilitiesBonusProgram() {
userProfile.payload.blockchainTokens === undefined
) {
node.payload[programPropertyName].isActive = false
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.")
userProfile.payload.uiObject.setErrorMessage(
"Waiting for blockchain balance. It takes 6 seconds to load the balance of each profile, bacause you are using a free API provided by BSC Scan.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
} else {
userProfile.payload.uiObject.resetErrorMessage()
}
}
@@ -135,7 +140,10 @@ function newGovernanceUtilitiesBonusProgram() {
if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 }
if (programNode.tokensBonus === undefined || programNode.tokensBonus.payload === undefined) {
programNode.payload.uiObject.setErrorMessage("Tokens Bonus Node is needed in order for this Program to get Tokens from the Bonus Program Pool.")
programNode.payload.uiObject.setErrorMessage(
"Tokens Bonus Node is needed in order for this Program to get Tokens from the Bonus Program Pool.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
programNode.payload[programPropertyName].bonus.tokens = programNode.payload[programPropertyName].bonusPower / totalPowerRewardRatio
@@ -152,7 +160,7 @@ function newGovernanceUtilitiesBonusProgram() {
node.tokensBonus.payload.uiObject.valueAngleOffset = 0
node.tokensBonus.payload.uiObject.valueAtAngle = true
node.tokensBonus.payload.uiObject.setValue(tokensBonusText + ' SA Tokens' + tokensAwardedBTC)
node.tokensBonus.payload.uiObject.setValue(tokensBonusText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
}
}
}
@@ -168,8 +168,13 @@ function newGovernanceUtilitiesDecendentProgram() {
userProfile.payload.blockchainTokens === undefined
) {
node.payload[programPropertyName].isActive = false
userProfile.payload.uiObject.setErrorMessage("You need to setup this profile with the Profile Constructor, to access the Token Power of your account at the Blockchain.")
userProfile.payload.uiObject.setErrorMessage(
"Waiting for blockchain balance. It takes 6 seconds to load the balance of each profile, bacause you are using a free API provided by BSC Scan.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
} else {
userProfile.payload.uiObject.resetErrorMessage()
}
/*
As per the system rules, the Program will not give tokens
@@ -182,7 +187,10 @@ function newGovernanceUtilitiesDecendentProgram() {
(node[usersArrayPropertyName] === undefined || hasUsersDefined(node[usersArrayPropertyName]) === false)
) {
node.payload[programPropertyName].isActive = false
node.payload.uiObject.setErrorMessage("In order to enable this program you need to add " + userNodeType + " nodes and reference a User Profile from each one.")
node.payload.uiObject.setErrorMessage(
"In order to enable this program you need to add " + userNodeType + " nodes and reference a User Profile from each one.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
} else {
node.payload[programPropertyName].isActive = true
}
@@ -282,7 +290,10 @@ function newGovernanceUtilitiesDecendentProgram() {
}
}
if (totalPercentage > 100) {
node.payload.uiObject.setErrorMessage('Program Power Switching Error. Total Percentage of children nodes is grater that 100.')
node.payload.uiObject.setErrorMessage(
'Program Power Switching Error. Total Percentage of children nodes is grater that 100.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
let defaultPercentage = 0
@@ -371,7 +382,10 @@ function newGovernanceUtilitiesDecendentProgram() {
if (totalPowerRewardRatio < 1) { totalPowerRewardRatio = 1 }
if (programNode.tokensAwarded === undefined || programNode.tokensAwarded.payload === undefined) {
programNode.payload.uiObject.setErrorMessage("Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.")
programNode.payload.uiObject.setErrorMessage(
"Tokens Awarded Node is needed in order for this Program to get Tokens from the Program Pool.",
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
programNode.payload[programPropertyName].awarded.tokens = programNode.payload[programPropertyName].incomingPower / totalPowerRewardRatio
@@ -387,17 +401,19 @@ function newGovernanceUtilitiesDecendentProgram() {
node.payload.uiObject.valueAngleOffset = 180
node.payload.uiObject.valueAtAngle = true
node.payload.uiObject.setValue(outgoingPowerText + ' ' + programPowerName)
node.payload.uiObject.setValue(outgoingPowerText + ' ' + programPowerName, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
node.payload.uiObject.percentageAngleOffset = 180
node.payload.uiObject.percentageAtAngle = true
node.payload.uiObject.setPercentage(percentage)
node.payload.uiObject.setPercentage(percentage,
UI.projects.governance.globals.designer.SET_PERCENTAGE_COUNTER
)
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = true
node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power')
node.payload.uiObject.setStatus(outgoingPowerText + ' ' + ' Outgoing Power', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
@@ -410,7 +426,7 @@ function newGovernanceUtilitiesDecendentProgram() {
node.payload.uiObject.statusAngleOffset = 0
node.payload.uiObject.statusAtAngle = false
node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming ' + programPowerName)
node.payload.uiObject.setStatus(ownPowerText + ' Own Power' + ' + ' + incomingPowerText + ' Incoming ' + programPowerName, UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
if (node.tokensAwarded !== undefined && node.tokensAwarded.payload !== undefined) {
@@ -422,8 +438,8 @@ function newGovernanceUtilitiesDecendentProgram() {
node.tokensAwarded.payload.uiObject.valueAngleOffset = 0
node.tokensAwarded.payload.uiObject.valueAtAngle = true
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC)
node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Descendants.')
node.tokensAwarded.payload.uiObject.setValue(tokensAwardedText + ' SA Tokens' + tokensAwardedBTC, UI.projects.governance.globals.designer.SET_VALUE_COUNTER)
node.tokensAwarded.payload.uiObject.setStatus('From ' + node.payload[programPropertyName].count + ' Descendants.', UI.projects.governance.globals.designer.SET_STATUS_COUNTER)
}
}
}
@@ -12,7 +12,10 @@ function newGovernanceUtilitiesValidations () {
let programs = UI.projects.foundations.utilities.branches.nodeBranchToArray(userProfile, programNodeType)
if (programs !== undefined) {
if (programs.length > 1) {
userProfile.payload.uiObject.setErrorMessage('Only one ' + programNodeType + ' is allowed.')
userProfile.payload.uiObject.setErrorMessage(
'Only one ' + programNodeType + ' is allowed.',
UI.projects.governance.globals.designer.SET_ERROR_COUNTER_FACTOR
)
return
}
if (programs.length === 1) {
@@ -9,12 +9,16 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
let clientInterface
let peerInterface
let web3 = new SA.nodeModules.web3()
return thisObject
function finalize() {
socketServer = undefined
clientInterface = undefined
peerInterface = undefined
web3 = undefined
}
function initialize() {
@@ -31,6 +35,8 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
function onConnection(socket) {
let caller = {}
let calledTimestamp = (new Date()).valueOf()
socket.on('message', onMenssage)
async function onMenssage(message) {
@@ -60,7 +66,7 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
switch (messageHeader.messageType) {
case "Handshake": {
handshakeProducedure(socket, caller, messageHeader)
handshakeProducedure(socket, caller, calledTimestamp, messageHeader)
break
}
case "Request": {
@@ -88,6 +94,14 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
}
break
}
default: {
let response = {
result: 'Error',
message: 'messageType Not Supported.'
}
socket.send(JSON.stringify(response))
break
}
}
} catch (err) {
console.log('[ERROR] Web Sockets Interface -> setUpWebSocketServer -> err.stack = ' + err.stack)
@@ -95,75 +109,214 @@ exports.newNetworkModulesWebSocketsInterface = function newNetworkModulesWebSock
}
}
function handshakeProducedure(socket, caller, messageHeader) {
function handshakeProducedure(socket, caller, calledTimestamp, messageHeader) {
/*
The caller needs to identify itself as either a Network Client or Peer.
The handshage producedure have 2 steps, we need to know
now which one we are at.
*/
if (messageHeader.callerRole === undefined) {
if (messageHeader.step === undefined) {
let response = {
result: 'Error',
message: 'callerRole Not Provided.'
message: 'step Not Provided.'
}
socket.send(JSON.stringify(response))
return
}
if (messageHeader.callerRole !== 'Network Client' && messageHeader.callerRole !== 'Network Peer') {
if (messageHeader.step !== 'One' && messageHeader.step !== 'Two') {
let response = {
result: 'Error',
message: 'callerRole Not Supported.'
message: 'step Not Supported.'
}
socket.send(JSON.stringify(response))
return
}
switch (messageHeader.step) {
case 'One': {
handshakeStepOne()
break
}
case 'Two': {
handshakeStepTwo()
break
}
}
function handshakeStepOne() {
/*
The caller needs to identify itself as either a Network Client or Peer.
*/
if (messageHeader.callerRole === undefined) {
let response = {
result: 'Error',
message: 'callerRole Not Provided.'
}
socket.send(JSON.stringify(response))
return
}
if (messageHeader.callerRole !== 'Network Client' && messageHeader.callerRole !== 'Network Peer') {
let response = {
result: 'Error',
message: 'callerRole Not Supported.'
}
socket.send(JSON.stringify(response))
return
}
caller.role = messageHeader.callerRole
/*
The caller needs to provide it's User Profile Handle.
*/
if (messageHeader.callerProfileHandle === undefined) {
let response = {
result: 'Error',
message: 'callerProfileHandle Not Provided.'
}
socket.send(JSON.stringify(response))
return
}
caller.userProfileHandle = messageHeader.callerProfileHandle
/*
The caller needs to provide a callerTimestamp.
*/
if (messageHeader.callerTimestamp === undefined) {
let response = {
result: 'Error',
message: 'callerTimestamp Not Provided.'
}
socket.send(JSON.stringify(response))
return
}
/*
The callerTimestamp can not be more that 1 minute old.
*/
if (calledTimestamp - messageHeader.callerTimestamp > 60000) {
let response = {
result: 'Error',
message: 'callerTimestamp Too Old.'
}
socket.send(JSON.stringify(response))
return
}
/*
We will sign for the caller it's handle to prove our
Network Node identity.
*/
let signedMessage = {
callerProfileHandle: messageHeader.callerProfileHandle,
calledProfileHandle: NT.NETWORK_NODE_USER_PROFILE_HANDLE,
callerTimestamp: messageHeader.callerTimestamp,
calledTimestamp: calledTimestamp
}
let signature = web3.eth.accounts.sign(JSON.stringify(signedMessage), NT.NETWORK_NODE_USER_PROFILE_PRIVATE_KEY)
caller.role = messageHeader.callerRole
/*
We will identify the caller by the signature at the message.
*/
if (messageHeader.signature === undefined) {
let response = {
result: 'Error',
message: 'signature Not Provided.'
result: 'Ok',
message: 'Handshake Step One Complete',
signature: JSON.stringify(signature)
}
socket.send(JSON.stringify(response))
return
}
let web3 = new SA.nodeModules.web3()
let blockchainAccount = web3.eth.accounts.recover(messageHeader.signature)
function handshakeStepTwo() {
/*
We will check that the caller role has beed defined at Step One.
*/
if (caller.role === undefined) {
let response = {
result: 'Error',
message: 'Handshake Step One Not Completed.'
}
socket.send(JSON.stringify(response))
return
}
/*
We will check the signature at the message.
*/
if (messageHeader.signature === undefined) {
let response = {
result: 'Error',
message: 'signature Not Provided.'
}
socket.send(JSON.stringify(response))
return
}
let signature = JSON.parse(messageHeader.signature)
caller.blockchainAccount = web3.eth.accounts.recover(signature)
if (caller.blockchainAccount === undefined) {
let response = {
result: 'Error',
message: 'Bad Signature.'
}
socket.send(JSON.stringify(response))
return
}
/*
The signature gives us the blockchain account, and the account the user profile.
*/
let witnessUserProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_BLOCHAIN_ACCOUNT.get(caller.blockchainAccount)
if (witnessUserProfile === undefined) {
let response = {
result: 'Error',
message: 'userProfile Not Found.'
}
socket.send(JSON.stringify(response))
return
}
/*
The user profile based on the blockchain account, based on the signature,
it is our witness user profile, to validate the caller.
*/
let signedMessage = JSON.parse(signature.message)
if (signedMessage.callerProfileHandle !== witnessUserProfile.userProfileHandle) {
let response = {
result: 'Error',
message: 'callerProfileHandle Does Not Match witnessUserProfile.'
}
socket.send(JSON.stringify(response))
return
}
/*
We will check that the signature includes this Network Node handle, to avoid
man in the middle attackts.
*/
if (signedMessage.calledProfileHandle !== NT.NETWORK_NODE_USER_PROFILE_HANDLE) {
let response = {
result: 'Error',
message: 'calledProfileHandle Does Not Match This Network Node Handle.'
}
socket.send(JSON.stringify(response))
return
}
/*
We will check that the timestamp in the signature is the one we sent to the caller.
*/
if (signedMessage.calledTimestamp !== calledTimestamp) {
let response = {
result: 'Error',
message: 'calledTimestamp Does Not Match calledTimestamp On Record.'
}
socket.send(JSON.stringify(response))
return
}
/*
All validations have been completed, the Handshake Prcedure finished well.
*/
/*
We will remember the user profile behind this caller.
*/
caller.userProfile = witnessUserProfile
if (caller.blockchainAccount === undefined) {
let response = {
result: 'Error',
message: 'Bad signature.'
result: 'Ok',
message: 'Handshake Successful.'
}
socket.send(JSON.stringify(response))
return
}
/*
The signature gives us the blockchain account, and the account the user profile.
*/
let userProfile = NT.projects.socialTrading.globals.memory.maps.USER_PROFILES_BY_BLOCHAIN_ACCOUNT.set(blockchainAccount)
if (userProfile === undefined) {
let response = {
result: 'Error',
message: 'userProfile Not Found.'
}
socket.send(JSON.stringify(response))
return
}
/*
We will remember the user profile behind this caller.
*/
caller.userProfile = userProfile
let response = {
result: 'Ok',
message: 'Handshake Successful.'
}
socket.send(JSON.stringify(response))
}
} catch (err) {
+211 -59
View File
@@ -7,7 +7,10 @@ exports.newNetworkModulesWebSocketsClient = function newNetworkModulesWebSockets
}
let socketClient
let callbackFunction
let web3 = new SA.nodeModules.web3()
let called = {}
let selectedNetworkNode // This is a Network Node we pick to try to connect to.
return thisObject
@@ -16,86 +19,235 @@ exports.newNetworkModulesWebSocketsClient = function newNetworkModulesWebSockets
socketClient = undefined
networkInterface = undefined
peerInterface = undefined
web3 = undefined
called = undefined
}
function initialize() {
socketClient = new SA.nodeModules.ws('ws://' + 'localhost' + ':' + global.env.NETWORK_WEB_SOCKETS_INTERFACE_PORT)
//networkInterface = SA.projects.socialTrading.modules.networkInterface.newSocialTradingModulesNetworkInterface()
async function initialize() {
/*
Here we will pick a Network Node from all users profiles available that do have a Network Node running. // TODO
In the meantime, we will assume that we have chosen the following Network Node to connect to.
{
"githubUsername": "Test-Network-Node-Profile",
"address": "0xa153469c57A91F5a59Fc6c45A37aD8dbad85e417"
}
*/
selectedNetworkNode = {
userProfileHandle: "Test-Network-Node-Profile",
blockchainAccount: "0xa153469c57A91F5a59Fc6c45A37aD8dbad85e417",
ranking: 0,
host: "localhost",
port: global.env.NETWORK_WEB_SOCKETS_INTERFACE_PORT
}
setUpWebsocketClient()
socketClient = new SA.nodeModules.ws('ws://' + selectedNetworkNode.host + ':' + selectedNetworkNode.port)
await setUpWebsocketClient()
}
function setUpWebsocketClient() {
try {
let handshakeDone = false
async function setUpWebsocketClient() {
socketClient.onopen = () => { onConnection() }
socketClient.onmessage = socketMessage => { onMenssage(socketMessage) }
socketClient.onerror = err => { onError(err) }
return new Promise(connectToNewtwork)
function onConnection() {
/*
Send Handshake Message
*/
socketClient.send('Handshake Message')
console.log('Handshake Message Sent')
function connectToNewtwork(resolve, reject) {
try {
socketClient.onopen = () => { onConnection() }
socketClient.onerror = err => { onError(err) }
function onConnection() {
handshakeProcedure()
function handshakeProcedure() {
let callerTimestamp
stepOneRequest()
function stepOneRequest() {
/*
Send Handshake Message Step One:
At Step One we will just say hello, identify ourselves
as a Network Client, and send the Network Node our
User Profile Handle.
This Handle will be signed by the Network Node to prove
it's ouwn identity, and later we will sign it's own handle
to prove ours.
*/
socketClient.onmessage = socketMessage => { stepOneResponse(socketMessage) }
callerTimestamp = (new Date()).valueOf()
let message = {
messageType: 'Handshake',
callerRole: 'Network Client',
callerProfileHandle: DK.TEST_NETWORK_CLIENT_USER_PROFILE_HANDLE,
callerTimestamp: callerTimestamp,
step: 'One'
}
socketClient.send(JSON.stringify(message))
}
function stepOneResponse(socketMessage) {
let response = JSON.parse(socketMessage.data)
if (response.result !== 'Ok') {
console.log('[ERROR] Web Sockets Client -> stepOneResponse -> response.message = ' + response.message)
reject()
return
}
let signature = JSON.parse(response.signature)
called.blockchainAccount = web3.eth.accounts.recover(signature)
/*
We will check that the signature received produces a valid Blockchain Account.
*/
if (called.blockchainAccount === undefined) {
console.log('[ERROR] Web Sockets Client -> stepOneResponse -> Signature does not produce a valid Blockchain Account.')
reject()
return
}
/*
We will check that the blockchain account taken from the signature matches
the one we have on record for the user profile of the Network Node we are calling.
*/
if (called.blockchainAccount !== selectedNetworkNode.blockchainAccount) {
console.log('[ERROR] Web Sockets Client -> stepOneResponse -> The Network Node called does not have the expected Profile Handle.')
reject()
return
}
let signedMessage = JSON.parse(signature.message)
/*
We will check that the Network Node that responded has the same User Profile Handle
that we have on record, otherwise something is wrong and we should not proceed.
*/
if (signedMessage.calledProfileHandle !== selectedNetworkNode.userProfileHandle) {
console.log('[ERROR] Web Sockets Client -> stepOneResponse -> The Network Node called does not have the expected Profile Handle.')
reject()
return
}
/*
We will check that the profile handle we sent to the Network Node, is returned at the
signed message, to avoid man in the middle attackts.
*/
if (signedMessage.callerProfileHandle !== DK.TEST_NETWORK_CLIENT_USER_PROFILE_HANDLE) {
console.log('[ERROR] Web Sockets Client -> stepOneResponse -> The Network Node callerProfileHandle does not match my own userProfileHandle.')
reject()
return
}
/*
We will also check that the callerTimestamp we sent to the Network Node, is returned at the
signed message, also to avoid man in the middle attackts.
*/
if (signedMessage.callerTimestamp !== callerTimestamp) {
console.log('[ERROR] Web Sockets Client -> stepOneResponse -> The Network Node callerTimestamp does not match my own callerTimestamp.')
reject()
return
}
/*
All validations passed, it seems we can continue with Step Two.
*/
stepTwoRequest(signedMessage)
}
function stepTwoRequest(signedMessage) {
/*
Send Handshake Message Step Two:
Here we will sign a message with the Network Node profile
handle and timestamp to prove our own identity.
*/
socketClient.onmessage = socketMessage => { stepTwoResponse(socketMessage) }
let signature = web3.eth.accounts.sign(JSON.stringify(signedMessage), DK.TEST_NETWORK_CLIENT_USER_PROFILE_PRIVATE_KEY)
let message = {
messageType: 'Handshake',
signature: JSON.stringify(signature),
step: 'Two'
}
socketClient.send(JSON.stringify(message))
}
function stepTwoResponse(socketMessage) {
let response = JSON.parse(socketMessage.data)
if (response.result !== 'Ok') {
console.log('[ERROR] Web Sockets Client -> stepOneResponse -> response.message = ' + response.message)
reject()
return
}
console.log('[INFO] Web Sockets Client -> stepTwoResponse -> response.message = ' + response.message)
/*
This was the end of the Handshake producere. We are connected to the
Network Node and from now on, all response messages will be received
at this following function.
*/
resolve()
}
}
}
function onError(err) {
console.log('[ERROR] Web Sockets Client -> onError -> err.message = ' + err.message)
console.log('[ERROR] Web Sockets Client -> onError -> err.stack = ' + err.stack)
}
} catch (err) {
console.log('[ERROR] Web Sockets Client -> setUpWebsocketClient -> err.stack = ' + err.stack)
}
async function onMenssage(socketMessage) {
}
}
function sendMessage(message) {
return new Promise(sendSocketMessage)
function sendSocketMessage(resolve, reject) {
if (socketClient.readyState !== 1) { // 1 means connected and ready.
console.log('[ERROR] Web Sockets Client -> sendMessage -> Cannot send message while connection is closed.')
reject('Websockets Connection Not Ready.')
}
let socketMessage = {
messageType: 'Request',
payload: message
}
socketClient.onmessage = socketMessage => { onMenssage(socketMessage) }
socketClient.send(
JSON.stringify(socketMessage)
)
function onMenssage(socketMessage) {
try {
let response = JSON.parse(socketMessage.data)
/*
Chack if we are waiting for the Handshake response.
*/
if (handshakeDone === false) {
if (response.result === 'Ok') {
handshakeDone = true
return
} else {
console.log('[ERROR] Web Sockets Client -> onMenssage -> handshakeDone -> message.response = ' + response.message)
return
}
}
callbackFunction.receiveResponse(message)
callbackFunction = undefined
if (response.result === 'Ok') {
resolve(response.data)
} else {
console.log('[ERROR] Web Sockets Client -> onMenssage -> response.message = ' + response.message)
reject(response.message)
}
} catch (err) {
callbackFunction = undefined
console.log('[ERROR] Web Sockets Client -> err.stack = ' + err.stack)
}
}
function onError(err) {
console.log('[ERROR] Web Sockets Client -> onError -> err.message = ' + err.message)
console.log('[ERROR] Web Sockets Client -> onError -> err.stack = ' + err.stack)
}
} catch (err) {
console.log('[ERROR] Web Sockets Client -> setUpWebsocketClient -> err.stack = ' + err.stack)
}
}
function sendMessage(message, callback) {
if (callbackFunction !== undefined) {
console.log('[ERROR] Web Sockets Client -> sendMessage -> Cannot send more messages while waiting for a response.')
return false
}
if (socketClient.readyState !== 1) { // 1 means connected and ready.
console.log('[ERROR] Web Sockets Client -> sendMessage -> Cannot send message while connection is closed.')
return false
}
try {
callbackFunction = callback
socketClient.send(message)
return true
} catch (err) {
callbackFunction = false
console.log('[ERROR] Web Sockets Client -> sendMessage -> err.stack = ' + err.stack)
return false
}
}
}
Loaded 100 of 115 files, more files were not shown because too many files have changed in this diff. Show more