Skip to content

Commit

Permalink
update env var for regionx chain (#172)
Browse files Browse the repository at this point in the history
* update env var for regionx chain

* readme

---------

Co-authored-by: Sergej <[email protected]>
  • Loading branch information
cuteolaf and Szegoo authored Jun 26, 2024
1 parent bf15036 commit 2387c61
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WS_ROCOCO_CORETIME_CHAIN="WSS endpoint of the coretime chain"
WS_KUSAMA_CORETIME_CHAIN="WSS endpoint of the coretime chain"
WS_ROCOCO_RELAY_CHAIN="WSS endpoint of the coretime relay chain"
WS_KUSAMA_RELAY_CHAIN="WSS endpoint of the coretime relay chain"
WS_REGIONX_CHAIN="WSS endpoint of the regionx chain"
WS_REGIONX_COCOS_CHAIN="WSS endpoint of the regionx chain"
SUBSCAN_CORETIME_ROCOCO_API="API endpoint for Rococo Coretime"
SUBSCAN_CORETIME_KUSAMA_API="API endpoint for Kusama Coretime"
EXPERIMENTAL=false
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A central hub where users can perform operations on their Coretime and easily access the marketplace.

The currently supported operations via the UI are:

- Region partitioning
- Region interlacing
- Region transferring
Expand All @@ -21,7 +22,7 @@ Before running locally the environment variables must be specified properly.
1. Install [NodeJs](https://nodejs.org/en/download)
2. `npm i`
3. `npm run build`
4. `npm start`
4. `npm start`
5. Go to `http://localhost:3000` to interact with the webapp

### Run with docker
Expand All @@ -39,12 +40,14 @@ The environment variables are automatically set in the Dockerfile; however, if y
2. Follow the [Getting started with zombienet](https://github.com/RegionX-Labs/Coretime-Mock?tab=readme-ov-file#getting-started-with-zombienet) steps and run `npm run zombienet`
3. Set up the environment by running the [initialization script](https://github.com/RegionX-Labs/Coretime-Mock?tab=readme-ov-file#example-setting-up-the-full-environment) after the parachains started producing blocks.
4. Set the environment variables to the following:

```.env
WS_KUSAMA_RELAY_CHAIN="ws://127.0.0.1:9900"
WS_KUSAMA_CORETIME_CHAIN="ws://127.0.0.1:9910"
WS_REGIONX_CHAIN="ws://127.0.0.1:9920"
WS_REGIONX_COCOS_CHAIN="ws://127.0.0.1:9920"
EXPERIMENTAL=true
```

5. Run `npm run dev`
6. Purchase a core from the bulk market
7. Cross chain transfer the core from the Coretime chain to the RegionX parachain.
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const nextConfig = {
WS_KUSAMA_CORETIME_CHAIN: process.env.WS_KUSAMA_CORETIME_CHAIN || '',
SUBSCAN_CORETIME_ROCOCO_API: process.env.SUBSCAN_CORETIME_ROCOCO_API || '',
SUBSCAN_CORETIME_KUSAMA_API: process.env.SUBSCAN_CORETIME_KUSAMA_API || '',
WS_REGIONX_CHAIN: process.env.WS_REGIONX_CHAIN || '',
WS_REGIONX_COCOS_CHAIN: process.env.WS_REGIONX_COCOS_CHAIN || '',
WS_ROCOCO_RELAY_CHAIN: process.env.WS_ROCOCO_RELAY_CHAIN,
WS_KUSAMA_RELAY_CHAIN: process.env.WS_KUSAMA_RELAY_CHAIN,
EXPERIMENTAL: process.env.EXPERIMENTAL,
Expand Down
2 changes: 1 addition & 1 deletion src/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export const WS_ROCOCO_CORETIME_CHAIN =
process.env.WS_ROCOCO_CORETIME_CHAIN ?? '';
export const WS_KUSAMA_CORETIME_CHAIN =
process.env.WS_KUSAMA_CORETIME_CHAIN ?? '';
export const WS_REGIONX_CHAIN = process.env.WS_REGIONX_CHAIN ?? '';
export const WS_REGIONX_COCOS_CHAIN = process.env.WS_REGIONX_COCOS_CHAIN ?? '';
export const EXPERIMENTAL = process.env.EXPERIMENTAL == 'true' ? true : false;
6 changes: 3 additions & 3 deletions src/contexts/apis/RegionXApi/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useReducer } from 'react';

import { EXPERIMENTAL, WS_REGIONX_CHAIN } from '@/consts';
import { EXPERIMENTAL, WS_REGIONX_COCOS_CHAIN } from '@/consts';
import { useNetwork } from '@/contexts/network';
import { useToast } from '@/contexts/toast';
import { NetworkType } from '@/models';
Expand Down Expand Up @@ -107,8 +107,8 @@ const RegionXApiContextProvider = (props: any) => {
//
// For this reason we don't have different urls based on the network. However, this
// should be updated once this is in production.
connect(state, WS_REGIONX_CHAIN, dispatch, false, types, customRpc);
}, [state]);
connect(state, WS_REGIONX_COCOS_CHAIN, dispatch, false, types, customRpc);
}, [network, state]);

useEffect(() => {
dispatch({ type: 'DISCONNECTED' });
Expand Down

0 comments on commit 2387c61

Please sign in to comment.