Fleek (IPFS): governance-m0.on-fleek.app
The dApp is based on the TTG contracts in order to run the local testnet. Although it does not keep track of versioning of TTG yet. Meaning, the FE code base has to be updated to latest changes of TTG otherwise it might break.
The repo is hosting the latest abis and bytecodes of ttg at folder modules/ttg
- then run
yarn wagmi generate - Finally, update the lib/sdk.ts file replace the import
"wagmi/codegen";to"@wagmi/core/codegen"
Depending on contract changes this file must be also updated with correct import dependencies of contracts:
/wagmi.config.ts
Make sure to install the dependencies:
yarn installIn one terminal:
yarn hardhatThis starts a test blockchain on port 8545.
Set up your environment variables:
cp env.example .env
And set BUILD_ENV to local
Run the app:
yarn devThe app will be available at http://localhost:3000
If you prefer using Docker to run the app, you can do it with docker-compose:
ssh-add
docker compose upTo force a rebuild, use
docker compose up --buildThis will start:
- a test blockchain Hardhat on port
8545 - the Frontend app on port
3000with live reloading when files change
There are other alternate chain configurations for Docker:
- mainnet:
docker compose -f docker-compose.mainnet.yml up - sepolia:
docker compose -f docker-compose.sepolia.yml up
Cypress can be used to quickly setting up your local environment. With Cypress you can automate proposal creation and epoch forwarding to set Transfer or Voting epochs.
Take a look at available tests by running
yarn cy:openThen, modify the test of your interest on ./cypress to only run the steps you need.
You can test everything locally with 5 pre-funded accounts.
In metamask, import a wallet using the seed phrase
1. test
2. test
3. test
4. test
5. test
6. test
7. test
8. test
9. test
10. test
11. test
12. junk
Afterward, in metamask, each time you create a new account, for up to 5 accounts, they will all have ETH, CASH, VOTE, VALUE and can participate in governance. You can switch between accounts and vote on proposals to achieve a threshold.
Each time hardhat is restarted, metamask will need to be reset
Settings > Advanced > Clear activity
This resets the nonce and state for the wallet
We use cypress that on every .cy.ts file deploys the TTG contract found on hardhat/deploy-ttg.ts
To Run specific test or debug:
In one terminal tab:
yarn devIn a second terminal tab:
yarn cy:openTo Run all tests:
yarn testBuild the application for production:
yarn generateLocally preview production build:
yarn previewCheck out the NUXT deployment documentation for more information.
We use a single-branch workflow with main as the source of truth.
Railway preview URLs are our micro-staging environment for validating changes before merge.
Once a PR is merged, the code is promoted to production.
We use feature branches to develop new features or fix existing ones.
- Branch off from:
main - Must merge back into:
main - Branch naming convention:
FS-1234/scope-of-the-changes-or-ticket-title. Where FS-1234 matches the Linear ticket. - Open a pull request to incorporate your changes back to
main. - Use the Railway preview URL as the micro-staging environment for QA and review.
- If a feature should not be promoted yet, keep it in the PR until it is ready to ship.
⚠️ Merge strategy: Squash and merge.
- Git commits: We follow (non-strictly) conventional commits.
- Pull requests: The title follows conventional commits as well. Description is a must. Please include screenshots or videos for visual changes, testing evidence and any other relevant information for reviewers. Explain why and what changed not how.
- Approvals are optional. You are free to request reviews from specific team members if you want extra eyes on your changes. Ultimately, you are responsible for the quality of your code.