Skip to content

Commit

Permalink
Explorer V2 (#275)
Browse files Browse the repository at this point in the history
* Migrate explorer to use v2 api

* Fix transaction status and overview values

* Add new logic for search, fix atx page, fix overview, fix right side block on rewards page, fix issue with transaction row

* Get sent/received for accounts list, fix epochs table, fix time block with account recent activity

* Add account stats, add loaders, cleanup

* Catch errors

* Use discovery service url to get api conf

* Override PUBLIC_API with env variable

* Fix issues with page refresh. Query data per row instead of all at the same time. Add stats_api env to override networks.json.

* Fix empty layer

* Fix account right side block and add loaders for rewards and transactions

* Fix right side block for smeshers and smeshers rewards page

* Fix loading issues

* Add malfeasance proofs

* Add throttle warning popup

* Fix rewards, transactions and minor issues

* Clean-up

* Set cache-control headers for index.html

* Add check if api is initialized, modify malfeasance msg and fix other issues

* Update env
  • Loading branch information
kacpersaw authored Oct 17, 2024
1 parent 3da5501 commit 0631014
Show file tree
Hide file tree
Showing 88 changed files with 9,805 additions and 1,809 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
REACT_APP_DISCOVERY_SERVICE_URL=
REACT_APP_API_BASE_URL=http://localhost:9094
REACT_APP_CUSTOM_API_URL=http://localhost:5001
REACT_APP_BITS_PER_LABEL=128
REACT_APP_LABELS_PER_UNIT=1024
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ jobs:

- name: Build
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks.json
REACT_APP_API_BASE_URL: https://localhost:9094
REACT_APP_CUSTOM_API_URL: http://localhost:5001
REACT_APP_BITS_PER_LABEL: 128
REACT_APP_LABELS_PER_UNIT: 1024
run: |
yarn
yarn build
44 changes: 4 additions & 40 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ jobs:
- name: Build to Mainnet Explorer
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks.json
REACT_APP_LABELS_PER_UNIT: 4294967296
run: |
yarn
yarn build
- name: Upload to Mainnet Explorer
run: gsutil -m rsync -r -d ./build gs://spacemesh-explorer

- name: Set cache-control headers for Mainnet Explorer
run: gsutil -m setmeta -h "Cache-Control:public, max-age=0, no-transform" -r gs://spacemesh-explorer/index.html

- name: Remove build dir
run: rm -rf ./build

Expand All @@ -39,43 +43,3 @@ jobs:
- name: Upload to Dev Explorer
run: gsutil -m rsync -r -d ./build gs://spacemesh-explorer-dev

- name: Build to testnet-15 Explorer
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks-testnet-15.json
run: |
yarn
yarn build
- name: Upload to testnet-15 Explorer
run: gsutil -m rsync -r -d ./build gs://testnet-15-explorer.spacemesh.network

- name: Build to testnet-atxmerge2 Explorer
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks-testnet-atxmerge2.json
run: |
yarn
yarn build
- name: Upload to testnet-atxmerge2 Explorer
run: gsutil -m rsync -r -d ./build gs://testnet-atxmerge2-explorer.spacemesh.network

- name: Build to testnet-atxmerge3 Explorer
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks-testnet-atxmerge3.json
run: |
yarn
yarn build
- name: Upload to testnet-atxmerge3 Explorer
run: gsutil -m rsync -r -d ./build gs://testnet-atxmerge3-explorer.spacemesh.network

- name: Build to testnet-hare-4 Explorer
env:
REACT_APP_DISCOVERY_SERVICE_URL: https://configs.spacemesh.network/networks-testnet-hare-4.json
run: |
yarn
yarn build
- name: Upload to testnet-hare-4 Explorer
run: gsutil -m rsync -r -d ./build gs://testnet-hare-4-explorer.spacemesh.network
9 changes: 9 additions & 0 deletions api/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
["react-app", { "absoluteRuntime": false }],
"@babel/preset-flow"
],
"plugins": [
"@babel/plugin-transform-flow-strip-types"
]
}
11 changes: 11 additions & 0 deletions api/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[ignore]

[include]

[libs]

[lints]

[options]

[strict]
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
23 changes: 23 additions & 0 deletions api/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
8 changes: 8 additions & 0 deletions api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.babelrc
.flowconfig
.gitignore
README.md
package.json
src/api.js
src/configuration.js
src/index.js
1 change: 1 addition & 0 deletions api/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.6.0
42 changes: 42 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## [email protected]

This generator creates Flow typed JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:

Environment
* Node.js
* Webpack
* Browserify

Language level
* ES6

Module system
* ES6 module system

### Building

To build and compile the flow typed sources to javascript use:
```
npm install
# The dependency `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables
env BABEL_ENV={YOUR_ENV} npm run build
```

### Publishing

First build the package then run ```npm publish```

### Consuming

navigate to the folder of your consuming project and run one of the following commands.

_published:_

```
npm install [email protected] --save
```

_unPublished (not recommended):_

```
npm install PATH_TO_GENERATED_PACKAGE --save
Loading

0 comments on commit 0631014

Please sign in to comment.