Skip to content

Commit

Permalink
Merge pull request #190 from PhyrexTsai/master
Browse files Browse the repository at this point in the history
v0.0.49
  • Loading branch information
PhyrexTsai authored Oct 1, 2019
2 parents 3f041f4 + 63b3cda commit a01679c
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/components/Contracts/Deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function builder(yargs) {
alias: 'u',
type: 'string',
describe: 'URL of the template contract'
}).example('kaizen contracts deploy -u https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20').demandOption(['url'], '').epilogue('Please enter the url of the template contract\n\n' + 'Support contract template:\n\n'.underline.yellow + 'Chainlink'.underline.yellow + ' - Chainlink Oracle Service, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink'.underline.yellow + '\n' + 'ERC20'.underline.yellow + ' - ERC20 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20'.underline.yellow + '\n' + 'ERC721'.underline.yellow + ' - ERC721 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721'.underline.yellow + '\n');
}).example('kaizen contracts deploy -u https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20').demandOption(['url'], '').epilogue('Please enter the url of the template contract\n\n' + 'Support contract template:\n\n'.underline.yellow + 'Chainlink'.underline.yellow + ' - Chainlink Oracle Service, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink'.underline.yellow + '\n' + 'ERC20'.underline.yellow + ' - ERC20 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20'.underline.yellow + '\n' + 'ERC721'.underline.yellow + ' - ERC721 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721'.underline.yellow + '\n' + 'NuCypher'.underline.yellow + ' - NuCypher Contracts' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/NuCypher'.underline.yellow + '\n');
}

function handler(_x) {
Expand Down
46 changes: 46 additions & 0 deletions build/components/Contracts/List/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"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 Log = require('../../../lib/Log');

require('colors');

function builder(yargs) {}

function handler(_x) {
return _handler.apply(this, arguments);
}

function _handler() {
_handler = _asyncToGenerator(
/*#__PURE__*/
regeneratorRuntime.mark(function _callee(argv) {
return regeneratorRuntime.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
Log.NormalLog('Available contract list:');
Log.NormalLog('ChainLink'.underline.yellow + ' - Chainlink Oracle Service, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink'.underline.yellow);
Log.NormalLog('ERC20'.underline.yellow + ' - ERC20 Token Standard, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20'.underline.yellow);
Log.NormalLog('ERC721'.underline.yellow + ' - ERC721 Token Standard, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721'.underline.yellow);
Log.NormalLog('NuCypher'.underline.yellow + ' - NuCypher Contracts, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/NuCypher'.underline.yellow);
Log.NormalLog("\nTo install a plugin run " + "'kaizen contracts deploy <contract-link-here>'".yellow);

case 6:
case "end":
return _context.stop();
}
}
}, _callee, this);
}));
return _handler.apply(this, arguments);
}

module.exports = function (yargs) {
var command = 'list';
var commandDescription = 'Lists all available contracts';
yargs.command(command, commandDescription, builder, handler);
};
4 changes: 3 additions & 1 deletion build/components/Contracts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ require('colors');
function builder(yargs) {
require('./Deploy')(yargs);

return yargs.example('kaizen contracts deploy').demandCommand(1, '').epilogue('KAIZEN support smart contracts:'.underline.yellow + 'You can develop, test, deploy smart contract though KAIZEN CLI\n\n' + 'Support contract template:\n\n'.underline.yellow + 'Chainlink'.underline.yellow + ' - Chainlink Oracle Service, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink'.underline.yellow + '\n' + 'ERC20'.underline.yellow + ' - ERC20 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20'.underline.yellow + '\n' + 'ERC721'.underline.yellow + ' - ERC721 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721'.underline.yellow + '\n\n' + 'NOTE: ' + 'Please make sure use '.gray + '\'kaizen config set --key <KEY> --value <VALUE>\''.yellow + ' to setup the configuration before you deploy smart contracts.'.gray);
require('./List')(yargs);

return yargs.example('kaizen contracts deploy').example('kaizen contracts list').demandCommand(1, '').epilogue('KAIZEN support smart contracts:'.underline.yellow + 'You can develop, test, deploy smart contract though KAIZEN CLI\n\n' + 'Support contract template:\n\n'.underline.yellow + 'Chainlink'.underline.yellow + ' - Chainlink Oracle Service, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink'.underline.yellow + '\n' + 'ERC20'.underline.yellow + ' - ERC20 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20'.underline.yellow + '\n' + 'ERC721'.underline.yellow + ' - ERC721 Token Standard, ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721'.underline.yellow + '\n' + 'NuCypher'.underline.yellow + ' - NuCypher Contracts' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/NuCypher'.underline.yellow + '\n\n' + 'NOTE: ' + 'Please make sure use '.gray + '\'kaizen config set --key <KEY> --value <VALUE>\''.yellow + ' to setup the configuration before you deploy smart contracts.'.gray);
}

