Browse Source

set new rome rpc endpoint and update stored acropolis endpoint

Mokhtar Naamani 5 years ago
parent
commit
30492120c6

+ 8 - 1
packages/joy-settings/src/Settings.ts

@@ -38,7 +38,14 @@ export class Settings implements SettingsStruct {
 
     this._emitter = new EventEmitter();
 
-    this._apiUrl = settings.apiUrl || process.env.WS_URL || ENDPOINT_DEFAULT;
+    // Transition from acropolis - since visitors are coming to the same domain they most likely
+    // have the endpoint url saved in local storage. Replace it with new rome default endpoint.
+    if (settings.apiUrl == 'wss://testnet.joystream.org/acropolis/rpc/') {
+      this._apiUrl = process.env.WS_URL || ENDPOINT_DEFAULT || 'wss://rome-rpc-endpoint.joystream.org:9944/';
+    } else {
+      this._apiUrl = settings.apiUrl || process.env.WS_URL || ENDPOINT_DEFAULT;
+    }
+
     this._ledgerConn = settings.ledgerConn || LEDGER_CONN_DEFAULT;
     this._i18nLang = settings.i18nLang || LANGUAGE_DEFAULT;
     this._icon = settings.icon || ICON_DEFAULT;

+ 6 - 12
packages/joy-settings/src/defaults/endpoints.ts

@@ -5,7 +5,7 @@
 import { Option } from '../types';
 
 // type ChainName = 'alexander' | 'edgeware' | 'edgewareTest' | 'flamingFir' | 'kusama';
-type ChainName = 'joystream_rome_experimental' | 'joystream_rome_final_staging';
+type ChainName = 'rome';
 
 interface ChainData {
   chainDisplay: string;
@@ -22,23 +22,18 @@ interface PoviderData {
 }
 
 // we use this to give an ordering to the chains available
-const ORDER_CHAINS: ChainName[] = ['joystream_rome_experimental', 'joystream_rome_final_staging'];
+const ORDER_CHAINS: ChainName[] = ['rome'];
 
 // we use this to order the providers inside the chains
 const ORDER_PROVIDERS: ProviderName[] = ['joystream_org'];
 
 // some suplementary info on a per-chain basis
 const CHAIN_INFO: Record<ChainName, ChainData> = {
-  joystream_rome_experimental: {
+  rome: {
     chainDisplay: 'Joystream',
     logo: 'joystream',
-    type: 'Rome Reckless Testnet'
+    type: 'Rome Testnet'
   },
-  joystream_rome_final_staging: {
-    chainDisplay: 'Joystream',
-    logo: 'joystream',
-    type: 'Rome Final Staging Testnet'
-  }
 };
 
 // the actual providers with all  the nodes they provide
@@ -46,13 +41,12 @@ const PROVIDERS: Record<ProviderName, PoviderData> = {
   'joystream_org': {
     providerDisplay: 'Joystream.org',
     nodes: {
-      'joystream_rome_experimental': 'wss://rome-staging-2.joystream.org/staging/rpc/',
-      'joystream_rome_final_staging': 'wss://rome-staging-4.joystream.org/rpc/',
+      'rome' : 'wss://rome-rpc-endpoint.joystream.org:9944/'
     }
   }
 };
 
-export const ENDPOINT_DEFAULT = PROVIDERS.joystream_org.nodes.joystream_rome_final_staging;
+export const ENDPOINT_DEFAULT = PROVIDERS.joystream_org.nodes.rome;
 
 export const ENDPOINTS: Option[] = ORDER_CHAINS.reduce((endpoints: Option[], chainName): Option[] => {
   const { chainDisplay, logo, type } = CHAIN_INFO[chainName];