From 5b1eeab7edfa0a590f8107098280a4dc1bb2a4d6 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 12 Jun 2018 12:21:46 -0400 Subject: [PATCH 1/3] make debug a default api option --- lib/cmds/blockchain/geth_commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cmds/blockchain/geth_commands.js b/lib/cmds/blockchain/geth_commands.js index 874e004e..21a8a2d7 100644 --- a/lib/cmds/blockchain/geth_commands.js +++ b/lib/cmds/blockchain/geth_commands.js @@ -126,8 +126,8 @@ class GethCommands { mainCommand(address, done) { let self = this; let config = this.config; - let rpc_api = (this.config.rpcApi || ['eth', 'web3', 'net']); - let ws_api = (this.config.wsApi || ['eth', 'web3', 'net']); + let rpc_api = (this.config.rpcApi || ['eth', 'web3', 'net', 'debug']); + let ws_api = (this.config.wsApi || ['eth', 'web3', 'net', 'debug']); let args = []; From e1b127138efc1082b26acbb8ce17fd7ed01caf64 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 12 Jun 2018 12:33:21 -0400 Subject: [PATCH 2/3] add ws to dappConnection list of the templates --- templates/boilerplate/config/contracts.js | 1 + templates/demo/config/contracts.js | 1 + templates/simple/contracts.js | 1 + 3 files changed, 3 insertions(+) diff --git a/templates/boilerplate/config/contracts.js b/templates/boilerplate/config/contracts.js index f768afdc..086d2f0b 100644 --- a/templates/boilerplate/config/contracts.js +++ b/templates/boilerplate/config/contracts.js @@ -10,6 +10,7 @@ module.exports = { // order of connections the dapp should connect to dappConnection: [ "$WEB3", // uses pre existing web3 object if available (e.g in Mist) + "ws://localhost:8546", "http://localhost:8545" ], gas: "auto", diff --git a/templates/demo/config/contracts.js b/templates/demo/config/contracts.js index 1d8c5b23..6bfd7d3a 100644 --- a/templates/demo/config/contracts.js +++ b/templates/demo/config/contracts.js @@ -10,6 +10,7 @@ module.exports = { // order of connections the dapp should connect to dappConnection: [ "$WEB3", // uses pre existing web3 object if available (e.g in Mist) + "ws://localhost:8546", "http://localhost:8545" ], gas: "auto", diff --git a/templates/simple/contracts.js b/templates/simple/contracts.js index f768afdc..086d2f0b 100644 --- a/templates/simple/contracts.js +++ b/templates/simple/contracts.js @@ -10,6 +10,7 @@ module.exports = { // order of connections the dapp should connect to dappConnection: [ "$WEB3", // uses pre existing web3 object if available (e.g in Mist) + "ws://localhost:8546", "http://localhost:8545" ], gas: "auto", From 40ea38993a71695efdc2043a2c5254879819094b Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 12 Jun 2018 12:59:31 -0400 Subject: [PATCH 3/3] convert json configs to js configs --- templates/boilerplate/config/blockchain.js | 59 +++++++++++++++++++ templates/boilerplate/config/blockchain.json | 58 ------------------ templates/boilerplate/config/communication.js | 13 ++++ .../boilerplate/config/communication.json | 12 ---- templates/boilerplate/config/namesystem.js | 6 ++ templates/boilerplate/config/namesystem.json | 6 -- templates/boilerplate/config/storage.js | 24 ++++++++ templates/boilerplate/config/storage.json | 24 -------- templates/boilerplate/config/webserver.js | 5 ++ templates/boilerplate/config/webserver.json | 5 -- templates/demo/config/blockchain.js | 59 +++++++++++++++++++ templates/demo/config/blockchain.json | 59 ------------------- templates/demo/config/communication.js | 12 ++++ templates/demo/config/communication.json | 12 ---- templates/demo/config/namesystem.js | 6 ++ templates/demo/config/namesystem.json | 6 -- templates/demo/config/storage.js | 24 ++++++++ templates/demo/config/storage.json | 24 -------- templates/demo/config/webserver.js | 5 ++ templates/demo/config/webserver.json | 5 -- 20 files changed, 213 insertions(+), 211 deletions(-) create mode 100644 templates/boilerplate/config/blockchain.js delete mode 100644 templates/boilerplate/config/blockchain.json create mode 100644 templates/boilerplate/config/communication.js delete mode 100644 templates/boilerplate/config/communication.json create mode 100644 templates/boilerplate/config/namesystem.js delete mode 100644 templates/boilerplate/config/namesystem.json create mode 100644 templates/boilerplate/config/storage.js delete mode 100644 templates/boilerplate/config/storage.json create mode 100644 templates/boilerplate/config/webserver.js delete mode 100644 templates/boilerplate/config/webserver.json create mode 100644 templates/demo/config/blockchain.js delete mode 100644 templates/demo/config/blockchain.json create mode 100644 templates/demo/config/communication.js delete mode 100644 templates/demo/config/communication.json create mode 100644 templates/demo/config/namesystem.js delete mode 100644 templates/demo/config/namesystem.json create mode 100644 templates/demo/config/storage.js delete mode 100644 templates/demo/config/storage.json create mode 100644 templates/demo/config/webserver.js delete mode 100644 templates/demo/config/webserver.json diff --git a/templates/boilerplate/config/blockchain.js b/templates/boilerplate/config/blockchain.js new file mode 100644 index 00000000..b3763208 --- /dev/null +++ b/templates/boilerplate/config/blockchain.js @@ -0,0 +1,59 @@ +module.exports = { + development: { + enabled: true, + networkType: "custom", + networkId: "1337", + isDev: true, + genesisBlock: "config/development/genesis.json", + datadir: ".embark/development/datadir", + mineWhenNeeded: true, + nodiscover: true, + maxpeers: 0, + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "auto", + proxy: true, + account: { + password: "config/development/password" + }, + targetGasLimit: 8000000, + wsOrigins: "auto", + wsRPC: true, + wsHost: "localhost", + wsPort: 8546, + simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", + simulatorBlocktime: 0 + }, + testnet: { + enabled: true, + networkType: "testnet", + light: true, + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "http://localhost:8000", + account: { + password: "config/testnet/password" + } + }, + livenet: { + enabled: true, + networkType: "livenet", + light: true, + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "http://localhost:8000", + account: { + password: "config/livenet/password" + } + }, + privatenet: { + enabled: true, + networkType: "custom", + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "http://localhost:8000", + datadir: "yourdatadir", + networkId: "123", + bootnodes: "" + } +} diff --git a/templates/boilerplate/config/blockchain.json b/templates/boilerplate/config/blockchain.json deleted file mode 100644 index f80d68c6..00000000 --- a/templates/boilerplate/config/blockchain.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "development": { - "enabled": true, - "networkType": "custom", - "networkId": "1337", - "isDev": true, - "genesisBlock": "config/development/genesis.json", - "datadir": ".embark/development/datadir", - "mineWhenNeeded": true, - "nodiscover": true, - "maxpeers": 0, - "rpcHost": "localhost", - "rpcPort": 8545, - "rpcCorsDomain": "auto", - "proxy": true, - "account": { - "password": "config/development/password" - }, - "targetGasLimit": 8000000, - "wsOrigins": "auto", - "wsRPC": true, - "wsHost": "localhost", - "wsPort": 8546, - "simulatorMnemonic": "example exile argue silk regular smile grass bomb merge arm assist farm", - "simulatorBlocktime": 0 - }, - "testnet": { - "enabled": true, - "networkType": "testnet", - "light": true, - "rpcHost": "localhost", - "rpcPort": 8545, - "rpcCorsDomain": "http://localhost:8000", - "account": { - "password": "config/testnet/password" - } - }, - "livenet": { - "enabled": true, - "networkType": "livenet", - "light": true, - "rpcHost": "localhost", - "rpcPort": 8545, - "rpcCorsDomain": "http://localhost:8000", - "account": { - "password": "config/livenet/password" - } - }, - "privatenet": { - "enabled": true, - "networkType": "custom", - "rpcHost": "localhost", - "rpcPort": 8545, - "datadir": "yourdatadir", - "networkId": "123", - "bootnodes": "" - } -} diff --git a/templates/boilerplate/config/communication.js b/templates/boilerplate/config/communication.js new file mode 100644 index 00000000..78d87aa9 --- /dev/null +++ b/templates/boilerplate/config/communication.js @@ -0,0 +1,13 @@ +module.exports = { + default: { + enabled: true, + provider: "whisper", + available_providers: ["whisper"], + connection: { + host: "localhost", + port: 8546, + type: "ws" + } + } +} + diff --git a/templates/boilerplate/config/communication.json b/templates/boilerplate/config/communication.json deleted file mode 100644 index a6b7f761..00000000 --- a/templates/boilerplate/config/communication.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "default": { - "enabled": true, - "provider": "whisper", - "available_providers": ["whisper"], - "connection": { - "host": "localhost", - "port": 8546, - "type": "ws" - } - } -} diff --git a/templates/boilerplate/config/namesystem.js b/templates/boilerplate/config/namesystem.js new file mode 100644 index 00000000..17ac6de4 --- /dev/null +++ b/templates/boilerplate/config/namesystem.js @@ -0,0 +1,6 @@ +module.exports = { + default: { + available_providers: ["ens"], + provider: "ens" + } +} diff --git a/templates/boilerplate/config/namesystem.json b/templates/boilerplate/config/namesystem.json deleted file mode 100644 index d4918b47..00000000 --- a/templates/boilerplate/config/namesystem.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": { - "available_providers": ["ens"], - "provider": "ens" - } -} \ No newline at end of file diff --git a/templates/boilerplate/config/storage.js b/templates/boilerplate/config/storage.js new file mode 100644 index 00000000..1603bead --- /dev/null +++ b/templates/boilerplate/config/storage.js @@ -0,0 +1,24 @@ +module.exports = { + default: { + enabled: true, + ipfs_bin: "ipfs", + provider: "ipfs", + available_providers: ["ipfs"], + upload: { + host: "localhost", + port: 5001 + }, + dappConnection: [ + {provider: "ipfs", host: "localhost", port: 5001, getUrl: "http://localhost:8080/ipfs/"} + ] + }, + development: { + enabled: true, + provider: "ipfs", + upload: { + host: "localhost", + port: 5001, + getUrl: "http://localhost:8080/ipfs/" + } + } +} diff --git a/templates/boilerplate/config/storage.json b/templates/boilerplate/config/storage.json deleted file mode 100644 index da1aa6b7..00000000 --- a/templates/boilerplate/config/storage.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "default": { - "enabled": true, - "ipfs_bin": "ipfs", - "provider": "ipfs", - "available_providers": ["ipfs"], - "upload": { - "host": "localhost", - "port": 5001 - }, - "dappConnection": [ - {"provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/"} - ] - }, - "development": { - "enabled": true, - "provider": "ipfs", - "upload": { - "host": "localhost", - "port": 5001, - "getUrl": "http://localhost:8080/ipfs/" - } - } -} diff --git a/templates/boilerplate/config/webserver.js b/templates/boilerplate/config/webserver.js new file mode 100644 index 00000000..d5b49949 --- /dev/null +++ b/templates/boilerplate/config/webserver.js @@ -0,0 +1,5 @@ +module.exports = { + enabled: true, + host: "localhost", + port: 8000 +} diff --git a/templates/boilerplate/config/webserver.json b/templates/boilerplate/config/webserver.json deleted file mode 100644 index c28a3113..00000000 --- a/templates/boilerplate/config/webserver.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enabled": true, - "host": "localhost", - "port": 8000 -} diff --git a/templates/demo/config/blockchain.js b/templates/demo/config/blockchain.js new file mode 100644 index 00000000..b3763208 --- /dev/null +++ b/templates/demo/config/blockchain.js @@ -0,0 +1,59 @@ +module.exports = { + development: { + enabled: true, + networkType: "custom", + networkId: "1337", + isDev: true, + genesisBlock: "config/development/genesis.json", + datadir: ".embark/development/datadir", + mineWhenNeeded: true, + nodiscover: true, + maxpeers: 0, + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "auto", + proxy: true, + account: { + password: "config/development/password" + }, + targetGasLimit: 8000000, + wsOrigins: "auto", + wsRPC: true, + wsHost: "localhost", + wsPort: 8546, + simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", + simulatorBlocktime: 0 + }, + testnet: { + enabled: true, + networkType: "testnet", + light: true, + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "http://localhost:8000", + account: { + password: "config/testnet/password" + } + }, + livenet: { + enabled: true, + networkType: "livenet", + light: true, + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "http://localhost:8000", + account: { + password: "config/livenet/password" + } + }, + privatenet: { + enabled: true, + networkType: "custom", + rpcHost: "localhost", + rpcPort: 8545, + rpcCorsDomain: "http://localhost:8000", + datadir: "yourdatadir", + networkId: "123", + bootnodes: "" + } +} diff --git a/templates/demo/config/blockchain.json b/templates/demo/config/blockchain.json deleted file mode 100644 index 9b7162c0..00000000 --- a/templates/demo/config/blockchain.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "development": { - "enabled": true, - "networkType": "custom", - "networkId": "1337", - "isDev": true, - "genesisBlock": "config/development/genesis.json", - "datadir": ".embark/development/datadir", - "mineWhenNeeded": true, - "nodiscover": true, - "maxpeers": 0, - "rpcHost": "localhost", - "rpcPort": 8545, - "rpcCorsDomain": "auto", - "proxy": true, - "account": { - "password": "config/development/password" - }, - "targetGasLimit": 8000000, - "wsOrigins": "auto", - "wsRPC": true, - "wsHost": "localhost", - "wsPort": 8546, - "simulatorMnemonic": "example exile argue silk regular smile grass bomb merge arm assist farm", - "simulatorBlocktime": 0 - }, - "testnet": { - "enabled": true, - "networkType": "testnet", - "light": true, - "rpcHost": "localhost", - "rpcPort": 8545, - "rpcCorsDomain": "http://localhost:8000", - "account": { - "password": "config/testnet/password" - } - }, - "livenet": { - "enabled": true, - "networkType": "livenet", - "light": true, - "rpcHost": "localhost", - "rpcPort": 8545, - "rpcCorsDomain": "http://localhost:8000", - "account": { - "password": "config/livenet/password" - } - }, - "privatenet": { - "enabled": true, - "networkType": "custom", - "rpcHost": "localhost", - "rpcPort": 8545, - "rpcCorsDomain": "http://localhost:8000", - "datadir": "yourdatadir", - "networkId": "123", - "bootnodes": "" - } -} diff --git a/templates/demo/config/communication.js b/templates/demo/config/communication.js new file mode 100644 index 00000000..eb969d3c --- /dev/null +++ b/templates/demo/config/communication.js @@ -0,0 +1,12 @@ +module.exports = { + default: { + enabled: true, + provider: "whisper", + available_providers: ["whisper"], + connection: { + host: "localhost", + port: 8546, + type: "ws" + } + } +} diff --git a/templates/demo/config/communication.json b/templates/demo/config/communication.json deleted file mode 100644 index a6b7f761..00000000 --- a/templates/demo/config/communication.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "default": { - "enabled": true, - "provider": "whisper", - "available_providers": ["whisper"], - "connection": { - "host": "localhost", - "port": 8546, - "type": "ws" - } - } -} diff --git a/templates/demo/config/namesystem.js b/templates/demo/config/namesystem.js new file mode 100644 index 00000000..d4fa9279 --- /dev/null +++ b/templates/demo/config/namesystem.js @@ -0,0 +1,6 @@ +module.exports = { + default: { + available_providers: ["ens"], + provider: "ens" + } +} diff --git a/templates/demo/config/namesystem.json b/templates/demo/config/namesystem.json deleted file mode 100644 index dc83ac4b..00000000 --- a/templates/demo/config/namesystem.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "default": { - "available_providers": ["ens"], - "provider": "ens" - } -} \ No newline at end of file diff --git a/templates/demo/config/storage.js b/templates/demo/config/storage.js new file mode 100644 index 00000000..1603bead --- /dev/null +++ b/templates/demo/config/storage.js @@ -0,0 +1,24 @@ +module.exports = { + default: { + enabled: true, + ipfs_bin: "ipfs", + provider: "ipfs", + available_providers: ["ipfs"], + upload: { + host: "localhost", + port: 5001 + }, + dappConnection: [ + {provider: "ipfs", host: "localhost", port: 5001, getUrl: "http://localhost:8080/ipfs/"} + ] + }, + development: { + enabled: true, + provider: "ipfs", + upload: { + host: "localhost", + port: 5001, + getUrl: "http://localhost:8080/ipfs/" + } + } +} diff --git a/templates/demo/config/storage.json b/templates/demo/config/storage.json deleted file mode 100644 index da1aa6b7..00000000 --- a/templates/demo/config/storage.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "default": { - "enabled": true, - "ipfs_bin": "ipfs", - "provider": "ipfs", - "available_providers": ["ipfs"], - "upload": { - "host": "localhost", - "port": 5001 - }, - "dappConnection": [ - {"provider": "ipfs", "host": "localhost", "port": 5001, "getUrl": "http://localhost:8080/ipfs/"} - ] - }, - "development": { - "enabled": true, - "provider": "ipfs", - "upload": { - "host": "localhost", - "port": 5001, - "getUrl": "http://localhost:8080/ipfs/" - } - } -} diff --git a/templates/demo/config/webserver.js b/templates/demo/config/webserver.js new file mode 100644 index 00000000..d5b49949 --- /dev/null +++ b/templates/demo/config/webserver.js @@ -0,0 +1,5 @@ +module.exports = { + enabled: true, + host: "localhost", + port: 8000 +} diff --git a/templates/demo/config/webserver.json b/templates/demo/config/webserver.json deleted file mode 100644 index c28a3113..00000000 --- a/templates/demo/config/webserver.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enabled": true, - "host": "localhost", - "port": 8000 -}