function handler(_x) {
Expand Down
22 changes: 21 additions & 1 deletion commands/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,29 @@ Contract management for KAIZEN
```
Commands:
kaizen contracts deploy Deploy smart contracts
kaizen contracts list Lists all available contracts
Options:
--help Show help [boolean]
--version Show version number [boolean]
Examples:
kaizen contracts deploy
kaizen contracts list
KAIZEN support smart contracts:You can develop, test, deploy smart contract
though KAIZEN CLI
Support contract template:
Chainlink - Chainlink Oracle Service,
https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink,
https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink
ERC20 - ERC20 Token Standard,
https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20
ERC721 - ERC721 Token Standard,
https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721
NuCypher - NuCypher
Contractshttps://github.com/PortalNetwork/kaizen-contracts/tree/master/NuCypher
NOTE: Please make sure use 'kaizen config set --key <KEY> --value <VALUE>' to
setup the configuration before you deploy smart contracts.
Expand Down Expand Up @@ -61,4 +65,20 @@ ERC20 - ERC20 Token Standard,
https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20
ERC721 - ERC721 Token Standard,
https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721
NuCypher - NuCypher
Contractshttps://github.com/PortalNetwork/kaizen-contracts/tree/master/NuCypher
```

## `kaizen contracts list`

List all contracts support by KAIZEN

```
Available contract list:
ChainLink - Chainlink Oracle Service, link: https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink
ERC20 - ERC20 Token Standard, link: https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20
ERC721 - ERC721 Token Standard, link: https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721
NuCypher - NuCypher Contracts, link: https://github.com/PortalNetwork/kaizen-contracts/tree/master/NuCypher
To install a plugin run 'kaizen contracts deploy <contract-link-here>'
```
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kaizen-cli",
"version": "0.0.48",
"version": "0.0.49",
"bin": {
"kaizen": "kaizen"
},
Expand Down
22 changes: 22 additions & 0 deletions src/components/Contracts/List/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const Log = require('../../../lib/Log');
require('colors');

function builder(yargs) {

}

async function handler(argv) {
Log.NormalLog('Available contract list:');
Log.NormalLog('ChainLink'.underline.yellow + ' - Chainlink Oracle Service, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/Chainlink'.underline.yellow);
Log.NormalLog('ERC20'.underline.yellow + ' - ERC20 Token Standard, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC20'.underline.yellow);
Log.NormalLog('ERC721'.underline.yellow + ' - ERC721 Token Standard, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/ERC721'.underline.yellow);
Log.NormalLog('NuCypher'.underline.yellow + ' - NuCypher Contracts, link: ' + 'https://github.com/PortalNetwork/kaizen-contracts/tree/master/NuCypher'.underline.yellow)

Log.NormalLog("\nTo install a plugin run " + "'kaizen contracts deploy <contract-link-here>'".yellow)
}

module.exports = function (yargs) {
const command = 'list';
const commandDescription = 'Lists all available contracts';
yargs.command(command, commandDescription, builder, handler);
}
3 changes: 3 additions & 0 deletions src/components/Contracts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ require('colors');

function builder(yargs) {
require('./Deploy')(yargs);
require('./List')(yargs);

return yargs
.example('kaizen contracts deploy')
.example('kaizen contracts list')
.demandCommand(1, '')
.epilogue(
'KAIZEN support smart contracts:'.underline.yellow +
Expand Down
2 changes: 1 addition & 1 deletion src/components/Plugins/List/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function handler(argv) {
Log.NormalLog('bluzelle'.underline.yellow + ' - Bluzelle information');
Log.NormalLog('nkn'.underline.yellow + ' - NKN information');
Log.NormalLog('noia'.underline.yellow + ' - NOIA information');
Log.NormalLog('icon'.underline.yellow + ' - ICON information')
Log.NormalLog('icon'.underline.yellow + ' - ICON information');

Log.NormalLog("\nTo install a plugin run " + "'kaizen plugins install <plugin-name-here>'".yellow)

Expand Down

0 comments on commit a01679c

Please sign in to comment.