Merge branch 'develop'
This commit is contained in:
commit
7661e8c25a
|
@ -1,2 +1,3 @@
|
||||||
node_modules
|
node_modules
|
||||||
TODO
|
TODO
|
||||||
|
.node-xmlhttprequest-sync-*
|
||||||
|
|
|
@ -25,7 +25,7 @@ var deploy = function(env, embarkConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
program
|
program
|
||||||
.version('0.7.0')
|
.version('0.7.1')
|
||||||
|
|
||||||
program.command('new [name]').description('New application').action(function(name) {
|
program.command('new [name]').description('New application').action(function(name) {
|
||||||
if (name === undefined) {
|
if (name === undefined) {
|
||||||
|
|
|
@ -3,8 +3,10 @@ development:
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
minerthreads: 1
|
minerthreads: 1
|
||||||
|
genesis_block: config/genesis/dev_genesis.json
|
||||||
datadir: /tmp/embark
|
datadir: /tmp/embark
|
||||||
mine_when_needed: true
|
mine_when_needed: true
|
||||||
|
max_peers: 0
|
||||||
gas_limit: 500000
|
gas_limit: 500000
|
||||||
gas_price: 10000000000000
|
gas_price: 10000000000000
|
||||||
console: false
|
console: false
|
||||||
|
@ -17,17 +19,19 @@ staging:
|
||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
datadir: default
|
datadir: default
|
||||||
network_id: 0
|
network_id: 0
|
||||||
|
max_peers: 4
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
production:
|
production:
|
||||||
rpc_host: localhost
|
rpc_host: localhost
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
datadir: default
|
datadir: default
|
||||||
network_id: 1
|
network_id: 1
|
||||||
|
max_peers: 4
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"nonce": "0x0000000000000042",
|
||||||
|
"difficulty": "0x40000",
|
||||||
|
"alloc": {
|
||||||
|
},
|
||||||
|
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"coinbase": "0x0000000000000000000000000000000000000000",
|
||||||
|
"timestamp": "0x00",
|
||||||
|
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"extraData": "0x",
|
||||||
|
"gasLimit": "0x4c4b40"
|
||||||
|
}
|
|
@ -10,7 +10,7 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"embark-framework": "^0.7.0",
|
"embark-framework": "^0.7.1",
|
||||||
"grunt-embark": "^0.2.0",
|
"grunt-embark": "^0.2.0",
|
||||||
"grunt-contrib-clean": "^0.6.0",
|
"grunt-contrib-clean": "^0.6.0",
|
||||||
"grunt-contrib-coffee": "^0.13.0",
|
"grunt-contrib-coffee": "^0.13.0",
|
||||||
|
|
|
@ -3,6 +3,7 @@ development:
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
minerthreads: 1
|
minerthreads: 1
|
||||||
|
genesis_block: config/genesis/dev_genesis.json
|
||||||
datadir: /tmp/embark
|
datadir: /tmp/embark
|
||||||
mine_when_needed: true
|
mine_when_needed: true
|
||||||
gas_limit: 500000
|
gas_limit: 500000
|
||||||
|
@ -20,7 +21,7 @@ staging:
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
production:
|
production:
|
||||||
rpc_host: localhost
|
rpc_host: localhost
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
|
@ -30,4 +31,4 @@ production:
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"nonce": "0x0000000000000042",
|
||||||
|
"difficulty": "0x40000",
|
||||||
|
"alloc": {
|
||||||
|
},
|
||||||
|
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"coinbase": "0x0000000000000000000000000000000000000000",
|
||||||
|
"timestamp": "0x00",
|
||||||
|
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"extraData": "0x",
|
||||||
|
"gasLimit": "0x4c4b40"
|
||||||
|
}
|
|
@ -3,6 +3,7 @@ development:
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
minerthreads: 1
|
minerthreads: 1
|
||||||
|
genesis_block: config/genesis.json
|
||||||
datadir: /tmp/embark
|
datadir: /tmp/embark
|
||||||
mine_when_needed: true
|
mine_when_needed: true
|
||||||
gas_limit: 500000
|
gas_limit: 500000
|
||||||
|
@ -20,4 +21,4 @@ staging:
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"nonce": "0x0000000000000042",
|
||||||
|
"difficulty": "0x40000",
|
||||||
|
"alloc": {
|
||||||
|
},
|
||||||
|
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"coinbase": "0x0000000000000000000000000000000000000000",
|
||||||
|
"timestamp": "0x00",
|
||||||
|
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"extraData": "0x",
|
||||||
|
"gasLimit": "0x4c4b40"
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
var mkdirp = require('mkdirp');
|
||||||
|
|
||||||
Blockchain = function(blockchainConfig) {
|
Blockchain = function(blockchainConfig) {
|
||||||
this.config = blockchainConfig;
|
this.config = blockchainConfig;
|
||||||
|
@ -25,9 +26,12 @@ Blockchain.prototype.generate_basic_command = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd += "--mine ";
|
cmd += "--mine ";
|
||||||
|
if (config.genesisBlock !== void 0) {
|
||||||
|
cmd += "--genesis=\"" + config.genesisBlock + "\" ";
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: this should be configurable
|
//TODO: this should be configurable
|
||||||
cmd += "--maxpeers 0 ";
|
cmd += "--maxpeers " + config.maxPeers + " ";
|
||||||
|
|
||||||
if (config.account.password !== void 0) {
|
if (config.account.password !== void 0) {
|
||||||
cmd += "--password " + config.account.password + " ";
|
cmd += "--password " + config.account.password + " ";
|
||||||
|
@ -73,6 +77,14 @@ Blockchain.prototype.get_address = function() {
|
||||||
var address = null;
|
var address = null;
|
||||||
|
|
||||||
if (config.account.init) {
|
if (config.account.init) {
|
||||||
|
// ensure datadir exists, bypassing the interactive liabilities prompt.
|
||||||
|
var newDir = mkdirp.sync(config.datadir);
|
||||||
|
if (newDir) {
|
||||||
|
console.log("=== datadir created");
|
||||||
|
} else {
|
||||||
|
console.log("=== datadir already exists");
|
||||||
|
}
|
||||||
|
|
||||||
console.log("running: " + this.list_command());
|
console.log("running: " + this.list_command());
|
||||||
result = exec(this.list_command());
|
result = exec(this.list_command());
|
||||||
|
|
||||||
|
@ -96,4 +108,3 @@ Blockchain.prototype.startChain = function(use_tmp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Blockchain
|
module.exports = Blockchain
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,10 @@ BlockchainConfig.prototype.config = function(env) {
|
||||||
gasPrice: config.gas_price || 10000000000000,
|
gasPrice: config.gas_price || 10000000000000,
|
||||||
rpcWhitelist: config.rpc_whitelist,
|
rpcWhitelist: config.rpc_whitelist,
|
||||||
minerthreads: config.minerthreads,
|
minerthreads: config.minerthreads,
|
||||||
|
genesisBlock: config.genesis_block,
|
||||||
datadir: config.datadir,
|
datadir: config.datadir,
|
||||||
networkId: networkId,
|
networkId: networkId,
|
||||||
|
maxPeers: 4,
|
||||||
port: config.port || "30303",
|
port: config.port || "30303",
|
||||||
console_toggle: config.console || false,
|
console_toggle: config.console || false,
|
||||||
mine_when_needed: config.mine_when_needed || false,
|
mine_when_needed: config.mine_when_needed || false,
|
||||||
|
@ -50,4 +52,3 @@ BlockchainConfig.prototype.config = function(env) {
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = BlockchainConfig;
|
module.exports = BlockchainConfig;
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ Deploy.prototype.deploy_contracts = function(env) {
|
||||||
|
|
||||||
console.log('trying to obtain ' + className + ' address...');
|
console.log('trying to obtain ' + className + ' address...');
|
||||||
var receipt = null;
|
var receipt = null;
|
||||||
while ((receipt = web3.eth.getTransactionReceipt(transactionHash)) === null) {
|
while ((receipt = web3.eth.getTransactionReceipt(transactionHash)) === null || receipt.contractAddress === null) {
|
||||||
sleep.sleep(1);
|
sleep.sleep(1);
|
||||||
}
|
}
|
||||||
var contractAddress = receipt.contractAddress;
|
var contractAddress = receipt.contractAddress;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "embark-framework",
|
"name": "embark-framework",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
@ -19,6 +19,7 @@
|
||||||
"jasmine": "^2.3.1",
|
"jasmine": "^2.3.1",
|
||||||
"meteor-build-client": "^0.1.6",
|
"meteor-build-client": "^0.1.6",
|
||||||
"methodmissing": "^0.0.3",
|
"methodmissing": "^0.0.3",
|
||||||
|
"mkdirp": "^0.5.1",
|
||||||
"python": "^0.0.4",
|
"python": "^0.0.4",
|
||||||
"read-yaml": "^1.0.0",
|
"read-yaml": "^1.0.0",
|
||||||
"shelljs": "^0.5.0",
|
"shelljs": "^0.5.0",
|
||||||
|
|
|
@ -10,7 +10,7 @@ describe('embark.blockchain', function() {
|
||||||
var blockchain = new Blockchain(blockchainConfig);
|
var blockchain = new Blockchain(blockchainConfig);
|
||||||
|
|
||||||
it('should return correct cmd', function() {
|
it('should return correct cmd', function() {
|
||||||
assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --networkid "+blockchainConfig.networkId+" --rpccorsdomain \"*\" --minerthreads \"1\" --mine --maxpeers 0 --password config/password ");
|
assert.strictEqual(blockchain.generate_basic_command(), "geth --datadir=\"/tmp/embark\" --logfile=\"/tmp/embark.log\" --port 30303 --rpc --rpcport 8101 --networkid "+blockchainConfig.networkId+" --rpccorsdomain \"*\" --minerthreads \"1\" --mine --genesis=\"config/genesis.json\" --maxpeers 4 --password config/password ");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ describe('embark.config.blockchain', function() {
|
||||||
rpc_whitelist: "*",
|
rpc_whitelist: "*",
|
||||||
network_id: 0,
|
network_id: 0,
|
||||||
minerthreads: 1,
|
minerthreads: 1,
|
||||||
|
genesis_block: 'config/genesis.json',
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
mine_when_needed: true,
|
mine_when_needed: true,
|
||||||
gas_limit: 123,
|
gas_limit: 123,
|
||||||
|
@ -63,8 +64,10 @@ describe('embark.config.blockchain', function() {
|
||||||
gasPrice: 100,
|
gasPrice: 100,
|
||||||
rpcWhitelist: "*",
|
rpcWhitelist: "*",
|
||||||
minerthreads: 1,
|
minerthreads: 1,
|
||||||
|
genesisBlock: 'config/genesis.json',
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
networkId: 0,
|
networkId: 0,
|
||||||
|
maxPeers: 4,
|
||||||
port: "30303",
|
port: "30303",
|
||||||
console_toggle: false,
|
console_toggle: false,
|
||||||
mine_when_needed: true,
|
mine_when_needed: true,
|
||||||
|
@ -103,8 +106,10 @@ describe('embark.config.blockchain', function() {
|
||||||
gasPrice: 10000000000000,
|
gasPrice: 10000000000000,
|
||||||
rpcWhitelist: "*",
|
rpcWhitelist: "*",
|
||||||
minerthreads: 1,
|
minerthreads: 1,
|
||||||
|
genesisBlock: undefined,
|
||||||
datadir: '/tmp/embark',
|
datadir: '/tmp/embark',
|
||||||
networkId: 0,
|
networkId: 0,
|
||||||
|
maxPeers: 4,
|
||||||
port: "30303",
|
port: "30303",
|
||||||
console_toggle: false,
|
console_toggle: false,
|
||||||
mine_when_needed: true,
|
mine_when_needed: true,
|
||||||
|
@ -122,4 +127,3 @@ describe('embark.config.blockchain', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ development:
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
minerthreads: 1
|
minerthreads: 1
|
||||||
|
genesis_block: config/genesis.json
|
||||||
datadir: /tmp/embark
|
datadir: /tmp/embark
|
||||||
mine_when_needed: true
|
mine_when_needed: true
|
||||||
gas_limit: 500000
|
gas_limit: 500000
|
||||||
|
@ -20,4 +21,4 @@ staging:
|
||||||
console: true
|
console: true
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
|
|
Loading…
Reference in New Issue