-
pnpm
v7.18.2(npm
andyarn
are not supported.) https://pnpm.io/installation -
docker
&docker-compose
- Create a fork of this repo.
- Clone your fork installing submodules
git clone --recurse-submodules [your-github-fork-url.git]
- Install dependencies
pnpm i
- Make an
.env
file in thedev-scripts
folder (see.env.example
) and write a seed phrase and deploy salt for hardhat.
First, do the steps above.
- Run a hardhat instance
cd apps/dev-scripts
pnpm dev
- In another terminal, run the Linux subgraph setup
cd apps/dxdao-subgraph
sudo ./setup-linux.sh
- When it finishes, terminate the hardhat instance
You might not have the relavant build tools for node-gyp to run. Check this if you're on Mac OS.
There's a process already running on port 5432 (usually postgres).
Run
sudo lsof -i :5432
to get the PID of the process, and
sudo kill -9 [PID]
to terminate it.
dxdao-subgraph:dev: ✖ Failed to deploy to Graph node http://127.0.0.1:8020/: subgraph validation error: [the specified block must exist on the Ethereum network]
dxdao-subgraph:dev: error Command failed with exit code 1.
dxdao-subgraph:dev: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
dxdao-subgraph:dev: ELIFECYCLE Command failed with exit code 1.
dxdao-subgraph:dev: ELIFECYCLE Command failed with exit code 1.
Then there was a problem during the Linux setup. Common sources of this are
- The subgraph was already running during the setup: make sure there are no instances of the subraph running. Run
docker compose down
- The hardhat instance wasn't running while doing the setup: make sure the hardhat instance is running, and only then run the linux setup.
If you see permission denied: ./apps/dxdao-subgraph/scripts/dev.sh
you might need to set permissions for dev script.
chmod +x ./apps/dxdao-subgraph/scripts/dev.sh
To run project locally you need to compile contracts, run hardhat node from dev-scripts, run subgraph docker, create/deploy local subgraph and run davi-frontend. To do this you can do it in separate terminals or run pnpm dev
from root project. See turbo.json
for turbo config
Running all at once:
pnpm run dev
Running in separate terminals:
- Run hardhat node locally:
pnpm run devScript
- Start docker containers:
pnpm run subgraph:compose-up
(Will require hardhat to be running and docker to be installed and open) - Create and deploy local subgraph:
pnpm run subgraph:start-local
(graph-node container should be running. Verify withdocker ps --filter "name=guilds-subgraph-graph-node*" -q | xargs -I {} docker inspect --format '{{.State.Status}}' {}
before execute start-local) - Build DAVI graph-client & run dApp:
pnpm run davi:build-graph-client && pnpm run davi:dev
- We are copy-pasting abis generated by dxdao-contracts into davi and subgraph apps. We need to automate this
We are using dxdao-contracts as submodule. Currently it is working under feature/monorepo-setup-w-create2
branch.
After this pr is merged we can change .gitmodules config to use dxdao-contracts with main/develop branch
To update dxdao-contracts submodule to latest commit use git submodule update --remote --merge
To update dxdao-contracts submodule branch use git submodule set-branch --branch [branch] dxdao-contracts