mirror of https://github.com/embarklabs/embark.git
fix testnet support
This commit is contained in:
parent
a3773b1594
commit
da92171818
|
@ -1,49 +1,38 @@
|
||||||
development:
|
development:
|
||||||
rpc_host: localhost
|
rpc_host: localhost
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
mine: false
|
rpc_whitelist: "*"
|
||||||
rpc_whitelist: localhost
|
|
||||||
minerthreads: 1
|
minerthreads: 1
|
||||||
genesis_block: config/genesis/dev_genesis.json
|
genesis_block: config/genesis/dev_genesis.json
|
||||||
datadir: /tmp/embark
|
datadir: /tmp/embark
|
||||||
chains: config/chains/development.json
|
chains: config/chains/development.json
|
||||||
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
|
||||||
account:
|
account:
|
||||||
init: true
|
init: true
|
||||||
password: config/password
|
password: config/password
|
||||||
num: 1
|
|
||||||
staging:
|
staging:
|
||||||
|
testnet: true
|
||||||
rpc_host: localhost
|
rpc_host: localhost
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: localhost
|
rpc_whitelist: "*"
|
||||||
datadir: default
|
datadir: default
|
||||||
mine: false
|
|
||||||
network_id: 0
|
network_id: 0
|
||||||
max_peers: 4
|
deploy_timeout: 45
|
||||||
bootnodes:
|
console: true
|
||||||
boot: false
|
|
||||||
enodes: [] #insert enode urls here.
|
|
||||||
nat: any #NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
|
|
||||||
port: 30303
|
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
production:
|
production:
|
||||||
rpc_host: localhost
|
rpc_host: localhost
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: localhost
|
rpc_whitelist: "*"
|
||||||
datadir: default
|
datadir: default
|
||||||
network_id: 1
|
network_id: 1
|
||||||
mine: false
|
console: true
|
||||||
max_peers: 4
|
|
||||||
bootnodes:
|
|
||||||
boot: false
|
|
||||||
enodes: []
|
|
||||||
nat: any #NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
|
|
||||||
port: 30303
|
|
||||||
account:
|
account:
|
||||||
init: false
|
init: false
|
||||||
address:
|
address:
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ development:
|
||||||
init: true
|
init: true
|
||||||
password: config/password
|
password: config/password
|
||||||
staging:
|
staging:
|
||||||
|
testnet: true
|
||||||
rpc_host: localhost
|
rpc_host: localhost
|
||||||
rpc_port: 8101
|
rpc_port: 8101
|
||||||
rpc_whitelist: "*"
|
rpc_whitelist: "*"
|
||||||
|
|
|
@ -47,6 +47,10 @@ Blockchain.prototype.generate_basic_command = function() {
|
||||||
cmd += "--datadir=\"" + config.datadir + "\" ";
|
cmd += "--datadir=\"" + config.datadir + "\" ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.testnet) {
|
||||||
|
cmd += "--testnet ";
|
||||||
|
}
|
||||||
|
|
||||||
if (config.account.password !== void 0) {
|
if (config.account.password !== void 0) {
|
||||||
cmd += "--password " + config.account.password + " ";
|
cmd += "--password " + config.account.password + " ";
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ BlockchainConfig.prototype.config = function(env) {
|
||||||
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
testnet: false,
|
||||||
rpcHost: config.rpc_host,
|
rpcHost: config.rpc_host,
|
||||||
rpcPort: config.rpc_port,
|
rpcPort: config.rpc_port,
|
||||||
gasLimit: config.gas_limit || 500000,
|
gasLimit: config.gas_limit || 500000,
|
||||||
|
|
|
@ -96,7 +96,7 @@ describe('embark.deploy', function() {
|
||||||
result += deploy.generate_provider_file();
|
result += deploy.generate_provider_file();
|
||||||
result += deploy.generate_abi_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}}}};");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue