Welcome to the repository for the Mero Website - a React project implementing Web3 which allows users to interract with the Mero Protocol.
If you are interested in contributing, please check out our Contribution Guide
Dependencies:
To run the app locally:
- Clone the Repository to your local machine
- Open a Terminal at the app directory
- Change directory to the
webapp
directory - Run
yarn
- Run
yarn start
- Navigate to
http://localhost:3000/
To launch the application using mock data, use the following command:
env REACT_APP_USE_MOCK=1 yarn start
There are two types of tests supported, Unit Tests and Automation Tests.
Both need to be passing for any PR to be merged.
The following command can be used to run the unit tests:
yarn test
This launches the test runner in the interactive watch mode.
See the section about running tests for more information.
The following command can be used to run the automation tests:
yarn run cy:open
This runs Cypress in open mode so you can view the tests suites and see them run.
See the Cypress docs for more information.
Do not enter the private key of your main Ethereum wallet anywhere into Mero, Cypress, or your terminal. If you want to test using a private key, please create a new wallet that only holds Kovan ETH. No Mero employee will ever ask you for your private key and you should never share this with anyone.
We have some specs that make calls to the Kovan testnet. For these tests we initialise a Web3 connection using a private key that is set as an environment variable. When running in the pipeline this is pulled from the GitHub secrets, but when running locally you will need to set this yourself. To set the environment variable you can use: export CYPRESS_PRIVATE_KEY={{my_cool_private_key}}
. For the tests to pass you will need to have enough Kovan ETH on the wallet to cover the gas costs, and around 20 DAI. You can get DAI from this faucet.