IPFS: bafybeig4d3u2yuo2aflp7pobps3rh5vlvlofowa6zrpwbpunwzxjtjbeoq
Arweave: vET9BYjLCjv8cjQDxfwbAzauQdaw92lwy4ZcCskeJN4
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 moldules/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.
This app uses an environment variables locally (not in docker-compose). For local development: See package.json.
Use in other chains you must create an .env file with this parameters:
BUILD_ENV=local(hardhat) | development(sepolia) | staging(sepolia) | production(mainnet)
VITE_APP_IS_AUCTION_ACTIVE=true | false | undefined
VITE_APP_RPC_URL_MAIN=string
VITE_APP_RPC_URL_FALLBACK=string
VITE_APP_WALLET_CONNECT_PROJECT_ID=string
For hardhat running there is no need for such file.
At deployment, github actions will inject these variables at build time.
In another terminal, run:
yarn dev
This starts the development server on http://localhost:3000
You need have docker installed, the easiest way is Docker Desktop
The easiest way to run everything for DEVELOPMENT is 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
Just need run this command
docker compose -f docker-compose.mainnet.yml up
Just need run this command
docker compose -f docker-compose.sepolia.yml up
You can access now type https://localhost:3000
in your browser to access.
nano /etc/hosts
add this line
127.0.0.1 governance.m0.local
or
sudo bash -c 'echo "127.0.0.1 governance.m0.local" >> /etc/hosts'
Thus, just need to type governance.m0.local
in your browser to access the governance app.
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.
If you ever encounted a error while pushing about tags error, try this:
git tag -d $(git tag -l)
git fetch
try push it again.