mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-18 16:46:38 +00:00
Merge branch 'develop'
This commit is contained in:
commit
3ba8c55284
19
.codeclimate.yml
Normal file
19
.codeclimate.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
engines:
|
||||||
|
eslint:
|
||||||
|
enabled: true
|
||||||
|
checks:
|
||||||
|
no-eval:
|
||||||
|
enabled: false
|
||||||
|
no-process-exit:
|
||||||
|
enabled: false
|
||||||
|
global-require:
|
||||||
|
enabled: false
|
||||||
|
ratings:
|
||||||
|
paths:
|
||||||
|
- "lib/**/*"
|
||||||
|
exclude_paths:
|
||||||
|
- "tests/"
|
||||||
|
- "old_test/"
|
||||||
|
- "boilerplate/"
|
||||||
|
- "demo/"
|
||||||
|
- "js/"
|
9
.nycrc
Normal file
9
.nycrc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"reporter": [
|
||||||
|
"lcov",
|
||||||
|
"text-summary"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"lib/**/*.js"
|
||||||
|
]
|
||||||
|
}
|
@ -3,3 +3,6 @@ node_js:
|
|||||||
- "6"
|
- "6"
|
||||||
- "5"
|
- "5"
|
||||||
- "4"
|
- "4"
|
||||||
|
addons:
|
||||||
|
code_climate:
|
||||||
|
repo_token: 7454b1a666015e244c384d19f48c34e35d1ae58c3aa428ec542f10bbcb848358
|
||||||
|
14
README.md
14
README.md
@ -2,6 +2,7 @@
|
|||||||
[![Join the chat at https://gitter.im/iurimatias/embark-framework](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iurimatias/embark-framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[![Join the chat at https://gitter.im/iurimatias/embark-framework](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/iurimatias/embark-framework?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
[![Build
|
[![Build
|
||||||
Status](https://travis-ci.org/iurimatias/embark-framework.svg?branch=develop)](https://travis-ci.org/iurimatias/embark-framework)
|
Status](https://travis-ci.org/iurimatias/embark-framework.svg?branch=develop)](https://travis-ci.org/iurimatias/embark-framework)
|
||||||
|
[![Code Climate](https://codeclimate.com/github/iurimatias/embark-framework/badges/gpa.svg)](https://codeclimate.com/github/iurimatias/embark-framework)
|
||||||
|
|
||||||
What is Embark
|
What is Embark
|
||||||
======
|
======
|
||||||
@ -23,6 +24,7 @@ Table of Contents
|
|||||||
* [Usage Demo](#usage---demo)
|
* [Usage Demo](#usage---demo)
|
||||||
* [Dashboard](#dashboard)
|
* [Dashboard](#dashboard)
|
||||||
* [Creating a new DApp](#creating-a-new-dapp)
|
* [Creating a new DApp](#creating-a-new-dapp)
|
||||||
|
* [Libraries and APIs available](#libraries-and-languages-available)
|
||||||
* [Using and Configuring Contracts](#dapp-structure)
|
* [Using and Configuring Contracts](#dapp-structure)
|
||||||
* [EmbarkJS](#embarkjs)
|
* [EmbarkJS](#embarkjs)
|
||||||
* [EmbarkJS - Storage (IPFS)](#embarkjs---storage)
|
* [EmbarkJS - Storage (IPFS)](#embarkjs---storage)
|
||||||
@ -75,7 +77,7 @@ Alternatively, to use an ethereum rpc simulator simply run:
|
|||||||
$ embark simulator
|
$ embark simulator
|
||||||
```
|
```
|
||||||
|
|
||||||
By default embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in. This is quite usefull to keep a low CPU. The option can be configured at config/blockchain.json
|
By default embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in. This is quite usefull to keep a low CPU. The option can be configured at ```config/blockchain.json```. Note that running a real node requires at least 2GB of free ram, please take this into account if running it in a VM.
|
||||||
|
|
||||||
Then, in another command line:
|
Then, in another command line:
|
||||||
|
|
||||||
@ -131,6 +133,16 @@ DApp Structure
|
|||||||
|
|
||||||
Solidity/Serpent files in the contracts directory will automatically be deployed with embark run. Changes in any files will automatically be reflected in app, changes to contracts will result in a redeployment and update of their JS Bindings
|
Solidity/Serpent files in the contracts directory will automatically be deployed with embark run. Changes in any files will automatically be reflected in app, changes to contracts will result in a redeployment and update of their JS Bindings
|
||||||
|
|
||||||
|
Libraries and languages available
|
||||||
|
======
|
||||||
|
|
||||||
|
Embark can build and deploy contracts coded in Solidity or Serpent. It will make them available on the client side using EmbarkJS and Web3.js.
|
||||||
|
|
||||||
|
Further documentation for these can be found below:
|
||||||
|
|
||||||
|
* Smart Contracts: [Solidity](https://solidity.readthedocs.io/en/develop/) and [Serpent](https://github.com/ethereum/wiki/wiki/Serpent)
|
||||||
|
* Client Side: [Web3.js](https://github.com/ethereum/wiki/wiki/JavaScript-API) and [EmbarkJS](#embarkjs)
|
||||||
|
|
||||||
Using Contracts
|
Using Contracts
|
||||||
======
|
======
|
||||||
Embark will automatically take care of deployment for you and set all needed JS bindings. For example, the contract below:
|
Embark will automatically take care of deployment for you and set all needed JS bindings. For example, the contract below:
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"embark": "^2.0.1",
|
"embark": "^2.1.2",
|
||||||
"mocha": "^2.2.5"
|
"mocha": "^2.2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"embark": "^2.0.1",
|
"embark": "^2.1.2",
|
||||||
"mocha": "^2.2.5"
|
"mocha": "^2.2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ var EmbarkJS =
|
|||||||
var self = this;
|
var self = this;
|
||||||
var contractParams;
|
var contractParams;
|
||||||
|
|
||||||
contractParams = args;
|
contractParams = args || [];
|
||||||
|
|
||||||
contractParams.push({
|
contractParams.push({
|
||||||
from: this.web3.eth.accounts[0],
|
from: this.web3.eth.accounts[0],
|
||||||
@ -5907,83 +5907,14 @@ var EmbarkJS =
|
|||||||
/***/ function(module, exports) {
|
/***/ function(module, exports) {
|
||||||
|
|
||||||
// shim for using process in browser
|
// shim for using process in browser
|
||||||
|
|
||||||
var process = module.exports = {};
|
var process = module.exports = {};
|
||||||
|
|
||||||
// cached from whatever global is present so that test runners that stub it
|
|
||||||
// don't break things. But we need to wrap it in a try catch in case it is
|
|
||||||
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
||||||
// function because try/catches deoptimize in certain engines.
|
|
||||||
|
|
||||||
var cachedSetTimeout;
|
|
||||||
var cachedClearTimeout;
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
try {
|
|
||||||
cachedSetTimeout = setTimeout;
|
|
||||||
} catch (e) {
|
|
||||||
cachedSetTimeout = function () {
|
|
||||||
throw new Error('setTimeout is not defined');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
cachedClearTimeout = clearTimeout;
|
|
||||||
} catch (e) {
|
|
||||||
cachedClearTimeout = function () {
|
|
||||||
throw new Error('clearTimeout is not defined');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} ())
|
|
||||||
function runTimeout(fun) {
|
|
||||||
if (cachedSetTimeout === setTimeout) {
|
|
||||||
//normal enviroments in sane situations
|
|
||||||
return setTimeout(fun, 0);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
||||||
return cachedSetTimeout(fun, 0);
|
|
||||||
} catch(e){
|
|
||||||
try {
|
|
||||||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
||||||
return cachedSetTimeout.call(null, fun, 0);
|
|
||||||
} catch(e){
|
|
||||||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
||||||
return cachedSetTimeout.call(this, fun, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
function runClearTimeout(marker) {
|
|
||||||
if (cachedClearTimeout === clearTimeout) {
|
|
||||||
//normal enviroments in sane situations
|
|
||||||
return clearTimeout(marker);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
||||||
return cachedClearTimeout(marker);
|
|
||||||
} catch (e){
|
|
||||||
try {
|
|
||||||
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
||||||
return cachedClearTimeout.call(null, marker);
|
|
||||||
} catch (e){
|
|
||||||
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
||||||
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
||||||
return cachedClearTimeout.call(this, marker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
var queue = [];
|
var queue = [];
|
||||||
var draining = false;
|
var draining = false;
|
||||||
var currentQueue;
|
var currentQueue;
|
||||||
var queueIndex = -1;
|
var queueIndex = -1;
|
||||||
|
|
||||||
function cleanUpNextTick() {
|
function cleanUpNextTick() {
|
||||||
if (!draining || !currentQueue) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
draining = false;
|
draining = false;
|
||||||
if (currentQueue.length) {
|
if (currentQueue.length) {
|
||||||
queue = currentQueue.concat(queue);
|
queue = currentQueue.concat(queue);
|
||||||
@ -5999,7 +5930,7 @@ var EmbarkJS =
|
|||||||
if (draining) {
|
if (draining) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var timeout = runTimeout(cleanUpNextTick);
|
var timeout = setTimeout(cleanUpNextTick);
|
||||||
draining = true;
|
draining = true;
|
||||||
|
|
||||||
var len = queue.length;
|
var len = queue.length;
|
||||||
@ -6016,7 +5947,7 @@ var EmbarkJS =
|
|||||||
}
|
}
|
||||||
currentQueue = null;
|
currentQueue = null;
|
||||||
draining = false;
|
draining = false;
|
||||||
runClearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
process.nextTick = function (fun) {
|
process.nextTick = function (fun) {
|
||||||
@ -6028,7 +5959,7 @@ var EmbarkJS =
|
|||||||
}
|
}
|
||||||
queue.push(new Item(fun, args));
|
queue.push(new Item(fun, args));
|
||||||
if (queue.length === 1 && !draining) {
|
if (queue.length === 1 && !draining) {
|
||||||
runTimeout(drainQueue);
|
setTimeout(drainQueue, 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ EmbarkJS.Contract.prototype.deploy = function(args) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var contractParams;
|
var contractParams;
|
||||||
|
|
||||||
contractParams = args;
|
contractParams = args || [];
|
||||||
|
|
||||||
contractParams.push({
|
contractParams.push({
|
||||||
from: this.web3.eth.accounts[0],
|
from: this.web3.eth.accounts[0],
|
||||||
|
@ -3,7 +3,7 @@ var colors = require('colors');
|
|||||||
|
|
||||||
var Cmd = function(Embark) {
|
var Cmd = function(Embark) {
|
||||||
this.Embark = Embark;
|
this.Embark = Embark;
|
||||||
program.version('2.0.1');
|
program.version('2.1.2');
|
||||||
};
|
};
|
||||||
|
|
||||||
Cmd.prototype.process = function(args) {
|
Cmd.prototype.process = function(args) {
|
||||||
@ -62,12 +62,13 @@ Cmd.prototype.run = function() {
|
|||||||
var self = this;
|
var self = this;
|
||||||
program
|
program
|
||||||
.command('run [environment]')
|
.command('run [environment]')
|
||||||
|
.option('-p, --port [port]', 'port to run the dev webserver')
|
||||||
.description('run dapp (default: development)')
|
.description('run dapp (default: development)')
|
||||||
.action(function(env, options) {
|
.action(function(env, options) {
|
||||||
self.Embark.initConfig(env || 'development', {
|
self.Embark.initConfig(env || 'development', {
|
||||||
embarkConfig: 'embark.json'
|
embarkConfig: 'embark.json'
|
||||||
});
|
});
|
||||||
self.Embark.run(env || 'development');
|
self.Embark.run({env: env || 'development', serverPort: options.port});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ ContractsManager.prototype.build = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ContractsManager.prototype.getContract = function(className) {
|
ContractsManager.prototype.getContract = function(className) {
|
||||||
return this.compiledContracts[className];
|
return this.contracts[className];
|
||||||
};
|
};
|
||||||
|
|
||||||
ContractsManager.prototype.sortContracts = function(contractList) {
|
ContractsManager.prototype.sortContracts = function(contractList) {
|
||||||
|
127
lib/index.js
127
lib/index.js
@ -53,41 +53,15 @@ var Embark = {
|
|||||||
self.config.reloadConfig();
|
self.config.reloadConfig();
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
function deployAndBuildContractsManager(callback) {
|
self.buildDeployGenerate.bind(self)
|
||||||
Embark.monitor.setStatus("Redeploying changed Contracts");
|
|
||||||
Embark.buildAndDeploy(function(contractsManager) {
|
|
||||||
callback(null, contractsManager);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function generateConsoleABI(contractsManager, callback) {
|
|
||||||
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
|
||||||
var consoleABI = abiGenerator.generateABI({useEmbarkJS: false});
|
|
||||||
Embark.console.runCode(consoleABI);
|
|
||||||
callback(null, contractsManager);
|
|
||||||
},
|
|
||||||
function generateABI(contractsManager, callback) {
|
|
||||||
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
|
||||||
callback(null, abiGenerator.generateABI({useEmbarkJS: true}));
|
|
||||||
},
|
|
||||||
function buildPipeline(abi, callback) {
|
|
||||||
Embark.monitor.setStatus("Building Assets");
|
|
||||||
var pipeline = new Pipeline({
|
|
||||||
buildDir: self.config.buildDir,
|
|
||||||
contractsFiles: self.config.contractsFiles,
|
|
||||||
assetFiles: self.config.assetFiles,
|
|
||||||
logger: self.logger
|
|
||||||
});
|
|
||||||
pipeline.build(abi);
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
], function(err, result) {
|
], function(err, result) {
|
||||||
Embark.monitor.setStatus("Ready");
|
|
||||||
self.logger.trace("finished".underline);
|
self.logger.trace("finished".underline);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
run: function(env) {
|
run: function(options) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var env = options.env;
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function startConsole(callback) {
|
function startConsole(callback) {
|
||||||
Embark.console = new Console();
|
Embark.console = new Console();
|
||||||
@ -105,41 +79,16 @@ var Embark = {
|
|||||||
function monitorServices(callback) {
|
function monitorServices(callback) {
|
||||||
Embark.servicesMonitor = new ServicesMonitor({
|
Embark.servicesMonitor = new ServicesMonitor({
|
||||||
logger: Embark.logger,
|
logger: Embark.logger,
|
||||||
config: Embark.config
|
config: Embark.config,
|
||||||
|
serverPort: options.serverPort
|
||||||
});
|
});
|
||||||
Embark.servicesMonitor.startMonitor();
|
Embark.servicesMonitor.startMonitor();
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
function deployAndBuildContractsManager(callback) {
|
self.buildDeployGenerate.bind(self),
|
||||||
Embark.monitor.setStatus("Deploying Contracts");
|
|
||||||
Embark.buildAndDeploy(function(contractsManager) {
|
|
||||||
callback(null, contractsManager);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
function generateConsoleABI(contractsManager, callback) {
|
|
||||||
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
|
||||||
var consoleABI = abiGenerator.generateABI({useEmbarkJS: false});
|
|
||||||
Embark.console.runCode(consoleABI);
|
|
||||||
callback(null, contractsManager);
|
|
||||||
},
|
|
||||||
function generateABI(contractsManager, callback) {
|
|
||||||
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
|
||||||
callback(null, abiGenerator.generateABI({useEmbarkJS: true}));
|
|
||||||
},
|
|
||||||
function buildPipeline(abi, callback) {
|
|
||||||
Embark.monitor.setStatus("Building Assets");
|
|
||||||
var pipeline = new Pipeline({
|
|
||||||
buildDir: self.config.buildDir,
|
|
||||||
contractsFiles: self.config.contractsFiles,
|
|
||||||
assetFiles: self.config.assetFiles,
|
|
||||||
logger: self.logger
|
|
||||||
});
|
|
||||||
pipeline.build(abi);
|
|
||||||
callback();
|
|
||||||
},
|
|
||||||
function startAssetServer(callback) {
|
function startAssetServer(callback) {
|
||||||
Embark.monitor.setStatus("Starting Server");
|
Embark.monitor.setStatus("Starting Server");
|
||||||
var server = new Server({logger: self.logger});
|
var server = new Server({logger: self.logger, port: options.serverPort});
|
||||||
server.start(callback);
|
server.start(callback);
|
||||||
},
|
},
|
||||||
function watchFilesForChanges(callback) {
|
function watchFilesForChanges(callback) {
|
||||||
@ -158,7 +107,7 @@ var Embark = {
|
|||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
], function(err, result) {
|
], function(err, result) {
|
||||||
Embark.monitor.setStatus("Ready");
|
Embark.monitor.setStatus("Ready".green);
|
||||||
self.logger.trace("finished".underline);
|
self.logger.trace("finished".underline);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -194,8 +143,12 @@ var Embark = {
|
|||||||
contractsConfig: self.config.contractsConfig,
|
contractsConfig: self.config.contractsConfig,
|
||||||
logger: Embark.logger
|
logger: Embark.logger
|
||||||
});
|
});
|
||||||
|
try {
|
||||||
contractsManager.build();
|
contractsManager.build();
|
||||||
callback(null, contractsManager);
|
callback(null, contractsManager);
|
||||||
|
} catch(err) {
|
||||||
|
callback(new Error(err.message));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
function deployContracts(contractsManager, callback) {
|
function deployContracts(contractsManager, callback) {
|
||||||
|
|
||||||
@ -229,7 +182,11 @@ var Embark = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
], function(err, result) {
|
], function(err, result) {
|
||||||
done(result);
|
if (err) {
|
||||||
|
done(err, null);
|
||||||
|
} else {
|
||||||
|
done(null, result);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -244,12 +201,60 @@ var Embark = {
|
|||||||
function generateABI(contractsManager, callback) {
|
function generateABI(contractsManager, callback) {
|
||||||
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
||||||
callback(null, abiGenerator.generateABI({useEmbarkJS: true}));
|
callback(null, abiGenerator.generateABI({useEmbarkJS: true}));
|
||||||
},
|
}
|
||||||
], function(err, result) {
|
], function(err, result) {
|
||||||
done(result);
|
done(result);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
buildDeployGenerate: function(done) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
Embark.monitor.setStatus("Deploying...".magenta.underline);
|
||||||
|
async.waterfall([
|
||||||
|
function deployAndBuildContractsManager(callback) {
|
||||||
|
Embark.buildAndDeploy(function(err, contractsManager) {
|
||||||
|
if (err) {
|
||||||
|
callback(err);
|
||||||
|
} else {
|
||||||
|
callback(null, contractsManager);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
function generateConsoleABI(contractsManager, callback) {
|
||||||
|
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
||||||
|
var consoleABI = abiGenerator.generateABI({useEmbarkJS: false});
|
||||||
|
Embark.console.runCode(consoleABI);
|
||||||
|
callback(null, contractsManager);
|
||||||
|
},
|
||||||
|
function generateABI(contractsManager, callback) {
|
||||||
|
var abiGenerator = new ABIGenerator(self.config.blockchainConfig, contractsManager);
|
||||||
|
callback(null, abiGenerator.generateABI({useEmbarkJS: true}));
|
||||||
|
},
|
||||||
|
function buildPipeline(abi, callback) {
|
||||||
|
Embark.monitor.setStatus("Building Assets");
|
||||||
|
var pipeline = new Pipeline({
|
||||||
|
buildDir: self.config.buildDir,
|
||||||
|
contractsFiles: self.config.contractsFiles,
|
||||||
|
assetFiles: self.config.assetFiles,
|
||||||
|
logger: self.logger
|
||||||
|
});
|
||||||
|
pipeline.build(abi);
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
], function(err, result) {
|
||||||
|
if (err) {
|
||||||
|
self.logger.error("error deploying");
|
||||||
|
self.logger.error(err.message);
|
||||||
|
Embark.monitor.setStatus("Deployment Error".red);
|
||||||
|
} else {
|
||||||
|
Embark.monitor.setStatus("Ready".green);
|
||||||
|
}
|
||||||
|
done(result);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
initTests: function(options) {
|
initTests: function(options) {
|
||||||
return new Test(options);
|
return new Test(options);
|
||||||
},
|
},
|
||||||
|
@ -101,14 +101,14 @@ Dashboard.prototype.layoutLog = function() {
|
|||||||
left: "0%",
|
left: "0%",
|
||||||
top: "42%",
|
top: "42%",
|
||||||
border: {
|
border: {
|
||||||
type: "line",
|
type: "line"
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
fg: -1,
|
fg: -1,
|
||||||
border: {
|
border: {
|
||||||
fg: this.color,
|
fg: this.color
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.logText = blessed.log({
|
this.logText = blessed.log({
|
||||||
@ -141,14 +141,14 @@ Dashboard.prototype.layoutModules = function() {
|
|||||||
left: "0%",
|
left: "0%",
|
||||||
top: "0",
|
top: "0",
|
||||||
border: {
|
border: {
|
||||||
type: "line",
|
type: "line"
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
fg: -1,
|
fg: -1,
|
||||||
border: {
|
border: {
|
||||||
fg: this.color,
|
fg: this.color
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.moduleTable = blessed.table({
|
this.moduleTable = blessed.table({
|
||||||
@ -184,14 +184,14 @@ Dashboard.prototype.layoutAssets = function() {
|
|||||||
left: "50%",
|
left: "50%",
|
||||||
top: "42%",
|
top: "42%",
|
||||||
border: {
|
border: {
|
||||||
type: "line",
|
type: "line"
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
fg: -1,
|
fg: -1,
|
||||||
border: {
|
border: {
|
||||||
fg: this.color,
|
fg: this.color
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.assetTable = blessed.table({
|
this.assetTable = blessed.table({
|
||||||
@ -230,20 +230,20 @@ Dashboard.prototype.layoutStatus = function() {
|
|||||||
label: "Environment",
|
label: "Environment",
|
||||||
tags: true,
|
tags: true,
|
||||||
padding: {
|
padding: {
|
||||||
left: 1,
|
left: 1
|
||||||
},
|
},
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "20%",
|
height: "20%",
|
||||||
valign: "middle",
|
valign: "middle",
|
||||||
border: {
|
border: {
|
||||||
type: "line",
|
type: "line"
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
fg: -1,
|
fg: -1,
|
||||||
border: {
|
border: {
|
||||||
fg: this.color,
|
fg: this.color
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.operations = blessed.box({
|
this.operations = blessed.box({
|
||||||
@ -251,20 +251,20 @@ Dashboard.prototype.layoutStatus = function() {
|
|||||||
label: "Status",
|
label: "Status",
|
||||||
tags: true,
|
tags: true,
|
||||||
padding: {
|
padding: {
|
||||||
left: 1,
|
left: 1
|
||||||
},
|
},
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: "20%",
|
height: "20%",
|
||||||
valign: "middle",
|
valign: "middle",
|
||||||
border: {
|
border: {
|
||||||
type: "line",
|
type: "line"
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
fg: -1,
|
fg: -1,
|
||||||
border: {
|
border: {
|
||||||
fg: this.color,
|
fg: this.color
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.progress = blessed.box({
|
this.progress = blessed.box({
|
||||||
@ -283,9 +283,9 @@ Dashboard.prototype.layoutStatus = function() {
|
|||||||
style: {
|
style: {
|
||||||
fg: -1,
|
fg: -1,
|
||||||
border: {
|
border: {
|
||||||
fg: this.color,
|
fg: this.color
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.screen.append(this.wrapper);
|
this.screen.append(this.wrapper);
|
||||||
@ -302,14 +302,14 @@ Dashboard.prototype.layoutCmd = function() {
|
|||||||
left: '0%',
|
left: '0%',
|
||||||
top: '95%',
|
top: '95%',
|
||||||
border: {
|
border: {
|
||||||
type: 'line',
|
type: 'line'
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
fg: 'black',
|
fg: 'black',
|
||||||
border: {
|
border: {
|
||||||
fg: this.color,
|
fg: this.color
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.input = blessed.textbox({
|
this.input = blessed.textbox({
|
||||||
|
@ -6,6 +6,7 @@ var ServicesMonitor = function(options) {
|
|||||||
this.logger = options.logger;
|
this.logger = options.logger;
|
||||||
this.interval = options.interval || 5000;
|
this.interval = options.interval || 5000;
|
||||||
this.config = options.config;
|
this.config = options.config;
|
||||||
|
this.serverPort = options.serverPort || 8000;
|
||||||
};
|
};
|
||||||
|
|
||||||
ServicesMonitor.prototype.startMonitor = function() {
|
ServicesMonitor.prototype.startMonitor = function() {
|
||||||
@ -27,7 +28,7 @@ ServicesMonitor.prototype.check = function() {
|
|||||||
},
|
},
|
||||||
function addEmbarkVersion(web3, result, callback) {
|
function addEmbarkVersion(web3, result, callback) {
|
||||||
self.logger.trace('addEmbarkVersion');
|
self.logger.trace('addEmbarkVersion');
|
||||||
result.push('Embark 2.1.0'.green);
|
result.push('Embark 2.1.2'.green);
|
||||||
callback(null, web3, result);
|
callback(null, web3, result);
|
||||||
},
|
},
|
||||||
function checkEthereum(web3, result, callback) {
|
function checkEthereum(web3, result, callback) {
|
||||||
@ -63,7 +64,7 @@ ServicesMonitor.prototype.check = function() {
|
|||||||
},
|
},
|
||||||
function checkDevServer(result, callback) {
|
function checkDevServer(result, callback) {
|
||||||
self.logger.trace('checkDevServer');
|
self.logger.trace('checkDevServer');
|
||||||
result.push('dev server (http://localhost:8000)'.green);
|
result.push(('dev server (http://localhost:' + self.serverPort + ')').green);
|
||||||
callback(null, result);
|
callback(null, result);
|
||||||
}
|
}
|
||||||
], function(err, result) {
|
], function(err, result) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "embark",
|
"name": "embark",
|
||||||
"version": "2.0.1",
|
"version": "2.1.2",
|
||||||
"description": "Embark is a framework that allows you to easily develop and deploy DApps",
|
"description": "Embark is a framework that allows you to easily develop and deploy DApps",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "grunt jshint && mocha test/ --no-timeouts"
|
"test": "grunt jshint && mocha test/ --no-timeouts"
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user