mirror of https://github.com/embarklabs/embark.git
add missing enable options to boilerplate configs; add communication initializer
This commit is contained in:
parent
a9e4435b77
commit
d1701c4031
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"development": {
|
||||
"enabled": true,
|
||||
"networkType": "custom",
|
||||
"genesisBlock": "config/development/genesis.json",
|
||||
"datadir": ".embark/development/datadir",
|
||||
|
@ -14,6 +15,7 @@
|
|||
}
|
||||
},
|
||||
"testnet": {
|
||||
"enabled": true,
|
||||
"networkType": "testnet",
|
||||
"light": true,
|
||||
"rpcHost": "localhost",
|
||||
|
@ -24,6 +26,7 @@
|
|||
}
|
||||
},
|
||||
"livenet": {
|
||||
"enabled": true,
|
||||
"networkType": "livenet",
|
||||
"light": true,
|
||||
"rpcHost": "localhost",
|
||||
|
@ -34,6 +37,7 @@
|
|||
}
|
||||
},
|
||||
"privatenet": {
|
||||
"enabled": true,
|
||||
"networkType": "custom",
|
||||
"rpcHost": "localhost",
|
||||
"rpcPort": 8545,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"default": {
|
||||
"enabled": true,
|
||||
"provider": "whisper"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"development": {
|
||||
"enabled": true,
|
||||
"networkType": "custom",
|
||||
"genesisBlock": "config/development/genesis.json",
|
||||
"datadir": ".embark/development/datadir",
|
||||
|
@ -14,6 +15,7 @@
|
|||
}
|
||||
},
|
||||
"testnet": {
|
||||
"enabled": true,
|
||||
"networkType": "testnet",
|
||||
"light": true,
|
||||
"rpcHost": "localhost",
|
||||
|
@ -24,6 +26,7 @@
|
|||
}
|
||||
},
|
||||
"livenet": {
|
||||
"enabled": true,
|
||||
"networkType": "livenet",
|
||||
"light": true,
|
||||
"rpcHost": "localhost",
|
||||
|
@ -34,6 +37,7 @@
|
|||
}
|
||||
},
|
||||
"privatenet": {
|
||||
"enabled": true,
|
||||
"networkType": "custom",
|
||||
"rpcHost": "localhost",
|
||||
"rpcPort": 8545,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"default": {
|
||||
"enabled": true,
|
||||
"provider": "whisper"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ ABIGenerator.prototype.generateContracts = function(useEmbarkJS) {
|
|||
return result;
|
||||
};
|
||||
|
||||
ABIGenerator.prototype.generateStorageInitialiation = function(useEmbarkJS) {
|
||||
ABIGenerator.prototype.generateStorageInitialization = function(useEmbarkJS) {
|
||||
var self = this;
|
||||
var result = "\n";
|
||||
|
||||
|
@ -79,13 +79,28 @@ ABIGenerator.prototype.generateStorageInitialiation = function(useEmbarkJS) {
|
|||
return result;
|
||||
};
|
||||
|
||||
ABIGenerator.prototype.generateCommunicationInitialization = function(useEmbarkJS) {
|
||||
var self = this;
|
||||
var result = "\n";
|
||||
|
||||
if (!useEmbarkJS || self.communicationConfig === {}) return;
|
||||
|
||||
if (self.communicationConfig.provider === 'ipfs' && self.communicationConfig.enabled === true) {
|
||||
result += "\n" + "EmbarkJS.Storage.setProvider('" + self.communicationConfig.provider + "');";
|
||||
} else if (self.communicationConfig.provider === 'orbit' && self.communicationConfig.enabled === true) {
|
||||
result += "\n" + "EmbarkJS.Storage.setProvider('" + self.communicationConfig.provider + "', {server: '" + self.communicationConfig.host + "', port: '" + self.communicationConfig.port + "'});";
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
ABIGenerator.prototype.generateABI = function(options) {
|
||||
var result = "";
|
||||
|
||||
result += this.generateProvider();
|
||||
result += this.generateContracts(options.useEmbarkJS);
|
||||
result += this.generateStorageInitialiation(options.useEmbarkJS);
|
||||
result += this.generateStorageInitialization(options.useEmbarkJS);
|
||||
result += this.generateCommunicationInitialization(options.useEmbarkJS);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue