diff --git a/README.md b/README.md index d100782..1127313 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # apXtrib a Decentralized Autonomous Organisation (DAO) -You are here on the tech side, to understand under the wood how it's work and how you can contribute to this tech journey. +You are here on the tech side, to understand under the wood how it works and how you can contribute to this tech journey. See [apXtrib web site](https://apxtrib.crabdance.com) how to create a new social world with apXtrib. ## apXtrib Architecture a quick view & keywords definition @@ -13,13 +13,13 @@ See [apXtrib web site](https://apxtrib.crabdance.com) how to create a new social - **a mayor** is a owner of a physical machine, he is in charge to make a town node working (IP availibily) and accept to be part of a nation (rules of the blockchain nation). - **a contract** is an algorythme that is written into the blockchain and will be run if an action trig. Immutable contract are the one link to the blockchain. Any pagan/druid/major can defined a contract that apply to other pagans. - **the XTRIB coin** is the token that drive the blockchain, it materialises an exchange value and is a conterpoint -- **a git apxtrib** is a package ready to install a town by a mayor that will be able to join a nation (then it accepts nation rules). You can also create a nation and stay alone or not. Then mayor will be able to receive druid request to create a tribe. Then druid will invite pagan to join a tribe... +- **a git apxtrib** is a package ready to install a town by a mayor into a physical server that will be able to join a nation (mean accept thoses nation rules). You can also create a nation and stay alone or not. Then mayor will be able to host druid request to create tribe. Then druid will invite pagan to join his tribe... -All actors will have the same target to respect contracts and are free to leave or to stay into a nation, a town or a tribe. If a contract is not fair, then a nation, tribe, will not create value. +All actors will have the same target to respect contracts and are free to leave or to stay into a nation, a town or a tribe. If a contract is not fair, then a nation, tribe, will be empty mean not creating value mean die. Only fair rules will survive but any try will rewards actor with XTRIB coin. ## Network topology -As it is a decentralize organisation, a public address directory is replicated on each instance of a town into /nationchains .
+As it is decentralize organisation, a public address directory is replicated on each instance of a town into /nationchains .
Each town (instance) is accessible with an anonymlous DNS https://apxtrib.crabdance.com where the IP adresse is update when elected town's IP to register a new block into the blockchain (each 10minutes). ``` diff --git a/middlewares/checkHeaders.js b/middlewares/checkHeaders.js index ecf34ef..6176fd5 100755 --- a/middlewares/checkHeaders.js +++ b/middlewares/checkHeaders.js @@ -3,7 +3,7 @@ const path = require( 'path' ); // Check if package is installed or not to pickup the right config file //const src = ( __dirname.indexOf( '/node_modules/' ) > -1 ) ? '../../..' : '..'; //const config = require( path.normalize( `${__dirname}/${src}/config.js` ) ); -const config = require( '../config.js' ); +const config = require( '../tribes/townconf.js' ); /* Check que le header contient des éléments necessaire pour les routes utilisant tribeid / language / token / uuid diff --git a/middlewares/hasAccessrighton.js b/middlewares/hasAccessrighton.js index 8b300e0..2d1290e 100755 --- a/middlewares/hasAccessrighton.js +++ b/middlewares/hasAccessrighton.js @@ -2,7 +2,7 @@ const fs = require( 'fs-extra' ); const glob = require( 'glob' ); const path = require( 'path' ); -const config = require( '../config.js' ); +const config = require( '../tribes/townconf.js' ); const hasAccessrighton = ( object, action, ownby ) => { /* diff --git a/middlewares/isAuthenticated.js b/middlewares/isAuthenticated.js index 2ecbed0..e041140 100755 --- a/middlewares/isAuthenticated.js +++ b/middlewares/isAuthenticated.js @@ -7,7 +7,7 @@ const glob = require( 'glob' ); // Check if package is installed or not to pickup the right config file //const src = '..'; // ( __dirname.indexOf( '/node_modules/' ) > -1 ) ? '../../..' : '..'; //const config = require( path.normalize( `${__dirname}/${src}/config.js` ) ); -const config = require( '../config.js' ); +const config = require( '../tribes/townconf.js' ); const isAuthenticated = ( req, res, next ) => { /* check if authenticated with valid token diff --git a/models/Messages.js b/models/Messages.js index 7143952..e1d5465 100755 --- a/models/Messages.js +++ b/models/Messages.js @@ -9,7 +9,7 @@ const { DateTime } = require( 'luxon' ); const UUID = require( 'uuid' ); const Outputs = require( '../models/Outputs.js' ); const config = require( '../tribes/townconf.js' ); -const checkdata = require( `${config.tribes}/${config.mayorId}/www/cdn/public/js/checkdata` ); +const checkdata = require( `../nationchains/socialworld/contracts/checkdata.js`); /* Message manager * Manage apixtribe message at different level diff --git a/models/Nationchains.js b/models/Nationchains.js index ce1dc8b..abdccc9 100755 --- a/models/Nationchains.js +++ b/models/Nationchains.js @@ -9,7 +9,7 @@ const axios = require( 'axios' ); const UUID = require( 'uuid' ); const Outputs = require( './Outputs.js' ); const config = require( '../tribes/townconf.js' ); -const checkdata = require( `${config.tribes}/${config.mayorId}/www/cdn/public/js/checkdata` ); +const checkdata = require( `../nationchains/socialworld/contracts/checkdata.js`); /* Blockchain manager * Manage network directory diff --git a/models/Outputs.js b/models/Outputs.js index 8067193..651d687 100755 --- a/models/Outputs.js +++ b/models/Outputs.js @@ -11,7 +11,7 @@ const smtpTransport = require( 'nodemailer-smtp-transport' ); const axios = require( 'axios' ); const { GoogleSpreadsheet } = require( 'google-spreadsheet' ); const config = require( '../tribes/townconf.js' ); -const checkdata = require( `${config.tribes}/${config.mayorId}/www/cdn/public/js/checkdata` ); +const checkdata = require( `../nationchains/socialworld/contracts/checkdata.js` ); const Outputs = {}; diff --git a/models/Pagans.js b/models/Pagans.js index 98d28fc..a003301 100755 --- a/models/Pagans.js +++ b/models/Pagans.js @@ -7,7 +7,8 @@ const jwt = require( 'jwt-simple' ); const UUID = require( 'uuid' ); const Outputs = require( './Outputs.js' ); const config = require( '../tribes/townconf.js' ); -const checkdata = require( `${config.tribes}/${config.mayorId}/www/cdn/public/js/checkdata` ); +const checkdata = require( `../nationchains/socialworld/contracts/checkdata.js`); + /* Gestion des utilisateurs connecte diff --git a/models/Tribes.js b/models/Tribes.js index fc517e8..b8b0ecc 100755 --- a/models/Tribes.js +++ b/models/Tribes.js @@ -13,8 +13,7 @@ const Outputs = require( './Outputs.js' ); const Pagans = require( './Pagans.js' ); const config = require( '../tribes/townconf.js' ); -const checkdata = require( `${config.tribes}/${config.mayorId}/www/cdn/public/js/checkdata` ); - +const checkdata = require( `../nationchains/socialworld/contracts/checkdata.js`); /* tribeid manager diff --git a/package.json b/package.json index 2c3aaaf..07852fd 100755 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "glob": "^7.1.2", "google-spreadsheet": "^3.1.15", "html-to-text": "^5.1.1", - "iconv": "^3.0.1", "jquery": "^3.6.0", "js-beautify": "^1.14.0", "jsdom": "^11.11.0", @@ -124,7 +123,6 @@ "uuid": "^3.2.1" }, "devDependencies": { - "nodemon": "^1.17.3", - "request": "^2.85.0" + "nodemon": "^1.17.3" } } diff --git a/routes/nationchains.js b/routes/nationchains.js index f651265..9890e28 100755 --- a/routes/nationchains.js +++ b/routes/nationchains.js @@ -1,5 +1,5 @@ const express = require( 'express' ); -const config = require( '../config.js' ); +const config = require( '../tribes/townconf.js' ); // Classes const Nationchains = require( '../models/Nationchains.js' );