fix testnet support

This commit is contained in:
Iuri Matias 2016-05-31 22:10:46 -04:00
parent a3773b1594
commit da92171818
5 changed files with 16 additions and 21 deletions

View File

@ -1,49 +1,38 @@
development:
rpc_host: localhost
rpc_port: 8101
mine: false
rpc_whitelist: localhost
rpc_whitelist: "*"
minerthreads: 1
genesis_block: config/genesis/dev_genesis.json
datadir: /tmp/embark
chains: config/chains/development.json
mine_when_needed: true
max_peers: 0
gas_limit: 500000
gas_price: 10000000000000
console: false
account:
init: true
password: config/password
num: 1
staging:
testnet: true
rpc_host: localhost
rpc_port: 8101
rpc_whitelist: localhost
rpc_whitelist: "*"
datadir: default
mine: false
network_id: 0
max_peers: 4
bootnodes:
boot: false
enodes: [] #insert enode urls here.
nat: any #NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
port: 30303
deploy_timeout: 45
console: true
account:
init: false
address:
production:
rpc_host: localhost
rpc_port: 8101
rpc_whitelist: localhost
rpc_whitelist: "*"
datadir: default
network_id: 1
mine: false
max_peers: 4
bootnodes:
boot: false
enodes: []
nat: any #NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
port: 30303
console: true
account:
init: false
address:

View File

@ -14,6 +14,7 @@ development:
init: true
password: config/password
staging:
testnet: true
rpc_host: localhost
rpc_port: 8101
rpc_whitelist: "*"

View File

@ -47,6 +47,10 @@ Blockchain.prototype.generate_basic_command = function() {
cmd += "--datadir=\"" + config.datadir + "\" ";
}
if (config.testnet) {
cmd += "--testnet ";
}
if (config.account.password !== void 0) {
cmd += "--password " + config.account.password + " ";
}

View File

@ -33,6 +33,7 @@ BlockchainConfig.prototype.config = function(env) {
config = {
testnet: false,
rpcHost: config.rpc_host,
rpcPort: config.rpc_port,
gasLimit: config.gas_limit || 500000,

View File

@ -96,7 +96,7 @@ describe('embark.deploy', function() {
result += deploy.generate_provider_file();
result += deploy.generate_abi_file();
assert.strictEqual(result, "var web3 = new Web3();web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));web3.eth.defaultAccount = web3.eth.accounts[0];blockchain = {\"rpcHost\":\"localhost\",\"rpcPort\":8101,\"gasLimit\":1000000,\"gasPrice\":10000000000000,\"rpcWhitelist\":\"*\",\"nat\":[],\"minerthreads\":1,\"genesisBlock\":\"config/genesis.json\",\"datadir\":\"/tmp/embark\",\"bootNodes\":[],\"deployTimeout\":20,\"networkId\":"+deploy.blockchainConfig.networkId+",\"maxPeers\":4,\"mine\":false,\"port\":\"30303\",\"console_toggle\":false,\"mine_when_needed\":true,\"whisper\":false,\"account\":{\"init\":true,\"password\":\"config/password\"},\"geth_extra_opts\":[],\"testnet\":false,\"deploy_synchronously\":false};SimpleStorageAbi = 123;SimpleStorageContract = web3.eth.contract(SimpleStorageAbi);SimpleStorage = SimpleStorageContract.at('0x123');AnotherStorageAbi = 234;AnotherStorageContract = web3.eth.contract(AnotherStorageAbi);AnotherStorage = AnotherStorageContract.at('0x234');contractDB = {\"SimpleStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":123}}},\"AnotherStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":234}}}};");
assert.strictEqual(result, "var web3 = new Web3();web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));web3.eth.defaultAccount = web3.eth.accounts[0];blockchain = {\"testnet\":false,\"rpcHost\":\"localhost\",\"rpcPort\":8101,\"gasLimit\":1000000,\"gasPrice\":10000000000000,\"rpcWhitelist\":\"*\",\"nat\":[],\"minerthreads\":1,\"genesisBlock\":\"config/genesis.json\",\"datadir\":\"/tmp/embark\",\"bootNodes\":[],\"deployTimeout\":20,\"networkId\":"+deploy.blockchainConfig.networkId+",\"maxPeers\":4,\"mine\":false,\"port\":\"30303\",\"console_toggle\":false,\"mine_when_needed\":true,\"whisper\":false,\"account\":{\"init\":true,\"password\":\"config/password\"},\"geth_extra_opts\":[],\"deploy_synchronously\":false};SimpleStorageAbi = 123;SimpleStorageContract = web3.eth.contract(SimpleStorageAbi);SimpleStorage = SimpleStorageContract.at('0x123');AnotherStorageAbi = 234;AnotherStorageContract = web3.eth.contract(AnotherStorageAbi);AnotherStorage = AnotherStorageContract.at('0x234');contractDB = {\"SimpleStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":123}}},\"AnotherStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":234}}}};");
});
});
});