diff --git a/README.md b/README.md
index a184eef9..c3d8dc2d 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,7 @@ The KAIZEN Platform is currently in experimental alpha.
- [Bluzelle](https://www.npmjs.com/package/bluzelle)
- [NKN](https://www.npmjs.com/package/nkn-client)
- [ICON](https://www.npmjs.com/package/icon-sdk-js)
+- [Orbit](https://www.npmjs.com/package/orbit-db)
- NOIA
## 🚰 Faucet
@@ -104,5 +105,8 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for how to help out.
*Quick Start*: Check out [help wanted](https://github.com/PortalNetwork/kaizen-cli/labels/help%20wanted) or [good first issue](https://github.com/PortalNetwork/kaizen-cli/labels/good%20first%20issue) labels to find issues we want to move forward on with your help.
+## 📧 Contact
+For any questions, please contact chris@portal.network or join telegram: [http://bit.ly/2XjhQV2](http://bit.ly/2XjhQV2)
+
## 🗒 Licence
See [LICENSE](./LICENSE) for details.
diff --git a/README_KR.md b/README_KR.md
index 835e8c70..59c1a0df 100644
--- a/README_KR.md
+++ b/README_KR.md
@@ -80,6 +80,7 @@ The KAIZEN Platform is currently in experimental alpha.
- [Bluzelle](https://www.npmjs.com/package/bluzelle)
- [NKN](https://www.npmjs.com/package/nkn-client)
- [ICON](https://www.npmjs.com/package/icon-sdk-js)
+- [Orbit](https://www.npmjs.com/package/orbit-db)
- NOIA
## 🚰 水龍頭
@@ -104,5 +105,8 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md) for how to help out.
*Quick Start*: Check out [help wanted](https://github.com/PortalNetwork/kaizen-cli/labels/help%20wanted) or [good first issue](https://github.com/PortalNetwork/kaizen-cli/labels/good%20first%20issue) labels to find issues we want to move forward on with your help.
+## 📧 Contact
+For any questions, please contact chris@portal.network or join telegram: [http://bit.ly/2XjhQV2](http://bit.ly/2XjhQV2)
+
## 🗒 라이센스
[LICENSE](./LICENSE) 참조하기
diff --git a/README_ZH.md b/README_ZH.md
index 52d1bf06..a8713b9a 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -80,6 +80,7 @@ KAIZEN Platform 目前正在 Alpha 階段
- [Bluzelle](https://www.npmjs.com/package/bluzelle)
- [NKN](https://www.npmjs.com/package/nkn-client)
- [ICON](https://www.npmjs.com/package/icon-sdk-js)
+- [Orbit](https://www.npmjs.com/package/orbit-db)
- NOIA
## 🚰 水龍頭
@@ -104,5 +105,8 @@ KAIZEN Faucet 支援下列區塊鏈測試網路的代幣
*快速開始:您可以透過 [help wanted](https://github.com/PortalNetwork/kaizen-cli/labels/help%20wanted) 或者 [good first issue](https://github.com/PortalNetwork/kaizen-cli/labels/good%20first%20issue) 標籤找到可以參與貢獻的任務。
+## 📧 聯絡
+如果您有任何問題請聯繫 chris@portal.network 或者加入我們的 Telegram: [http://bit.ly/2XjhQV2](http://bit.ly/2XjhQV2)
+
## 🗒 許可證
詳細內容請參考 [LICENSE](./LICENSE)
diff --git a/build/components/Plugins/Install/index.js b/build/components/Plugins/Install/index.js
index 00c87d79..fea05dca 100644
--- a/build/components/Plugins/Install/index.js
+++ b/build/components/Plugins/Install/index.js
@@ -20,6 +20,8 @@ var nknHandler = require('./nkn.js');
var iconHandler = require('./icon.js');
+var orbitHandler = require('./orbit.js');
+
function builder(yargs) {
return yargs.positional('plugin', {
alias: 'p',
@@ -64,7 +66,7 @@ function _handler() {
case 8:
_context.t0 = plugin;
- _context.next = _context.t0 === 'bluzelle' ? 11 : _context.t0 === 'nkn' ? 18 : _context.t0 === 'noia' ? 25 : _context.t0 === 'icon' ? 32 : 39;
+ _context.next = _context.t0 === 'bluzelle' ? 11 : _context.t0 === 'nkn' ? 18 : _context.t0 === 'noia' ? 25 : _context.t0 === 'icon' ? 32 : _context.t0 === 'orbit' ? 39 : 46;
break;
case 11:
@@ -76,7 +78,7 @@ function _handler() {
case 15:
Spinner.stop();
Log.SuccessLog("Install plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 40);
+ return _context.abrupt("break", 47);
case 18:
Log.NormalLog('Installing plugin, please wait a second...');
@@ -87,7 +89,7 @@ function _handler() {
case 22:
Spinner.stop();
Log.SuccessLog("Install plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 40);
+ return _context.abrupt("break", 47);
case 25:
Log.NormalLog('Installing plugin, please wait a second...');
@@ -98,7 +100,7 @@ function _handler() {
case 29:
Spinner.stop();
Log.SuccessLog("Install plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 40);
+ return _context.abrupt("break", 47);
case 32:
Log.NormalLog('Installing plugin, please wait a second...');
@@ -109,28 +111,39 @@ function _handler() {
case 36:
Spinner.stop();
Log.SuccessLog("Install plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 40);
+ return _context.abrupt("break", 47);
case 39:
+ Log.NormalLog('Installing plugin, please wait a second...');
+ Spinner.start();
+ _context.next = 43;
+ return iconHandler();
+
+ case 43:
+ Spinner.stop();
+ Log.SuccessLog("Install plugin ".concat(plugin, " Successfully"));
+ return _context.abrupt("break", 47);
+
+ case 46:
Log.NormalLog('Plugin not support yet');
- case 40:
- _context.next = 47;
+ case 47:
+ _context.next = 54;
break;
- case 42:
- _context.prev = 42;
+ case 49:
+ _context.prev = 49;
_context.t1 = _context["catch"](0);
Spinner.stop();
Log.ErrorLog('something went wrong!');
console.error(_context.t1);
- case 47:
+ case 54:
case "end":
return _context.stop();
}
}
- }, _callee, this, [[0, 42]]);
+ }, _callee, this, [[0, 49]]);
}));
return _handler.apply(this, arguments);
}
diff --git a/build/components/Plugins/Install/orbit.js b/build/components/Plugins/Install/orbit.js
new file mode 100644
index 00000000..bf3a53f6
--- /dev/null
+++ b/build/components/Plugins/Install/orbit.js
@@ -0,0 +1,47 @@
+"use strict";
+
+function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
+
+function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
+
+var path = require('path');
+
+var fsx = require('fs-extra');
+
+var ExecuteCommand = require('../../../lib/ExecuteCommand');
+
+module.exports =
+/*#__PURE__*/
+_asyncToGenerator(
+/*#__PURE__*/
+regeneratorRuntime.mark(function _callee() {
+ var configPath, userConfig;
+ return regeneratorRuntime.wrap(function _callee$(_context) {
+ while (1) {
+ switch (_context.prev = _context.next) {
+ case 0:
+ _context.next = 2;
+ return ExecuteCommand('npm install orbit-db ipfs-http-client');
+
+ case 2:
+ // update user's kaizen config
+ configPath = path.resolve('./', 'kaizen.json');
+ userConfig = fsx.existsSync(configPath) ? fsx.readJsonSync(configPath) : {};
+
+ if (!userConfig.plugins) {
+ userConfig.plugins = [];
+ }
+
+ if (userConfig.plugins.includes('orbit') === false) {
+ userConfig.plugins.push('orbit');
+ }
+
+ fsx.outputJsonSync(path.resolve('./', 'kaizen.json'), userConfig);
+
+ case 7:
+ case "end":
+ return _context.stop();
+ }
+ }
+ }, _callee, this);
+}));
\ No newline at end of file
diff --git a/build/components/Plugins/List/index.js b/build/components/Plugins/List/index.js
index 9b18a80b..62b8b82d 100644
--- a/build/components/Plugins/List/index.js
+++ b/build/components/Plugins/List/index.js
@@ -27,10 +27,11 @@ function _handler() {
Log.NormalLog('nkn'.underline.yellow + ' - NKN information');
Log.NormalLog('noia'.underline.yellow + ' - NOIA information');
Log.NormalLog('icon'.underline.yellow + ' - ICON information');
+ Log.NormalLog('orbit'.underline.yellow + ' - Orbit information');
Log.NormalLog("\nTo install a plugin run " + "'kaizen plugins install '".yellow);
Log.NormalLog("\nIt will be automatically downloaded and added to your " + "'package.json'".yellow + " and " + "'kaizen.json'".yellow + " file\n");
- case 7:
+ case 8:
case "end":
return _context.stop();
}
diff --git a/build/components/Plugins/Uninstall/index.js b/build/components/Plugins/Uninstall/index.js
index 0de39abc..dc3b4561 100644
--- a/build/components/Plugins/Uninstall/index.js
+++ b/build/components/Plugins/Uninstall/index.js
@@ -75,7 +75,7 @@ function _handler() {
case 11:
_context.t0 = plugin;
- _context.next = _context.t0 === 'bluzelle' ? 14 : _context.t0 === 'nkn' ? 22 : _context.t0 === 'noia' ? 30 : _context.t0 === 'icon' ? 38 : 46;
+ _context.next = _context.t0 === 'bluzelle' ? 14 : _context.t0 === 'nkn' ? 22 : _context.t0 === 'noia' ? 30 : _context.t0 === 'icon' ? 38 : _context.t0 === 'orbit' ? 46 : 54;
break;
case 14:
@@ -88,7 +88,7 @@ function _handler() {
updateKaizenJson(kaizenJson, 'bluzelle');
Spinner.stop();
Log.SuccessLog("Remove plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 47);
+ return _context.abrupt("break", 55);
case 22:
Log.NormalLog('Uninstalling plugin, please wait a second...');
@@ -100,7 +100,7 @@ function _handler() {
updateKaizenJson(kaizenJson, 'nkn');
Spinner.stop();
Log.SuccessLog("Remove plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 47);
+ return _context.abrupt("break", 55);
case 30:
Log.NormalLog('Uninstalling plugin, please wait a second...');
@@ -112,7 +112,7 @@ function _handler() {
updateKaizenJson(kaizenJson, 'noia');
Spinner.stop();
Log.SuccessLog("Remove plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 47);
+ return _context.abrupt("break", 55);
case 38:
Log.NormalLog('Uninstalling plugin, please wait a second...');
@@ -124,28 +124,40 @@ function _handler() {
updateKaizenJson(kaizenJson, 'icon');
Spinner.stop();
Log.SuccessLog("Remove plugin ".concat(plugin, " Successfully"));
- return _context.abrupt("break", 47);
+ return _context.abrupt("break", 55);
case 46:
+ Log.NormalLog('Uninstalling plugin, please wait a second...');
+ Spinner.start();
+ _context.next = 50;
+ return iconHandler();
+
+ case 50:
+ updateKaizenJson(kaizenJson, 'orbit');
+ Spinner.stop();
+ Log.SuccessLog("Remove plugin ".concat(plugin, " Successfully"));
+ return _context.abrupt("break", 55);
+
+ case 54:
Log.NormalLog('Plugin not support yet');
- case 47:
- _context.next = 54;
+ case 55:
+ _context.next = 62;
break;
- case 49:
- _context.prev = 49;
+ case 57:
+ _context.prev = 57;
_context.t1 = _context["catch"](0);
Spinner.stop();
Log.ErrorLog('something went wrong!');
console.error(_context.t1);
- case 54:
+ case 62:
case "end":
return _context.stop();
}
}
- }, _callee, this, [[0, 49]]);
+ }, _callee, this, [[0, 57]]);
}));
return _handler.apply(this, arguments);
}
diff --git a/build/components/Plugins/Uninstall/orbit.js b/build/components/Plugins/Uninstall/orbit.js
new file mode 100644
index 00000000..c5aba2be
--- /dev/null
+++ b/build/components/Plugins/Uninstall/orbit.js
@@ -0,0 +1,49 @@
+"use strict";
+
+function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
+
+function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
+
+var path = require("path");
+
+var fsx = require("fs-extra");
+
+var ExecuteCommand = require('../../../lib/ExecuteCommand');
+
+module.exports =
+/*#__PURE__*/
+_asyncToGenerator(
+/*#__PURE__*/
+regeneratorRuntime.mark(function _callee() {
+ var configPath, userConfig;
+ return regeneratorRuntime.wrap(function _callee$(_context) {
+ while (1) {
+ switch (_context.prev = _context.next) {
+ case 0:
+ _context.next = 2;
+ return ExecuteCommand('npm uninstall orbit-db');
+
+ case 2:
+ // update user's kaizen config
+ configPath = path.resolve('./', 'kaizen.json');
+ userConfig = fsx.existsSync(configPath) ? fsx.readJsonSync(configPath) : {};
+
+ if (!userConfig.plugins) {
+ userConfig.plugins = [];
+ }
+
+ if (userConfig.plugins.includes('orbit') === false) {
+ userConfig.plugins = userConfig.plugins.filter(function (element) {
+ return element != 'orbit';
+ });
+ }
+
+ fsx.outputJsonSync(path.resolve('./', 'kaizen.json'), userConfig);
+
+ case 7:
+ case "end":
+ return _context.stop();
+ }
+ }
+ }, _callee, this);
+}));
\ No newline at end of file
diff --git a/build/components/Plugins/index.js b/build/components/Plugins/index.js
index 507916d8..cc6c1f33 100644
--- a/build/components/Plugins/index.js
+++ b/build/components/Plugins/index.js
@@ -11,7 +11,7 @@ function builder(yargs) {
require('./List')(yargs);
- return yargs.example('kaizen plugins install').example('kaizen plugins uninstall').example('kaizen plugins list').demandCommand(1, '').epilogue('Available plugins:\n\n'.underline.yellow + 'bluzelle'.underline.yellow + ' - Decentralized database\n' + 'nkn'.underline.yellow + ' - Data transmisstion\n' + 'noia'.underline.yellow + ' - Decentralized CDN\n' + 'icon'.underline.yellow + ' - Blockchain\n' + '\nRun ' + '\'kaizen plugins \''.yellow + ' to interact with plugins.\n');
+ return yargs.example('kaizen plugins install').example('kaizen plugins uninstall').example('kaizen plugins list').demandCommand(1, '').epilogue('Available plugins:\n\n'.underline.yellow + 'bluzelle'.underline.yellow + ' - Decentralized database\n' + 'nkn'.underline.yellow + ' - Data transmisstion\n' + 'noia'.underline.yellow + ' - Decentralized CDN\n' + 'icon'.underline.yellow + ' - Blockchain\n' + 'orbit'.underline.yellow + ' - Decentralized database\n' + '\nRun ' + '\'kaizen plugins \''.yellow + ' to interact with plugins.\n');
}
function handler(_x) {
diff --git a/commands/plugins.md b/commands/plugins.md
index 59fafe67..e264ce31 100644
--- a/commands/plugins.md
+++ b/commands/plugins.md
@@ -34,6 +34,7 @@ bluzelle - Decentralized database
nkn - Data transmisstion
noia - Decentralized CDN
icon - Blockchain
+orbit - Decentralized database
Run 'kaizen plugins ' to interact with plugins.
```
@@ -48,6 +49,7 @@ bluzelle - Bluzelle information
nkn - NKN information
noia - NOIA information
icon - ICON information
+orbit - Orbit information
To install a plugin run 'kaizen plugins install '
diff --git a/package-lock.json b/package-lock.json
index b890ccd1..b3fa0b70 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "kaizen-cli",
- "version": "0.0.50",
+ "version": "0.0.51",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index f34c1301..6576ebac 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "kaizen-cli",
- "version": "0.0.50",
+ "version": "0.0.51",
"bin": {
"kaizen": "kaizen"
},
diff --git a/src/components/Plugins/Install/index.js b/src/components/Plugins/Install/index.js
index f5d41483..b8d01e81 100644
--- a/src/components/Plugins/Install/index.js
+++ b/src/components/Plugins/Install/index.js
@@ -6,6 +6,7 @@ const bluzelleHandler = require('./bluzelle.js');
const noiaHandler = require('./noia.js');
const nknHandler = require('./nkn.js');
const iconHandler = require('./icon.js');
+const orbitHandler = require('./orbit.js');
function builder(yargs) {
return yargs
@@ -64,6 +65,13 @@ async function handler(argv) {
Spinner.stop();
Log.SuccessLog(`Install plugin ${plugin} Successfully`);
break;
+ case 'orbit':
+ Log.NormalLog('Installing plugin, please wait a second...');
+ Spinner.start();
+ await iconHandler();
+ Spinner.stop();
+ Log.SuccessLog(`Install plugin ${plugin} Successfully`);
+ break;
default:
Log.NormalLog('Plugin not support yet');
}
diff --git a/src/components/Plugins/Install/orbit.js b/src/components/Plugins/Install/orbit.js
new file mode 100644
index 00000000..11b8ccb6
--- /dev/null
+++ b/src/components/Plugins/Install/orbit.js
@@ -0,0 +1,21 @@
+const path = require('path');
+const fsx = require('fs-extra');
+const ExecuteCommand = require('../../../lib/ExecuteCommand');
+
+module.exports = async function() {
+ await ExecuteCommand('npm install orbit-db ipfs-http-client');
+
+ // update user's kaizen config
+ const configPath = path.resolve('./', 'kaizen.json');
+ const userConfig = fsx.existsSync(configPath) ? fsx.readJsonSync(configPath) : {};
+
+ if(!userConfig.plugins) {
+ userConfig.plugins = [];
+ }
+
+ if(userConfig.plugins.includes('orbit') === false) {
+ userConfig.plugins.push('orbit');
+ }
+
+ fsx.outputJsonSync(path.resolve('./', 'kaizen.json'), userConfig);
+}
diff --git a/src/components/Plugins/List/index.js b/src/components/Plugins/List/index.js
index c217be25..ba130b67 100644
--- a/src/components/Plugins/List/index.js
+++ b/src/components/Plugins/List/index.js
@@ -11,6 +11,7 @@ async function handler(argv) {
Log.NormalLog('nkn'.underline.yellow + ' - NKN information');
Log.NormalLog('noia'.underline.yellow + ' - NOIA information');
Log.NormalLog('icon'.underline.yellow + ' - ICON information');
+ Log.NormalLog('orbit'.underline.yellow + ' - Orbit information');
Log.NormalLog("\nTo install a plugin run " + "'kaizen plugins install '".yellow)
diff --git a/src/components/Plugins/Uninstall/index.js b/src/components/Plugins/Uninstall/index.js
index 3beaccea..ab7ba704 100644
--- a/src/components/Plugins/Uninstall/index.js
+++ b/src/components/Plugins/Uninstall/index.js
@@ -69,7 +69,14 @@ async function handler(argv) {
Spinner.stop();
Log.SuccessLog(`Remove plugin ${plugin} Successfully`);
break;
-
+ case 'orbit':
+ Log.NormalLog('Uninstalling plugin, please wait a second...');
+ Spinner.start();
+ await iconHandler();
+ updateKaizenJson(kaizenJson, 'orbit');
+ Spinner.stop();
+ Log.SuccessLog(`Remove plugin ${plugin} Successfully`);
+ break;
default:
Log.NormalLog('Plugin not support yet');
}
diff --git a/src/components/Plugins/Uninstall/orbit.js b/src/components/Plugins/Uninstall/orbit.js
new file mode 100644
index 00000000..0634d7e9
--- /dev/null
+++ b/src/components/Plugins/Uninstall/orbit.js
@@ -0,0 +1,23 @@
+const path = require("path");
+const fsx = require("fs-extra");
+const ExecuteCommand = require('../../../lib/ExecuteCommand');
+
+module.exports = async function() {
+ await ExecuteCommand('npm uninstall orbit-db');
+
+ // update user's kaizen config
+ const configPath = path.resolve('./', 'kaizen.json');
+ const userConfig = fsx.existsSync(configPath) ? fsx.readJsonSync(configPath) : {};
+
+ if(!userConfig.plugins) {
+ userConfig.plugins = [];
+ }
+
+ if(userConfig.plugins.includes('orbit') === false) {
+ userConfig.plugins = userConfig.plugins.filter(function(element) {
+ return element != 'orbit';
+ });
+ }
+
+ fsx.outputJsonSync(path.resolve('./', 'kaizen.json'), userConfig);
+}
diff --git a/src/components/Plugins/index.js b/src/components/Plugins/index.js
index bab11add..035033d8 100644
--- a/src/components/Plugins/index.js
+++ b/src/components/Plugins/index.js
@@ -14,6 +14,7 @@ function builder(yargs) {
'nkn'.underline.yellow + ' - Data transmisstion\n' +
'noia'.underline.yellow + ' - Decentralized CDN\n' +
'icon'.underline.yellow + ' - Blockchain\n' +
+ 'orbit'.underline.yellow + ' - Decentralized database\n' +
'\nRun ' + '\'kaizen plugins \''.yellow +
' to interact with plugins.\n'
);