diff --git a/js/src/api/rpc/ethcore/ethcore.js b/js/src/api/rpc/ethcore/ethcore.js
index 663143f0d..e21c83193 100644
--- a/js/src/api/rpc/ethcore/ethcore.js
+++ b/js/src/api/rpc/ethcore/ethcore.js
@@ -58,6 +58,11 @@ export default class Ethcore {
.execute('ethcore_dropNonReservedPeers');
}
+ enode () {
+ return this._transport
+ .execute('ethcore_enode');
+ }
+
extraData () {
return this._transport
.execute('ethcore_extraData');
diff --git a/js/src/jsonrpc/interfaces/ethcore.js b/js/src/jsonrpc/interfaces/ethcore.js
index c81a82f76..ce1761382 100644
--- a/js/src/jsonrpc/interfaces/ethcore.js
+++ b/js/src/jsonrpc/interfaces/ethcore.js
@@ -85,6 +85,15 @@ export default {
}
},
+ enode: {
+ desc: 'Returns the node enode URI',
+ params: [],
+ returns: {
+ type: String,
+ desc: 'Enode URI'
+ }
+ },
+
extraData: {
desc: 'Returns currently set extra data',
params: [],
diff --git a/js/src/redux/providers/status.js b/js/src/redux/providers/status.js
index 8d5874698..aff453517 100644
--- a/js/src/redux/providers/status.js
+++ b/js/src/redux/providers/status.js
@@ -29,6 +29,20 @@ export default class Status {
this._pollPing();
this._pollStatus();
this._pollLogs();
+ this._fetchEnode();
+ }
+
+ _fetchEnode () {
+ this._api
+ .ethcore.enode()
+ .then((enode) => {
+ this._store.dispatch(statusCollection({ enode }));
+ })
+ .catch(() => {
+ window.setTimeout(() => {
+ this._fetchEnode();
+ }, 1000);
+ });
}
_subscribeBlockNumber () {
@@ -68,11 +82,17 @@ export default class Status {
_pollStatus = () => {
const { secureToken, isConnected, isConnecting, needsToken } = this._api;
+
const nextTimeout = (timeout = 1000) => {
setTimeout(this._pollStatus, timeout);
};
+ if (isConnected !== this._store.getState().nodeStatus.isConnected) {
+ this._fetchEnode();
+ }
+
this._store.dispatch(statusCollection({ isConnected, isConnecting, needsToken, secureToken }));
+
if (!isConnected) {
nextTimeout(250);
return;
diff --git a/js/src/redux/providers/statusReducer.js b/js/src/redux/providers/statusReducer.js
index d75f62429..98bb536ae 100644
--- a/js/src/redux/providers/statusReducer.js
+++ b/js/src/redux/providers/statusReducer.js
@@ -25,6 +25,7 @@ const initialState = {
clientVersion: '',
coinbase: '',
defaultExtraData: '',
+ enode: '',
extraData: '',
gasFloorTarget: new BigNumber(0),
hashrate: new BigNumber(0),
diff --git a/js/src/views/Application/Status/status.css b/js/src/views/Application/Status/status.css
index 974c3e990..3ce33f51b 100644
--- a/js/src/views/Application/Status/status.css
+++ b/js/src/views/Application/Status/status.css
@@ -15,16 +15,24 @@
/* along with Parity. If not, see