A collection of smart contracts for operating a DAO https://demo.dgov.io
Go to file
Ladd Hoffman 9935c70cec
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 31s Details
widget wip
2024-04-25 14:26:03 -05:00
.gitea/workflows Frontend stub 2024-02-21 18:01:41 -06:00
backend starting to ingetrate as widget 2024-04-24 17:37:19 -05:00
ethereum starting to ingetrate as widget 2024-04-24 17:37:19 -05:00
frontend widget wip 2024-04-25 14:26:03 -05:00
README.md successful semantic scholar import 2024-04-20 12:37:59 -05:00

README.md

DGF Prototype

Decentralized Governance Framework

Local development setup

Clone this repository to a directory on your machine

git clone https://gitea.dgov.io/DGF/dgf-prototype

Nginx

  1. Install nginx

     brew install nginx
    
  2. Install mkcert

     brew install mkcert
    
  3. Install root CA

     mkcert -install
    
  4. Create a certificate

     mkcert dgfprototype.dev
    
  5. Create certificates directory

     sudo mkdir /etc/nginx/certs
    
  6. Move the certificate to the certificates directory

     sudo mv dgfprototype.*.pem /etc/nginx/certs/
    
  7. Add the following to the http section of /etc/nginx/nginx.conf

     map $http_upgrade $connection_upgrade {
         default upgrade;
         '' close;
     }
    
  8. Add the following to a new file /etc/nginx/sites-available/dgfprototype_dev

     server {
             listen 443 ssl;
    
             server_name dgfprototype.dev;
             ssl_certificate     /etc/nginx/certs/dgfprototype.dev.pem;
             ssl_certificate_key /etc/nginx/certs/dgfprototype.dev-key.pem;
    
             location /api/ {
                     proxy_pass http://127.0.0.1:3003/;
             }
    
             location / {
                     proxy_pass http://127.0.0.1:3002/;
                     proxy_http_version 1.1;
                     proxy_set_header Upgrade $http_upgrade;
                     proxy_set_header Connection $connection_upgrade;
                     proxy_set_header Host $host;
             }
     }
    
  9. Create a symbolic link in sites-enabled/

     sudo ln -s /etc/nginx/sites-available/dgfprototype_dev /etc/nginx/sites-enabled
    
  10. Restart nginx

     sudo systemctl restart nginx
    

    or

     sudo brew services restart nginx
    
  11. Edit /etc/hosts to add the domain alias

     127.0.0.1  dgfprototype.dev
    

API

  1. In a new terminal window, navigate to dgf-prototype/backend

  2. Install the project

     npm install
    
  3. Copy the example configuration file

     cp .env.example .env
    
  4. Edit .env and set the following values

     PORT=3003
    
  5. Create the data directory

     mkdir data
    
  6. Run the daemon

     node src/index.js
    

Hardhat

  1. In a new terminal window, navigate to dgf-prototype/ethereum

  2. Install the project

     npm install
    
  3. Copy the example configuration file

     cp .env.example .env
    
  4. In .env, set a value for SEED_PHRASE or LOCAL_PRIVATE_KEY

  5. Run a hardhat node

     npx hardhat node
    
  6. In a separate terminal window, navigate again to dgf-prototype/ethereum

  7. Build and deploy the contracts

     npm run deploy-local
    

Metamask

  1. Install the Metamask extension in your browser

  2. In the Metamask extension, click the list of networks in the top left, and click "Add Network"

  3. At the bottom of the list of popular networks, click "Add a network manually"

Frontend

  1. In a new terminal window, navigate to dgf-prototype/frontend

  2. Install the project

     npm install
    
  3. Install vite

     npm i -g vite
    
  4. Run the development server

     vite dev
    
  5. Now you should be able to open the site at https://dgfprototype.dev

To run automatic staking

  1. Clone this repository to a directory on your machine

     git clone https://gitea.dgov.io/DGF/dgf-prototype
    
  2. Change to the ethereum directory

     cd ethereum
    
  3. Install the project using npm

     npm install
    
  4. Copy the example configuration file

     cp .env.example .env
    
  5. Export your Sepolia private key from MetaMask and add it to your .env file

     SEPOLIA_PRIVATE_KEY="YOURKEY"
    
  6. Run the automatic staking script

     npm run automatic-staking-sepolia