Fix VM as a client and cleanup template configs (#1966)

* chore(templates): clean up template configs

* fix: enable vm as a client

Bug was caused by the web3 listening to events too late (race)
This commit is contained in:
Jonathan Rainville 2019-10-13 21:42:13 -04:00 committed by Iuri Matias
parent 913267b1ce
commit d86c26d71a
5 changed files with 5 additions and 34 deletions

View File

@ -3,6 +3,7 @@ module.exports = {
default: {
// order of connections the dapp should connect to
dappConnection: [
"$EMBARK",
"$WEB3", // uses pre existing web3 object if available (e.g in Mist)
"ws://localhost:8546",
"http://localhost:8545"
@ -38,26 +39,12 @@ module.exports = {
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
dappConnection: [
"ws://localhost:8546",
"http://localhost:8545",
"$WEB3" // uses pre existing web3 object if available (e.g in Mist)
]
},
development: {},
// merges with the settings in default
// used with "embark run privatenet"
privatenet: {},
// merges with the settings in default
// used with "embark run testnet"
testnet: {},
// merges with the settings in default
// used with "embark run livenet"
livenet: {}
// you can name an environment with specific settings and then specify with
// "embark run custom_name" or "embark blockchain custom_name"
// custom_name: {}

View File

@ -28,7 +28,6 @@ module.exports = {
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
enabled: true,
upload: {
provider: "ipfs",
host: "localhost",

View File

@ -39,26 +39,12 @@ module.exports = {
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
dappConnection: [
"ws://localhost:8546",
"http://localhost:8545",
"$WEB3" // uses pre existing web3 object if available (e.g in Mist)
]
},
development: {},
// merges with the settings in default
// used with "embark run privatenet"
privatenet: {},
// merges with the settings in default
// used with "embark run testnet"
testnet: {},
// merges with the settings in default
// used with "embark run livenet"
livenet: {}
// you can name an environment with specific settings and then specify with
// "embark run custom_name" or "embark blockchain custom_name"
// custom_name: {}

View File

@ -28,7 +28,6 @@ module.exports = {
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
enabled: true,
upload: {
provider: "ipfs",
host: "localhost",

View File

@ -26,12 +26,12 @@ class EmbarkWeb3 {
}
async setupEmbarkJS() {
this.events.request("embarkjs:plugin:register", 'blockchain', 'web3', 'embarkjs-web3');
await this.events.request2("embarkjs:console:register", 'blockchain', 'web3', 'embarkjs-web3');
this.events.on("blockchain:started", async () => {
await this.registerWeb3Object();
this.events.request("embarkjs:console:setProvider", 'blockchain', 'web3', '{web3}');
});
this.events.request("embarkjs:plugin:register", 'blockchain', 'web3', 'embarkjs-web3');
await this.events.request2("embarkjs:console:register", 'blockchain', 'web3', 'embarkjs-web3');
}
async setupWeb3Api() {