fix rpccorsdomain; deployment to livenet and testnet
This commit is contained in:
parent
8190c785f4
commit
d21f385fc0
|
@ -1,16 +1,26 @@
|
||||||
{
|
{
|
||||||
"0xb6cfeab83614da04c03db0fb8a6787a45d0be8d576fcc6f8f457a5a816d22ab3": {
|
"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3": {
|
||||||
"name": "development",
|
"name": "livenet",
|
||||||
"networkId": "",
|
|
||||||
"contracts": {
|
"contracts": {
|
||||||
"5a52b16abb7dfccfc675550d0daba1683a3cf7e80fb5f0e199301f7dd57237fb": {
|
"5a52b16abb7dfccfc675550d0daba1683a3cf7e80fb5f0e199301f7dd57237fb": {
|
||||||
"address": "0x9b7d9cfed1dcc25ffa10cabf09ed69107634bcc7",
|
"address": "0x58a580ca43e04e82716c528bc134144042d99ff6",
|
||||||
"name": "SimpleStorage"
|
"name": "SimpleStorage"
|
||||||
},
|
},
|
||||||
"708fa6b699f419627ab3c4c2d9c82f8f1a6fab03c122d0a9ee55d2d0d0ad1e4b": {
|
"708fa6b699f419627ab3c4c2d9c82f8f1a6fab03c122d0a9ee55d2d0d0ad1e4b": {
|
||||||
"address": "0x3134e7b4b2bf08f50b299ad35a2271c6f5ebed5b",
|
"address": "0x717ceee627be5e18b3cd0386d104281688f91cef",
|
||||||
"name": "token"
|
"name": "token"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"0xeb9f1658ba4415557d3952c22cb6aadd416c6d803a47f7ab6c21acb7e758483c": {
|
||||||
|
"name": "livenet",
|
||||||
|
"contracts": {
|
||||||
|
"5a52b16abb7dfccfc675550d0daba1683a3cf7e80fb5f0e199301f7dd57237fb": {
|
||||||
|
"name": "SimpleStorage"
|
||||||
|
},
|
||||||
|
"708fa6b699f419627ab3c4c2d9c82f8f1a6fab03c122d0a9ee55d2d0d0ad1e4b": {
|
||||||
|
"name": "token"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,17 +7,24 @@
|
||||||
"nodiscover": true,
|
"nodiscover": true,
|
||||||
"rpcHost": "localhost",
|
"rpcHost": "localhost",
|
||||||
"rpcPort": 8545,
|
"rpcPort": 8545,
|
||||||
|
"rpcCorsDomain": "http://localhost:8000",
|
||||||
"account": {
|
"account": {
|
||||||
"password": "config/development/password"
|
"password": "config/development/password"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"testnet": {
|
"testnet": {
|
||||||
|
"networkType": "testnet",
|
||||||
"rpcHost": "localhost",
|
"rpcHost": "localhost",
|
||||||
"rpcPort": 8545,
|
"rpcPort": 8545
|
||||||
"networkType": "testnet"
|
|
||||||
},
|
},
|
||||||
"livenet": {
|
"livenet": {
|
||||||
"networkType": "livenet"
|
"networkType": "livenet",
|
||||||
|
"rpcHost": "localhost",
|
||||||
|
"rpcPort": 8545,
|
||||||
|
"rpcCorsDomain": "http://localhost:8000",
|
||||||
|
"account": {
|
||||||
|
"password": "config/production/password"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"privatenet": {
|
"privatenet": {
|
||||||
"networkType": "custom",
|
"networkType": "custom",
|
||||||
|
|
|
@ -13,6 +13,7 @@ var Blockchain = function(blockchainConfig, Client) {
|
||||||
mineWhenNeeded: this.blockchainConfig.mineWhenNeeded || false,
|
mineWhenNeeded: this.blockchainConfig.mineWhenNeeded || false,
|
||||||
rpcHost: this.blockchainConfig.rpcHost || 'localhost',
|
rpcHost: this.blockchainConfig.rpcHost || 'localhost',
|
||||||
rpcPort: this.blockchainConfig.rpcPort || 8545,
|
rpcPort: this.blockchainConfig.rpcPort || 8545,
|
||||||
|
rpcCorsDomain: this.blockchainConfig.rpcCorsDomain || false,
|
||||||
networkId: this.blockchainConfig.networkId || 12301,
|
networkId: this.blockchainConfig.networkId || 12301,
|
||||||
port: this.blockchainConfig.port || 30303,
|
port: this.blockchainConfig.port || 30303,
|
||||||
nodiscover: this.blockchainConfig.nodiscover || false,
|
nodiscover: this.blockchainConfig.nodiscover || false,
|
||||||
|
|
|
@ -40,8 +40,14 @@ Deploy.prototype.deployContract = function(contract, params, callback) {
|
||||||
|
|
||||||
var contractParams = (params || contract.args).slice();
|
var contractParams = (params || contract.args).slice();
|
||||||
|
|
||||||
|
console.log("using address" + this.web3.eth.accounts[0]);
|
||||||
|
|
||||||
|
// TODO: probably needs to be defaultAccoun
|
||||||
|
// TODO: it wouldn't necessary be the first address
|
||||||
|
// idea: use defined blockchain address or first address
|
||||||
contractParams.push({
|
contractParams.push({
|
||||||
from: this.web3.eth.coinbase,
|
//from: this.web3.eth.coinbase,
|
||||||
|
from: this.web3.eth.accounts[0],
|
||||||
data: contract.code,
|
data: contract.code,
|
||||||
gas: contract.gas,
|
gas: contract.gas,
|
||||||
gasPrice: contract.gasPrice
|
gasPrice: contract.gasPrice
|
||||||
|
|
|
@ -82,7 +82,7 @@ GethCommands.prototype.mainCommand = function(address) {
|
||||||
cmd += "--olympic ";
|
cmd += "--olympic ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.networkType !== 'custom') {
|
if (config.networkType === 'custom') {
|
||||||
cmd += "--networkid " + config.networkId + " ";
|
cmd += "--networkid " + config.networkId + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,9 +94,12 @@ GethCommands.prototype.mainCommand = function(address) {
|
||||||
cmd += "--rpc ";
|
cmd += "--rpc ";
|
||||||
cmd += "--rpcport " + config.rpcPort + " ";
|
cmd += "--rpcport " + config.rpcPort + " ";
|
||||||
cmd += "--rpcaddr " + config.rpcHost + " ";
|
cmd += "--rpcaddr " + config.rpcHost + " ";
|
||||||
//cmd += "--rpccorsdomain=\"" + "localhost" + "\" ";
|
if (config.rpcCorsDomain) {
|
||||||
cmd += "--rpccorsdomain=\"" + "*" + "\" ";
|
// TODO: show gigantic warning when cors is set to *
|
||||||
//cmd += "--rpccorsdomain=\"" + config.rpcWhitelist + "\" ";
|
cmd += "--rpccorsdomain=\"" + config.rpcCorsDomain + "\" ";
|
||||||
|
} else {
|
||||||
|
// TODO: show warning when cors is not set
|
||||||
|
}
|
||||||
|
|
||||||
//"nodiscover": true,
|
//"nodiscover": true,
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,7 @@ var Embark = {
|
||||||
self.logger.logFunction = Embark.monitor.logEntry;
|
self.logger.logFunction = Embark.monitor.logEntry;
|
||||||
self.logger.contractsState = Embark.monitor.setContracts;
|
self.logger.contractsState = Embark.monitor.setContracts;
|
||||||
self.logger.availableServices = Embark.monitor.availableServices;
|
self.logger.availableServices = Embark.monitor.availableServices;
|
||||||
|
// TODO: do this after monitor is rendered
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
function monitorServices(callback) {
|
function monitorServices(callback) {
|
||||||
|
@ -200,6 +201,7 @@ var Embark = {
|
||||||
|
|
||||||
//TODO: figure out where to put this since the web3 can be passed along if needed
|
//TODO: figure out where to put this since the web3 can be passed along if needed
|
||||||
// perhaps it should go into the deploy object itself
|
// perhaps it should go into the deploy object itself
|
||||||
|
// TODO: should come from the config object
|
||||||
var web3 = new Web3();
|
var web3 = new Web3();
|
||||||
var web3Endpoint = 'http://' + self.config.blockchainConfig.rpcHost + ':' + self.config.blockchainConfig.rpcPort;
|
var web3Endpoint = 'http://' + self.config.blockchainConfig.rpcHost + ':' + self.config.blockchainConfig.rpcPort;
|
||||||
web3.setProvider(new web3.providers.HttpProvider(web3Endpoint));
|
web3.setProvider(new web3.providers.HttpProvider(web3Endpoint));
|
||||||
|
|
Loading…
Reference in New Issue