fix specs; clarify production enviroment (livenet not production); exec testrpc directly

This commit is contained in:
Iuri Matias 2017-02-08 06:31:57 -05:00
parent 53d8feb7bf
commit f37bc46f8e
11 changed files with 27 additions and 42 deletions

View File

@ -459,9 +459,9 @@ Working with different chains
You can specify which environment to deploy to: You can specify which environment to deploy to:
```$ embark blockchain production``` ```$ embark blockchain livenet```
```$ embark run production``` ```$ embark run livenet```
The environment is a specific blockchain configuration that can be managed at config/blockchain.json The environment is a specific blockchain configuration that can be managed at config/blockchain.json
@ -474,7 +474,7 @@ The environment is a specific blockchain configuration that can be managed at co
"rpcPort": 8545, "rpcPort": 8545,
"rpcCorsDomain": "http://localhost:8000", "rpcCorsDomain": "http://localhost:8000",
"account": { "account": {
"password": "config/production/password" "password": "config/livenet/password"
} }
}, },
... ...
@ -505,7 +505,7 @@ Deploying to IPFS and Swarm
====== ======
To deploy a dapp to IPFS, all you need to do is run a local IPFS node and then run ```embark upload ipfs```. To deploy a dapp to IPFS, all you need to do is run a local IPFS node and then run ```embark upload ipfs```.
If you want to deploy to the livenet then after configuring you account on ```config/blockchain.json``` on the ```production``` environment then you can deploy to that chain by specifying the environment ```embark ipfs production```. If you want to deploy to the livenet then after configuring you account on ```config/blockchain.json``` on the ```livenet``` environment then you can deploy to that chain by specifying the environment ```embark ipfs livenet```.
To deploy a dapp to SWARM, all you need to do is run a local SWARM node and then run ```embark upload swarm```. To deploy a dapp to SWARM, all you need to do is run a local SWARM node and then run ```embark upload swarm```.

View File

@ -2,3 +2,4 @@
node_modules/ node_modules/
dist/ dist/
config/production/password config/production/password
config/livenet/password

View File

@ -24,7 +24,7 @@
"rpcPort": 8545, "rpcPort": 8545,
"rpcCorsDomain": "http://localhost:8000", "rpcCorsDomain": "http://localhost:8000",
"account": { "account": {
"password": "config/production/password" "password": "config/livenet/password"
} }
}, },
"privatenet": { "privatenet": {

1
demo/.gitignore vendored
View File

@ -2,3 +2,4 @@
node_modules/ node_modules/
dist/ dist/
config/production/password config/production/password
config/livenet/password

View File

@ -24,7 +24,7 @@
"rpcPort": 8545, "rpcPort": 8545,
"rpcCorsDomain": "http://localhost:8000", "rpcCorsDomain": "http://localhost:8000",
"account": { "account": {
"password": "config/production/password" "password": "config/livenet/password"
} }
}, },
"privatenet": { "privatenet": {

View File

@ -10,7 +10,7 @@
"license": "ISC", "license": "ISC",
"homepage": "", "homepage": "",
"devDependencies": { "devDependencies": {
"embark": "^2.2.1", "embark": "../",
"mocha": "^2.2.5" "mocha": "^2.2.5"
} }
} }

View File

@ -4,5 +4,5 @@ Deploying to IPFS
To deploy a dapp to IPFS, all you need to do is run a local IPFS node To deploy a dapp to IPFS, all you need to do is run a local IPFS node
and then run ``embark upload ipfs``. If you want to deploy to the livenet then and then run ``embark upload ipfs``. If you want to deploy to the livenet then
after configuring you account on ``config/blockchain.json`` on the after configuring you account on ``config/blockchain.json`` on the
``production`` environment then you can deploy to that chain by ``livenet`` environment then you can deploy to that chain by
specifying the environment ``embark ipfs production``. specifying the environment ``embark ipfs livenet``.

View File

@ -3,9 +3,9 @@ Working with different chains
You can specify which environment to deploy to: You can specify which environment to deploy to:
``$ embark blockchain production`` ``$ embark blockchain livenet``
``$ embark run production`` ``$ embark run livenet``
The environment is a specific blockchain configuration that can be The environment is a specific blockchain configuration that can be
managed at config/blockchain.json managed at config/blockchain.json
@ -20,7 +20,7 @@ managed at config/blockchain.json
"rpcPort": 8545, "rpcPort": 8545,
"rpcCorsDomain": "http://localhost:8000", "rpcCorsDomain": "http://localhost:8000",
"account": { "account": {
"password": "config/production/password" "password": "config/livenet/password"
} }
}, },
... ...

View File

@ -101,30 +101,9 @@ Cmd.prototype.simulator = function() {
.command('simulator') .command('simulator')
.description('run a fast ethereum rpc simulator') .description('run a fast ethereum rpc simulator')
.option('--testrpc', 'use testrpc as the rpc simulator [default]') .option('--testrpc', 'use testrpc as the rpc simulator [default]')
.option('--ethersim', 'use ethersim as the rpc simulator')
.action(function(options) { .action(function(options) {
var Sim; //console.log('TestRPC not found; Please install it with "npm install -g ethereumjs-testrpc');
exec('testrpc');
if (options.ethersim) {
try {
Sim = require('ethersim');
} catch(e) {
console.log('EtherSim not found; Please install it with "npm install ethersim --save"');
console.log('For more information see https://github.com/iurimatias/ethersim');
process.exit(1);
}
Sim.startServer();
}
else {
try {
Sim = require('ethereumjs-testrpc');
} catch(e) {
console.log('TestRPC not found; Please install it with "npm install -g ethereumjs-testrpc');
console.log('For more information see https://github.com/ethereumjs/testrpc');
process.exit(1);
}
exec('testrpc');
}
}); });
}; };

View File

@ -6,7 +6,11 @@ var wrench = require('wrench');
var run = function(cmd) { var run = function(cmd) {
var result = exec(cmd, {silent: true}); var result = exec(cmd, {silent: true});
if (result.code !== 0) { if (result.code !== 0) {
console.log(result.stderr); console.log("error doing.. " + cmd);
console.log(result.output);
if (result.stderr !== undefined) {
console.log(result.stderr);
}
exit(); exit();
} }
}; };

View File

@ -47,7 +47,7 @@ describe('embark.Contratcs', function() {
assert.equal(contracts[0].deploy, true); assert.equal(contracts[0].deploy, true);
assert.deepEqual(contracts[0].args, [100]); assert.deepEqual(contracts[0].args, [100]);
assert.equal(contracts[0].className, "Token"); assert.equal(contracts[0].className, "Token");
assert.deepEqual(contracts[0].gas, 700000); assert.deepEqual(contracts[0].gas, 725000);
//assert.equal(contracts[0].gasPrice, []); // TODO: test this one //assert.equal(contracts[0].gasPrice, []); // TODO: test this one
assert.equal(contracts[0].type, 'file'); assert.equal(contracts[0].type, 'file');
//assert.equal(contracts[0].abiDefinition, ''); //assert.equal(contracts[0].abiDefinition, '');
@ -57,7 +57,7 @@ describe('embark.Contratcs', function() {
assert.equal(contracts[1].deploy, true); assert.equal(contracts[1].deploy, true);
assert.deepEqual(contracts[1].args, [200]); assert.deepEqual(contracts[1].args, [200]);
assert.equal(contracts[1].className, "SimpleStorage"); assert.equal(contracts[1].className, "SimpleStorage");
assert.deepEqual(contracts[1].gas, 700000); assert.deepEqual(contracts[1].gas, 725000);
//assert.equal(contracts[1].gasPrice, []); // TODO: test this one //assert.equal(contracts[1].gasPrice, []); // TODO: test this one
assert.equal(contracts[1].type, 'file'); assert.equal(contracts[1].type, 'file');
//assert.equal(contracts[1].abiDefinition, ''); //assert.equal(contracts[1].abiDefinition, '');
@ -120,7 +120,7 @@ describe('embark.Contratcs', function() {
// TokenStorage // TokenStorage
assert.equal(contracts[3].deploy, true); assert.equal(contracts[3].deploy, true);
assert.deepEqual(contracts[3].args, [100, '$SimpleStorage']); assert.deepEqual(contracts[3].args, [100, '$SimpleStorage']);
assert.deepEqual(contracts[3].gas, 700000); assert.deepEqual(contracts[3].gas, 725000);
assert.equal(contracts[3].type, 'file'); assert.equal(contracts[3].type, 'file');
//assert.equal(contracts[3].abiDefinition, ''); //assert.equal(contracts[3].abiDefinition, '');
//assert.equal(contracts[3].code, ''); //assert.equal(contracts[3].code, '');
@ -131,7 +131,7 @@ describe('embark.Contratcs', function() {
//MySimpleStorage //MySimpleStorage
assert.equal(contracts[0].deploy, true); assert.equal(contracts[0].deploy, true);
assert.deepEqual(contracts[0].args, [300]); assert.deepEqual(contracts[0].args, [300]);
assert.deepEqual(contracts[0].gas, 700000); assert.deepEqual(contracts[0].gas, 725000);
assert.equal(contracts[0].type, 'instance'); assert.equal(contracts[0].type, 'instance');
assert.equal(contracts[0].abiDefinition, parentContract.abiDefinition); assert.equal(contracts[0].abiDefinition, parentContract.abiDefinition);
assert.equal(contracts[0].code, parentContract.code); assert.equal(contracts[0].code, parentContract.code);
@ -140,7 +140,7 @@ describe('embark.Contratcs', function() {
// SimpleStorage // SimpleStorage
assert.equal(contracts[2].deploy, true); assert.equal(contracts[2].deploy, true);
assert.deepEqual(contracts[2].args, [200]); assert.deepEqual(contracts[2].args, [200]);
assert.deepEqual(contracts[2].gas, 700000); assert.deepEqual(contracts[2].gas, 725000);
assert.equal(contracts[2].type, 'file'); assert.equal(contracts[2].type, 'file');
//assert.equal(contracts[2].abiDefinition, ''); //assert.equal(contracts[2].abiDefinition, '');
//assert.equal(contracts[2].code, ''); //assert.equal(contracts[2].code, '');
@ -149,7 +149,7 @@ describe('embark.Contratcs', function() {
// AnotherSimpleStorage // AnotherSimpleStorage
assert.equal(contracts[1].deploy, true); assert.equal(contracts[1].deploy, true);
assert.deepEqual(contracts[1].args, [200]); assert.deepEqual(contracts[1].args, [200]);
assert.deepEqual(contracts[1].gas, 700000); assert.deepEqual(contracts[1].gas, 725000);
assert.equal(contracts[1].type, 'instance'); assert.equal(contracts[1].type, 'instance');
assert.equal(contracts[1].abiDefinition, parentContract.abiDefinition); assert.equal(contracts[1].abiDefinition, parentContract.abiDefinition);
assert.equal(contracts[1].code, parentContract.code); assert.equal(contracts[1].code, parentContract.code);