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 install
In one terminal:
yarn hardhat
This 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 dev
The 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 up
To force a rebuild, use
docker compose up --build
This will start:
- a test blockchain Hardhat on port
8545
- the Frontend app on port
3000
with 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:open
Then, 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 dev
In a second terminal tab:
yarn cy:open
To Run all tests:
yarn test
Build the application for production:
yarn generate
Locally preview production build:
yarn preview
Check out the NUXT deployment documentation for more information.
main
reflects the production-ready state.develop
, reflects the state with the latest delivered development changes for the next release.
Below you will a guide for the most common scenarios. Please refer to Git Flow for a more in-depth explanation.
We use feature branches to develop new features or fix existing ones.
- Branch off from:
develop
- Must merge back into:
develop
- Branch naming convention:
WEB3-1234/scope-of-the-changes-or-ticket-title
. Where WEB3-1234 matches the Jira ticket. - Open a pull request to incorporate your changes back to
develop
. ⚠️ Merge strategy: Squash and merge.
Release branches are used for production deployments.
- Branch off from:
develop
- Must merge back into:
main
anddevelop
- Branch naming convention:
release/x.x.x
. Wherex.x.x
is the release version. ⚠️ Merge strategy: Merge commit.
-
Create a new release branch
git fetch git checkout -b release/x.x.x origin/develop
-
Bump the version in
package.json
,apps/server/package.json
, andapps/web/package.json
. The release naming must match the version. -
Push your changes to GitHub and open a pull request against
main
. -
Wait for the pull request to get approved. Use a "Merge commit" to merge the pull request.
-
Let the team know about the upcoming deploy.
-
Run the workflow Build & Upload to PROD Governance targeting the
main
branch. -
Monitor the action, and let the team know once changes are live.
-
Populate the release to
develop
Do it via a pull request (suggested). Example: #399
Do it manually:
git checkout develop git pull origin develop # merge into develop git merge --no-ff release/x.x.x git push origin develop
-
The branch
release/x.x.x
can now be deleted in GitHub.
Hotfix branch is used to patch or fix something in production.
- Branch off from:
main
- Must merge back into:
main
anddevelop
, and any outgoingrelease/x.x.x
branch. - Branch naming convention:
hotfix/x.x.x
. Wherex.x.x
is the release version. ⚠️ Merge strategy: Merge commit.
Releasing the hotfix branch involves the same steps as a release/*
branch. Including version bumping. Refer to the section above for detailed steps.
- 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: Get at least one approval.