mirror of https://github.com/embarklabs/embark.git
re-add events
This commit is contained in:
parent
b712d36625
commit
4e04f78eaa
|
@ -33,7 +33,6 @@ class Blockchain {
|
|||
this.registerRequests();
|
||||
this.registerWeb3Object();
|
||||
this.registerEvents();
|
||||
|
||||
}
|
||||
|
||||
initWeb3() {
|
||||
|
@ -72,19 +71,19 @@ class Blockchain {
|
|||
}
|
||||
|
||||
registerEvents() {
|
||||
//const self = this;
|
||||
//self.events.on('check:wentOffline:Ethereum', () => {
|
||||
// self.logger.trace('Ethereum went offline: stopping web3 provider...');
|
||||
// self.provider.stop();
|
||||
const self = this;
|
||||
self.events.on('check:wentOffline:Ethereum', () => {
|
||||
self.logger.trace('Ethereum went offline: stopping web3 provider...');
|
||||
self.provider.stop();
|
||||
|
||||
// // once the node goes back online, we can restart the provider
|
||||
// self.events.once('check:backOnline:Ethereum', () => {
|
||||
// self.logger.trace('Ethereum back online: starting web3 provider...');
|
||||
// self.provider.startWeb3Provider(() => {
|
||||
// self.logger.trace('web3 provider restarted after ethereum node came back online');
|
||||
// });
|
||||
// });
|
||||
//});
|
||||
// once the node goes back online, we can restart the provider
|
||||
self.events.once('check:backOnline:Ethereum', () => {
|
||||
self.logger.trace('Ethereum back online: starting web3 provider...');
|
||||
self.provider.startWeb3Provider(() => {
|
||||
self.logger.trace('web3 provider restarted after ethereum node came back online');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onReady(callback) {
|
||||
|
|
Loading…
Reference in New Issue