This tutorial has been written to document the best practices for setup of the solana program library governance program as of version 1.0.6. Specifically this was informed through the configuration of the Mango DAO.

During the process I managed to lock myself out of governance a few times, so I recommend to do a few test runs on devnet, instead of deploying straight to mainnet. In addition I recommend to reconsider the settings chosen here, as they might make no sense for your project.

First step to make your DAO fully autonomous, is to ensure that it runs it's own governance program. So let's download it from github and deploy it:

git clone <https://github.com/solana-labs/solana-program-library>
cd solana-program-library/governance/program
cargo build-bpf
solana program deploy ../../target/deploy/spl_governance.so

Now that you got the governance program up and running, keep the program id around, you'll need it in a minute.

The following steps also assume that you have already a governance token setup. In case you don't, you should create a governance token mint and allocate yourself some tokens so that you can vote on proposals.

Bring up the current version of the governance UI. Either clone the repo and build it yourself locally or use the version hosted on github. Replace the program id query string with the program id of your governance program in the following url: https://solana-labs.github.io/oyster-gov/#/?programId=VHYCbz6XnHhtgV8exTg67Jfmm2Yi69kuSCjoUYns9kY

Connect your wallet and click on "Register Realm" to bring up a modal. Input the display name for your DAO and the public key of your governance token mint. In addition you can setup a council. A lot of DAOs start with a council, that is formed by the early development team and therefore is more akin to a multi sig than a fully decentralized DAO. The council provides a failsafe that can vote and push proposals even in cases the necessary quorum can't be reached anymore due to lack of attention of the community. The council tokens can be burned by the council members to give up these special privileges.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/69c30e58-ac01-4315-a50c-bf05b697be38/Screen_Shot_2021-08-02_at_11.34.59_PM.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a6bfe7ca-d986-4f57-b902-c1f4ff439fd5/Untitled.png

Deposit your governance tokens to the Realm in order to get voting and proposal privileges. Afterwards you can create the first governance account of this realm using the menu on the right side.

In order to place the governance program itself under governance, we will need to create a program governance account and provide the program id we deployed to at the beginning of the tutorial as well as select the "transfer upgrade authority" toggle.

As this is the first time we will configure a governance account, let's dive deeper into the configuration options for this part.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/99510463-8025-4156-b630-fb3754162cda/Screen_Shot_2021-08-03_at_1.15.37_AM.png

min tokens to create proposal

This defines the minimum amount of tokens a DAO member need to have deposited into the governance realm in order create new proposals for others to vote on. You want this threshold to be large enough to ensure that proposals will have a high enough quality, yet small enough to allow a broad base of your users to create new proposals. Too high and the DAO will be tightly controlled and fail to decentralize. We went with 0.01% for now, but might want to reduce this as our DAO becomes even more decentralized.