Giter Site home page Giter Site logo

chainx-org / governance-portal-v2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makerdao/governance-portal-v2

0.0 1.0 0.0 14.46 MB

Governance Portal V2

Home Page: https://vote.makerdao.com/

License: GNU Affero General Public License v3.0

JavaScript 8.48% TypeScript 91.51% Shell 0.01%

governance-portal-v2's Introduction

maker logo

Waving Hand Maker Governance Portal

An open source interface for Dai Credit System governance

Development

Install it and run:

npm install
npm run dev
# or
yarn
yarn dev

Requires node version >= v11.15.0

Environment (optional)

  1. Create a local .env file
  2. Set INFURA_KEY to a valid Infura API key
  3. Set ALCHEMY_KEY to a valid Alchemy API key
  4. Set TRACING_RPC_NODE to an ethereum RPC parity node with tracing enabled
  5. Set MONGODB_URI to a full mongodb uri (ex: mongodb+srv://...)
  6. Set MONGODB_COMMENTS_DB the mongodb db name to be used for vote comments
  7. Set USE_PROD_SPOCK to true to use the production spock instance
  8. Set USE_FS_CACHE to true if you want to use file system cache
  9. Set GITHUB_TOKEN to fetch delegates information from GitHub
  10. Set NEXT_PUBLIC_USE_MOCK to indicate to use mock data.
  11. Set NEXT_PUBLIC_MIXPANEL_DEV to the valid Mixpanel dev environment API key
  12. Set NEXT_PUBLIC_MIXPANEL_PROD to the valid Mixpanel prod environment API key
  13. Set ALCHEMY_GOERLI_API_KEY for the API key

If API keys aren't provided, both Alchemy and Infura will default to the public keys from ethers.js. This is probably fine in most cases, performance could just be a bit less consistent as many people are using these.

Architecture Diagram

Tests

The Governance portal includes 2 test suite: Jest and Cypress.

Jest tests under the folder tests currently execute unit tests of the platform. The e2e Cypress tests are under the "cypress" folder.

Test Commands

- npm run test -> runs Jest tests on livereload mode
- npm run test:ci -> runs all the Jest tests
- npm run e2e -> opens a Cypress browser for the e2e
- npm run e2e:headless -> runs e2e tests in a headless manner, for CI systems

Goerli Fork

E2E tests run on a fork of GOERLI. We do this because the governance contracts are deployed in Goerli for testing purposes. To run the fork of Goerli on the localhost:8545 (chain id: 31337), execute:

npm run hardhat 

Note: Make sure to fill in the ALCHEMY_GOERLI_API_KEY environment variable. After the network is running you can execute npm run e2e to execute the test suite.

You can use this local network from MetaMask, by switching to the "localhost:8545" network, with chain ID: 31337. In order to get a wallet with some MKR and ETH you can run the script: npm run fund that will send some MKR and ETH to the first 50 wallets under the /cypress/support/constants/keypairs.json.

Writting E2E:

Please refer to: https://docs.cypress.io/guides/references/best-practices and check current test examples under the cypress folder.

CI/CD

The CI/CD system is integrated with Github Actions.

After each push the system will execute:

yarn start:ci

The command yarn start:ci launches a detached process with hardhat, executes e2e in a headless mode and kills the hardhat process.

Contributing

See our contributing guide

governance-portal-v2's People

Contributors

jparklev avatar levity avatar adamgoth avatar tyler17 avatar shkfnly avatar rafinskipg avatar b-pmcg avatar ethanbennett avatar mikemckain avatar dependabot[bot] avatar zdumitru avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.