Skip to content

Commit

Permalink
[explorer] Enables Switching Across Networks (MystenLabs#1986)
Browse files Browse the repository at this point in the history
* creates simple context switcher

* refactor and change where network printed on home page

* WIP - feed network variable to the JsonRpcProvider

* switches to Network enum that affects API calls across codebase

* stylize network switcher

* creates modal effect

* further changes to modal css

* changes to buttons for each network

* handles static env case

* can specify custom RPC URL

* smaller sidebar and buttons

* update home and error page tests

* updates tests to work

* WIP - test refactoring

* lint tidy-up

* adds licenses

* refactors tests including removing all 'any' types

* should be keys not values

* removes legacy ace comments

* improves modal display on results pages

* re-enables clicking longtext to go between object and parent address

* restore top-left home page button css

* yarn start:local starts at local

* improves rpcSetting comments

* network stored in browser

* network put into local storage and held for 3 hours

* restore start:local mode

* minor adjustments and README update
  • Loading branch information
apburnie authored May 24, 2022
1 parent 7075335 commit 736c8f5
Show file tree
Hide file tree
Showing 22 changed files with 604 additions and 399 deletions.
26 changes: 20 additions & 6 deletions explorer/client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,46 @@ Before running any of the following scripts `yarn` must run in order to install

# How to Switch Environment

## Connecting to Remote Gateway server(e.g., DevNet)
## Connecting to the DevNet Remote Gateway Server

The Sui Explorer frontend will use the DevNet Gateway server by default: https://explorer.devnet.sui.io
The Sui Explorer frontend will use the DevNet Gateway server by default: https://gateway.devnet.sui.io:443

```bash
yarn start

```

## Connecting to local RPC server
## Connecting to a Local RPC Server

Refer to [Local RPC Server & JSON-RPC API Quick Start](../../doc/src/build/json-rpc.md) on setting up a local RPC Server
Refer to [Local RPC Server & JSON-RPC API Quick Start](../../doc/src/build/json-rpc.md) on setting up a Local RPC Server. If we wish to locally run the website using a Local RPC Server, then run the following:

```bash
yarn start:local

```

## Connecting to static data
Alternatively, having run `yarn start`, click the green button at the top of the page and select the option 'Local'.

The Sui Explorer can also connect to a local, static JSON dataset that can be found at `./src/utils/static/mock_data.json`.
## Connecting to a Custom RPC URL

First run the following:

```bash
yarn start

```

Then, click the green button at the top and select the option 'Custom RPC URL'. Type the Custom RPC URL into the input box that emerges.

## Connecting to the Static Data

The Sui Explorer can also connect to a local, static JSON dataset that can be found at `./src/utils/static/mock_data.json` and `./src/utils/static/owned_object.json`.

For example, suppose we wish to locally run the website using the static JSON dataset and not the API, then we could run the following:

```bash
yarn start:static

```

# Other Yarn commands
Expand Down
24 changes: 0 additions & 24 deletions explorer/client/\

This file was deleted.

Loading

0 comments on commit 736c8f5

Please sign in to comment.