From cc3b748232d0aecaac73be6ca00b48450809bb3a Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 11 May 2018 18:51:11 -0400 Subject: [PATCH] update contracts configs from json to js --- templates/boilerplate/config/contracts.js | 23 +++++++++++++++++++++ templates/boilerplate/config/contracts.json | 16 -------------- templates/demo/config/contracts.js | 23 +++++++++++++++++++++ templates/demo/config/contracts.json | 22 -------------------- templates/simple/contracts.js | 23 +++++++++++++++++++++ templates/simple/contracts.json | 16 -------------- templates/simple/embark.json | 2 +- 7 files changed, 70 insertions(+), 55 deletions(-) create mode 100644 templates/boilerplate/config/contracts.js delete mode 100644 templates/boilerplate/config/contracts.json create mode 100644 templates/demo/config/contracts.js delete mode 100644 templates/demo/config/contracts.json create mode 100644 templates/simple/contracts.js delete mode 100644 templates/simple/contracts.json diff --git a/templates/boilerplate/config/contracts.js b/templates/boilerplate/config/contracts.js new file mode 100644 index 000000000..f768afdc6 --- /dev/null +++ b/templates/boilerplate/config/contracts.js @@ -0,0 +1,23 @@ +module.exports = { + // default applies to all enviroments + default: { + // rpc to deploy the contracts + deployment: { + host: "localhost", + port: 8545, + type: "rpc" + }, + // order of connections the dapp should connect to + dappConnection: [ + "$WEB3", // uses pre existing web3 object if available (e.g in Mist) + "http://localhost:8545" + ], + gas: "auto", + contracts: { + // example: + //SimpleStorage: { + // args: [ 100 ] + //} + } + } +} diff --git a/templates/boilerplate/config/contracts.json b/templates/boilerplate/config/contracts.json deleted file mode 100644 index 8ea794ea4..000000000 --- a/templates/boilerplate/config/contracts.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "default": { - "deployment": { - "host": "localhost", - "port": 8545, - "type": "rpc" - }, - "dappConnection": [ - "$WEB3", - "http://localhost:8545" - ], - "gas": "auto", - "contracts": { - } - } -} diff --git a/templates/demo/config/contracts.js b/templates/demo/config/contracts.js new file mode 100644 index 000000000..1d8c5b237 --- /dev/null +++ b/templates/demo/config/contracts.js @@ -0,0 +1,23 @@ +module.exports = { + // default applies to all enviroments + default: { + // rpc to deploy the contracts + deployment: { + host: "localhost", + port: 8545, + type: "rpc" + }, + // order of connections the dapp should connect to + dappConnection: [ + "$WEB3", // uses pre existing web3 object if available (e.g in Mist) + "http://localhost:8545" + ], + gas: "auto", + contracts: { + SimpleStorage: { + fromIndex: 0, + args: [ 100 ] + } + } + } +} diff --git a/templates/demo/config/contracts.json b/templates/demo/config/contracts.json deleted file mode 100644 index da7463900..000000000 --- a/templates/demo/config/contracts.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "default": { - "deployment": { - "host": "localhost", - "port": 8545, - "type": "rpc" - }, - "dappConnection": [ - "$WEB3", - "http://localhost:8545" - ], - "gas": "auto", - "contracts": { - "SimpleStorage": { - "fromIndex": 0, - "args": [ - 100 - ] - } - } - } -} diff --git a/templates/simple/contracts.js b/templates/simple/contracts.js new file mode 100644 index 000000000..f768afdc6 --- /dev/null +++ b/templates/simple/contracts.js @@ -0,0 +1,23 @@ +module.exports = { + // default applies to all enviroments + default: { + // rpc to deploy the contracts + deployment: { + host: "localhost", + port: 8545, + type: "rpc" + }, + // order of connections the dapp should connect to + dappConnection: [ + "$WEB3", // uses pre existing web3 object if available (e.g in Mist) + "http://localhost:8545" + ], + gas: "auto", + contracts: { + // example: + //SimpleStorage: { + // args: [ 100 ] + //} + } + } +} diff --git a/templates/simple/contracts.json b/templates/simple/contracts.json deleted file mode 100644 index 8ea794ea4..000000000 --- a/templates/simple/contracts.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "default": { - "deployment": { - "host": "localhost", - "port": 8545, - "type": "rpc" - }, - "dappConnection": [ - "$WEB3", - "http://localhost:8545" - ], - "gas": "auto", - "contracts": { - } - } -} diff --git a/templates/simple/embark.json b/templates/simple/embark.json index 35edb5397..812324905 100644 --- a/templates/simple/embark.json +++ b/templates/simple/embark.json @@ -3,7 +3,7 @@ "app": {}, "buildDir": "build/", "config": { - "contracts": "contracts.json", + "contracts": "contracts.js", "blockchain": false, "storage": false, "communication": false,