Skip to content

sudoblockio/icon-tracker-frontend

Repository files navigation

ICON Tracker

loopchain GitHub Release

Development Setup

Local
# Install dependencies
npm install

Mainnet

npm start

Testnets

npm run start --network=lisbon

Custom

npm run start \
  --rpc-endpoint=https://api.lisbon.icon.community \
  --api-endpoint=https://tracker.lisbon.icon.community \
  --wss-endpoint=wss://tracker.lisbon.icon.community \
  --nid=42
Docker

In order to point the docker container at custom endpoints, will need to build the container with the appropriate environment variables set.

  • To set to new network and use default endpoints set REACT_APP_NETWORK_NAME to mainnet, lisbon, or berlin
  • To run with a custom backend / endpoint set
    • REACT_APP_RPC_ENDPOINT
    • REACT_APP_API_ENDPOINT
    • REACT_APP_WSS_ENDPOINT

After setting these environment variables run:

docker-compose build 
docker-compose up -d 

Custom Backend

Please reference gochain-local-community for instructions on how to deploy / a custom backend along with this frontend. Comes up practically one click.

Build:

# build files to './build'
npm run build

Test:

Unit

npm run test

e2e

The e2e tests run with selenium and pytest. To run them, you will first need to have python installed with the virtual environment module. Then run:

# Install e2e test dependencies (pytest / selenium)
python3 -m venv env
source env/bin/activate
pip install -r e2e/requirements.txt
# Run the application 
npm run start 
# Then you can run the tests in another terminal 
make test-e2e

Set Endpoints

  1. Command line - Also see custom network above
npm run start --network=berlin
  1. Environment Variables
export \
  REACT_APP_RPC_ENDPOINT=https://lisbon.net.solidwallet.io \
  REACT_APP_API_ENDPOINT=https://tracker.lisbon.icon.community/ \
  REACT_APP_WSS_ENDPOINT=wss://tracker.lisbon.icon.community/ \
  REACT_APP_NID=42
  1. .env File

./.env

REACT_APP_RPC_ENDPOINT=https://lisbon.net.solidwallet.io
REACT_APP_API_ENDPOINT=https://tracker.lisbon.icon.community/
REACT_APP_WSS_ENDPOINT=wss://tracker.lisbon.icon.community/
REACT_APP_NID=42

Env files will additionally need to be sourced (ie source .env to inject into docker container builds)

See the local and docker sections for additional information on how to run in both settings.

Contributing

We use conventional commits for within this repo to generate our changelog and manage our release cycle. All commits should use one of these three prefixes:

  • feat:
    • Implement a new major feature to the tracker (ie a new page / view / data)
    • Increments minor version
    • Should tag issue in commit message (ie feat: add awesome page #123)
  • fix:
    • Fix something / implement a small change per new standards (ie add some governance variable)
    • Increments patch version
    • Should tag issue in commit message (ie fix: some page #123)
  • chore:
    • All commits except for above
    • Does not increment version
    • No need to tag issue unless relevant (ie chore: move some thing #123)

All contributions should be in the form of a PR with branch names suggestive of the issue being addressed (ie fix-something).

License