2015-06-09 12:22:18 +00:00
|
|
|
var hashmerge = require('hashmerge');
|
|
|
|
var readYaml = require('read-yaml');
|
|
|
|
var shelljs = require('shelljs');
|
|
|
|
var shelljs_global = require('shelljs/global');
|
|
|
|
var web3 = require('web3');
|
|
|
|
var express = require('express');
|
|
|
|
var compression = require('compression');
|
|
|
|
var commander = require('commander');
|
|
|
|
var wrench = require('wrench');
|
2015-06-15 10:07:40 +00:00
|
|
|
var python = require('python');
|
|
|
|
var syncMe = require('sync-me');
|
|
|
|
var methodmissing = require('methodmissing');
|
|
|
|
var jasmine = require('jasmine');
|
|
|
|
|
2015-07-03 11:59:35 +00:00
|
|
|
var Tests = require('./test.js');
|
|
|
|
var Blockchain = require('./blockchain.js');
|
|
|
|
var Deploy = require('./deploy.js');
|
|
|
|
var Release = require('./ipfs.js');
|
|
|
|
var Config = require('./config/config.js');
|
2015-07-04 20:52:05 +00:00
|
|
|
var Compiler = require('./compiler.js');
|
2015-06-13 13:02:19 +00:00
|
|
|
|
2015-07-03 11:59:35 +00:00
|
|
|
Embark = {
|
|
|
|
init: function() {
|
2015-07-04 02:27:17 +00:00
|
|
|
this.blockchainConfig = (new Config.Blockchain());
|
2015-07-04 20:52:05 +00:00
|
|
|
this.compiler = (new Compiler(this.blockchainConfig));
|
2015-07-04 03:23:21 +00:00
|
|
|
this.contractsConfig = (new Config.Contracts(this.blockchainConfig, this.compiler));
|
2015-07-04 02:27:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
tests: function(contractFiles) {
|
|
|
|
return new Tests(this.contractsConfig, contractFiles);
|
|
|
|
},
|
|
|
|
|
|
|
|
startBlockchain: function(env) {
|
|
|
|
var chain = new Blockchain(this.blockchainConfig.config(env));
|
|
|
|
chain.startChain();
|
|
|
|
},
|
|
|
|
|
2015-07-07 10:51:03 +00:00
|
|
|
deployContracts: function(env, contractFiles, destFile) {
|
|
|
|
this.contractsConfig.init(contractFiles);
|
2015-07-04 02:27:17 +00:00
|
|
|
var deploy = new Deploy(env, contractFiles, this.blockchainConfig.config(env), this.contractsConfig);
|
|
|
|
deploy.deploy_contracts(env);
|
2015-07-07 10:51:03 +00:00
|
|
|
return deploy.generate_abi_file(destFile);
|
2015-07-04 02:27:17 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
release: Release
|
2015-07-03 11:59:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Embark;
|
2015-06-13 13:02:19 +00:00
|
|
|
|