mirror of https://github.com/embarklabs/embark.git
feat: strategy for deployment
Allow implicit and explicit for deployment strategy implicit: all contracts are deployed explicit: only specified contracts are deployed Default value: implicit
This commit is contained in:
parent
0e7aad81aa
commit
f9f4c28f72
|
@ -56,5 +56,9 @@
|
|||
"logs": {
|
||||
"logPath": ".embark/logs/",
|
||||
"maxLogLength": 1500
|
||||
},
|
||||
"deploymentStrategy": {
|
||||
"implicit": "implicit",
|
||||
"explicit": "explicit"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,6 +276,7 @@ Config.prototype.loadContractsConfigFile = function() {
|
|||
"$WEB3",
|
||||
"localhost:8545"
|
||||
],
|
||||
"strategy": constants.deploymentStrategy.implicit,
|
||||
"gas": "auto",
|
||||
"contracts": {
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ const cloneDeep = require('clone-deep');
|
|||
|
||||
const utils = require('../../utils/utils.js');
|
||||
const fs = require('../../core/fs');
|
||||
const constants = require('../../constants');
|
||||
|
||||
// TODO: create a contract object
|
||||
|
||||
|
@ -307,6 +308,10 @@ class ContractsManager {
|
|||
contract.deploy = false;
|
||||
}
|
||||
|
||||
if (!self.contractsConfig.contracts[className] && self.contractsConfig.strategy === constants.deploymentStrategy.explicit) {
|
||||
contract.deploy = false;
|
||||
}
|
||||
|
||||
if (contract.code === "") {
|
||||
const message = __("assuming %s to be an interface", className);
|
||||
if (contract.silent) {
|
||||
|
|
|
@ -31,7 +31,17 @@ module.exports = {
|
|||
"ws://localhost:8546",
|
||||
"http://localhost:8545"
|
||||
],
|
||||
|
||||
gas: "auto",
|
||||
|
||||
// Strategy for the deployment of the contracts:
|
||||
// - implicit will try to deploy all the contracts located inside the contracts directory
|
||||
// or the directory configured for the location of the contracts. This is default one
|
||||
// when not specified
|
||||
// - explicit will only attempt to deploy the contracts that are explicity specified inside the
|
||||
// contracts section.
|
||||
//strategy: 'implicit',
|
||||
|
||||
contracts: {
|
||||
// example:
|
||||
//SimpleStorage: {
|
||||
|
|
|
@ -31,7 +31,17 @@ module.exports = {
|
|||
"ws://localhost:8546",
|
||||
"http://localhost:8545"
|
||||
],
|
||||
|
||||
gas: "auto",
|
||||
|
||||
// Strategy for the deployment of the contracts:
|
||||
// - implicit will try to deploy all the contracts located inside the contracts directory
|
||||
// or the directory configured for the location of the contracts. This is default one
|
||||
// when not specified
|
||||
// - explicit will only attempt to deploy the contracts that are explicity specified inside the
|
||||
// contracts section.
|
||||
//strategy: 'implicit',
|
||||
|
||||
contracts: {
|
||||
SimpleStorage: {
|
||||
fromIndex: 0,
|
||||
|
|
|
@ -31,7 +31,17 @@ module.exports = {
|
|||
"ws://localhost:8546",
|
||||
"http://localhost:8545"
|
||||
],
|
||||
|
||||
gas: "auto",
|
||||
|
||||
// Strategy for the deployment of the contracts:
|
||||
// - implicit will try to deploy all the contracts located inside the contracts directory
|
||||
// or the directory configured for the location of the contracts. This is default one
|
||||
// when not specified
|
||||
// - explicit will only attempt to deploy the contracts that are explicity specified inside the
|
||||
// contracts section.
|
||||
//strategy: 'implicit',
|
||||
|
||||
contracts: {
|
||||
// example:
|
||||
//SimpleStorage: {
|
||||
|
|
|
@ -112,6 +112,7 @@ describe('embark.Config', function () {
|
|||
deployment: {host: 'localhost', port: 8545, type: 'rpc', "accounts": [{"mnemonic": "12 word mnemonic", "balance": "5000000000"}]},
|
||||
dappConnection: ['$WEB3', 'localhost:8545'],
|
||||
"gas": "400000",
|
||||
"strategy": "implicit",
|
||||
"contracts": {
|
||||
"SimpleStorage": {
|
||||
"args": [100],
|
||||
|
|
Loading…
Reference in New Issue