|
1 |
| -# Welcome to the DAO DAO contributing guide <!-- omit in toc --> |
| 1 | +# Contributing to DAO DAO |
2 | 2 |
|
3 |
| -Thank you for investing your time in contributing to our project! |
| 3 | +Thanks for your interest in contributing. We're excited to welcome you |
| 4 | +into our community. :) |
4 | 5 |
|
5 |
| -Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable. |
| 6 | +We value kindness, humility, and low-ego communication. You can read |
| 7 | +our [Code of Conduct](./CODE_OF_CONDUCT.md) for a poetic version of |
| 8 | +this. |
6 | 9 |
|
7 |
| -All contributions will fall under our [our open-source license agreement](./LICENSE). |
| 10 | +There are many ways you can contribute. |
8 | 11 |
|
9 |
| -In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR. |
| 12 | +- If you're interested in doing smart contract work, you're in the |
| 13 | + right place. |
| 14 | +- If you want to work on our UI, check out the [dao-dao-ui |
| 15 | + repo](https://github.com/DA0-DA0/dao-dao-ui). |
| 16 | +- If you want to contribute documentation, check out our [docs |
| 17 | + repo](https://github.com/DA0-DA0/docs). |
10 | 18 |
|
11 |
| -## New contributor guide |
| 19 | +Getting started contributing to an open source project can be |
| 20 | +daunting. A great place to ask questions is the [DAO DAO |
| 21 | +Discord](https://discord.gg/sAaGuyW3D2). |
12 | 22 |
|
13 |
| -To get an overview of the project, read the [README](README.md). Here are some resources to help you get started with open source contributions: |
| 23 | +## Getting started |
14 | 24 |
|
15 |
| -- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github) |
16 |
| -- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git) |
17 |
| -- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow) |
18 |
| -- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests) |
| 25 | +To work on the DAO DAO smart contracts you'll need a reasonable |
| 26 | +understanding of the Rust programming language. The [Rust |
| 27 | +book](https://doc.rust-lang.org/book/) is a really good place to pick |
| 28 | +this up. |
19 | 29 |
|
20 |
| -### Issues |
| 30 | +Before picking up any issues, you may also want to read our [design |
| 31 | +wiki |
| 32 | +page](https://github.com/DA0-DA0/dao-contracts/wiki/DAO-DAO-Contracts-Design) |
| 33 | +which gives an overview of how all of the DAO DAO smart contracts fit |
| 34 | +together. |
21 | 35 |
|
22 |
| -#### Create a new issue |
| 36 | +Our development workflow is just like a regular Rust project: |
23 | 37 |
|
24 |
| -If you spot a problem, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/DA0-DA0/dao-contracts/issues/new/choose). |
| 38 | +- `cargo build` from the repository root to build the contracts. |
| 39 | +- `cargo test` from the repository root to test the contracts. |
25 | 40 |
|
26 |
| -#### Solve an issue |
| 41 | +To build WASM files for deploying on a blockchain, run: |
27 | 42 |
|
28 |
| -Scan through our [existing issues](https://github.com/DA0-DA0/dao-contracts/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See [Labels](/contributing/how-to-use-labels.md) for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. |
| 43 | +``` |
| 44 | +docker run --rm -v "$(pwd)":/code \ |
| 45 | + --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ |
| 46 | + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ |
| 47 | + --platform linux/amd64 \ |
| 48 | + cosmwasm/workspace-optimizer:0.12.6 |
| 49 | +``` |
29 | 50 |
|
30 |
| -### Make Changes |
| 51 | +From the repository root. |
31 | 52 |
|
32 |
| -#### Make changes in the UI |
| 53 | +## Getting ready to make a PR |
33 | 54 |
|
34 |
| -1. [Install Git LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/installing-git-large-file-storage). |
| 55 | +Before making a PR, you'll need to do two things to get CI passing: |
35 | 56 |
|
36 |
| -2. Fork the repository. |
| 57 | +1. Generate schema files for the contracts. |
| 58 | +2. Generate typescript interfaces from those schemas. |
37 | 59 |
|
38 |
| -3. Create a working branch and start with your changes! |
| 60 | +To generate schema files, run: |
39 | 61 |
|
40 |
| -### Commit your update |
| 62 | +``` |
| 63 | +./scripts/schema.sh |
| 64 | +``` |
41 | 65 |
|
42 |
| -Commit the changes once you are happy with them. See [Atom's contributing guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages) to know how to use emoji for commit messages. |
| 66 | +To generate the typescript interface, after generating the schema |
| 67 | +files, run: |
43 | 68 |
|
44 |
| -### Pull Request |
| 69 | +``` |
| 70 | +yarn --cwd ./types install --frozen-lockfile |
| 71 | +yarn --cwd ./types build |
| 72 | +yarn --cwd ./types codegen |
| 73 | +``` |
45 | 74 |
|
46 |
| -When you're finished with the changes, create a pull request, also known as a PR. |
| 75 | +To do this you'll need [yarn](https://yarnpkg.com/) installed. |
47 | 76 |
|
48 |
| -- Don't forget to [link the PR to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one. |
49 |
| - Once you submit your PR, a team member will review your proposal. We may ask questions or request for additional information. |
50 |
| -- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch. |
51 |
| -- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations). |
52 |
| -- If you run into any merge issues, checkout this [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) to help you resolve merge conflicts and other issues. |
| 77 | +## Deploying in a development environment |
53 | 78 |
|
54 |
| -### Your PR is merged! |
| 79 | +Build and deploy the contracts to a local chain running in Docker with: |
55 | 80 |
|
56 |
| -Congratulations :tada::tada: DAO DAO thanks you :sparkles:. |
| 81 | +```sh |
| 82 | +bash scripts/deploy_local.sh juno10j9gpw9t4jsz47qgnkvl5n3zlm2fz72k67rxsg |
| 83 | +``` |
57 | 84 |
|
58 |
| -Once your PR is merged, your contributions will be publicly visible. |
| 85 | +> Note: This Wasm account is from the [default |
| 86 | +> account](default-account.txt), which you can use for testing (DO NOT |
| 87 | +> store any real funds with this account). You can pass in any wasm |
| 88 | +> account address you want to use. |
| 89 | +
|
| 90 | +This will run a chain locally in a docker container, then build and |
| 91 | +deploy the contracts to that chain. |
| 92 | + |
| 93 | +The script will output something like: |
| 94 | + |
| 95 | +```sh |
| 96 | +NEXT_PUBLIC_CW20_CODE_ID=1 |
| 97 | +NEXT_PUBLIC_CW4GROUP_CODE_ID=2 |
| 98 | +NEXT_PUBLIC_CWCORE_CODE_ID=7 |
| 99 | +NEXT_PUBLIC_CWPROPOSALSINGLE_CODE_ID=11 |
| 100 | +NEXT_PUBLIC_CW4VOTING_CODE_ID=5 |
| 101 | +NEXT_PUBLIC_CW20STAKEDBALANCEVOTING_CODE_ID=4 |
| 102 | +NEXT_PUBLIC_STAKECW20_CODE_ID=13 |
| 103 | +NEXT_PUBLIC_DAO_CONTRACT_ADDRESS=juno1zlmaky7753d2fneyhduwz0rn3u9ns8rse3tudhze8rc2g54w9ysqgjt23l |
| 104 | +NEXT_PUBLIC_V1_FACTORY_CONTRACT_ADDRESS=juno1pvrwmjuusn9wh34j7y520g8gumuy9xtl3gvprlljfdpwju3x7ucssml9ug |
| 105 | +``` |
| 106 | + |
| 107 | +This output can be directly copy and pased into a `.env` file in the |
| 108 | +[DAO DAO UI](https://github.com/DA0-DA0/dao-dao-ui) for local |
| 109 | +development. |
| 110 | + |
| 111 | +Note, to send commands to the docker container: |
| 112 | + |
| 113 | +```sh |
| 114 | +docker exec -i cosmwasm junod status |
| 115 | +``` |
| 116 | + |
| 117 | +Some commands require a password which defaults to `xxxxxxxxx`. You can use them like so: |
| 118 | + |
| 119 | +```sh |
| 120 | +echo xxxxxxxxx | docker exec -i cosmwasm junod keys show validator -a |
| 121 | +``` |
0 commit comments