From ffea513decf8195b408f63d6f65eef2d17f89dbc Mon Sep 17 00:00:00 2001
From: clangenb <37865735+clangenb@users.noreply.github.com>
Date: Mon, 22 Jul 2024 11:09:39 +0200
Subject: [PATCH] Add more endpoints for the Kusama network and allow switching
endpoint after a connection error (#151)
* [MapNodeInfo] allow switching networks upon connection error
* [MapNodeInfoSwitchWidget] add other endpoints that have offchain indexing enabled.
* [MapNodeInfo] betting text rendering
* [MapNodeInfo] decrease size off the error display
---
src/map/MapNodeInfo.js | 42 ++++++++++++++++++++--------------
src/map/MapNodeSwitchWidget.js | 14 ++++++++++++
src/style.css | 2 +-
3 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/src/map/MapNodeInfo.js b/src/map/MapNodeInfo.js
index f6a6514..d4bb519 100644
--- a/src/map/MapNodeInfo.js
+++ b/src/map/MapNodeInfo.js
@@ -74,14 +74,14 @@ function MapNodeInfoMain (props) {
}, [system]);
return (
- {
- apiState === 'READY'
- ?
-
- {nodeInfo.nodeName}
- {`${nodeInfo.chain || ''} v${nodeInfo.nodeVersion}`}
-
-
+
+
+ {nodeName(nodeInfo)}
+ {chainInfo(nodeInfo)}
+
+ {
+ apiState === 'READY'
+ ?
{
getCurrentCeremonyIndex
?
@@ -97,18 +97,26 @@ function MapNodeInfoMain (props) {
}
-
- :
- {
- apiState !== 'ERROR'
- ? Connecting to the blockchain
- : Error connecting to the blockchain
- }
-
- }
+ :
+ {
+ apiState !== 'ERROR'
+ ? Connecting to the blockchain
+ : Error connecting to the blockchain
+ }
+
+ }
+
);
}
+function nodeName (nodeInfo) {
+ return nodeInfo.nodeName !== undefined ? nodeInfo.nodeName : '...getting node name';
+}
+
+function chainInfo (nodeInfo) {
+ return nodeInfo.chain !== undefined ? `${nodeInfo.chain} v${nodeInfo.nodeVersion}` : '';
+}
+
export default function MapNodeInfo (props) {
return ;
}
diff --git a/src/map/MapNodeSwitchWidget.js b/src/map/MapNodeSwitchWidget.js
index 9834364..20e6fa5 100644
--- a/src/map/MapNodeSwitchWidget.js
+++ b/src/map/MapNodeSwitchWidget.js
@@ -42,6 +42,20 @@ function createEndpoints () {
provider: 'Encointer Association',
value: 'wss://kusama.api.encointer.org'
},
+ {
+ info: 'encointer',
+ text: 'Mainnet on Kusama',
+ icon: 'encointer-notee.svg',
+ provider: 'IBP1',
+ value: 'wss://sys.ibp.network/encointer-kusama'
+ },
+ {
+ info: 'encointer',
+ text: 'Mainnet on Kusama',
+ icon: 'encointer-notee.svg',
+ provider: 'IBP2',
+ value: 'wss://sys.dotters.network/encointer-kusama'
+ },
{
isHeader: true,
text: 'Public Test Networks',
diff --git a/src/style.css b/src/style.css
index 504ed73..2d37e6a 100644
--- a/src/style.css
+++ b/src/style.css
@@ -156,7 +156,7 @@
.encointer-map .encointer-map-node-info > .loading > .error {
font-weight: bold;
color: #800;
- font-size: 2rem;
+ font-size: 1rem;
}
.encointer-map .encointer-map-node-info > .info {